/* ============================================================
   MyPortal Social — Discord-style 3-column app (dark Fluent)
   Uses theme tokens from desktop.css (--accent, --win-bg, …)
   ============================================================ */

/* The host pages (social.html standalone, dashboard <main>) paint their
   html/body with NO background — the browser canvas is WHITE. On mobile the
   social page is a fixed overlay, so whenever it is shorter than the screen
   (virtual keyboard up, mid-resize, iOS scroll modes) that white canvas is
   exposed as a jarring strip / full white screen. Pin the canvas to the app's
   own dark color so any exposed area blends in (iOS Safari + Android). */
html, body { background: #1f1f1f; }

/* hidden attribute must win over the display:flex set on dialogs/stage */
#socialPage [hidden] { display: none !important; }

#socialPage {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #1f1f1f;
    color: var(--win-text, #fff);
    font-family: var(--desk-font, 'Segoe UI', system-ui, sans-serif);
    font-size: 14px;
    user-select: text;
    -webkit-user-select: text;
    cursor: auto;
}
/* Mobile: the page lives inside the dashboard's <main>, which is taller than
   the screen — so tapping the input makes the browser scroll the DOCUMENT and
   the social header scrolls out of reach. Instead pin the whole social page
   as a fixed full-screen overlay: the header can never scroll away, and JS
   (visualViewport in social.js) pins the height to the visible area so the
   composer always sits fully above the virtual keyboard.
   (Scoped to mobile — on desktop the page lives in a window frame where
   100% is correct.) */
@media (max-width: 768px) {
    #socialPage {
        position: fixed;
        left: 0;
        top: 0;
        right: 0;
        bottom: auto;
        height: 100vh;
        height: 100dvh;
        z-index: 300;
        overscroll-behavior: none;
    }
}

#socialPage ::-webkit-scrollbar { width: 8px; height: 8px; }
#socialPage ::-webkit-scrollbar-track { background: transparent; }
#socialPage ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }
#socialPage ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

#socialPage button { font-family: inherit; }
#socialPage input[type="range"],
#socialPage input[type="radio"] { accent-color: var(--accent, #4cc2ff); }

/* ---------------- left rail: channels / DMs / user panel ---------------- */
.soc-left {
    flex: none;
    width: 210px;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #191919;
    border-right: 1px solid var(--win-border, rgba(255,255,255,.08));
}
.soc-scroll { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.soc-sec {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 12px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .6px;
    color: var(--win-text-2, #cfcfcf);
    opacity: .85;
}
/* item 11l: glyphs were 11px inside 20px buttons — barely visible. Bigger icon, same button. */
.soc-sec .soc-mini { margin-left: auto; width: 20px; height: 20px; font-size: 14px; }
/* Clickable section headers (TEXT / VOICE CHANNELS) → back to home */
.soc-sec[data-gotohome] { cursor: pointer; border-radius: 6px; }
.soc-sec[data-gotohome] span { transition: color .12s ease; }
.soc-sec[data-gotohome]:hover span { color: var(--accent, #4cc2ff); text-decoration: underline; }
.soc-chanlist, .soc-dmlist { padding: 2px 8px; }

.soc-chan {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    margin: 1px 0;
    border-radius: 6px;
    font-size: 13px;
    color: var(--win-text-2, #cfcfcf);
    cursor: pointer;
}
.soc-chan:hover { background: rgba(255,255,255,.05); color: #fff; }
.soc-chan.active { background: rgba(76,194,255,.14); color: #fff; }
.soc-chan.active::before, .soc-dm.active::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 3px;
    background: var(--accent, #4cc2ff);
    box-shadow: 0 0 8px rgba(76,194,255,.6);
}
.soc-chan.muted { opacity: .45; }
.soc-chan-ic { flex: none; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; opacity: .9; }
.soc-chan-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v50: private-channel lock — the site's own silver line-glyph (same
   design language as the home screen), sized to sit on the name line */
.soc-chan-lock {
    display: inline-flex; align-items: center; justify-content: center;
    vertical-align: -1.5px;
    margin-left: 5px;
    color: var(--win-text-2, #cfcfcf);
    opacity: .8;
}
.soc-chan-lock .hi { width: 11px; height: 11px; }
.soc-chan-meta { flex: none; font-size: 10.5px; color: var(--win-text-2, #cfcfcf); }
.soc-chan-mgmt { width: 20px; height: 20px; font-size: 12px; flex: none; }
.soc-chan-mgmt:hover { background: rgba(255,255,255,.18); color: #fff; }

.soc-dm {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    margin: 1px 0;
    border-radius: 6px;
    cursor: pointer;
}
.soc-dm:hover { background: rgba(255,255,255,.05); }
.soc-dm.active { background: rgba(76,194,255,.14); }
.soc-dm.muted { opacity: .45; }
.soc-dm-name { flex: 1; min-width: 0; font-size: 13px; color: var(--win-text-2, #cfcfcf); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-dm.active .soc-dm-name { color: #fff; }
.soc-dm .soc-dot { border-color: #1e1f22; }
.soc-dm .soc-badge { margin-left: auto; }

/* Right-panel name rows: normal cursor + no text-select I-beam */
.soc-p-name, .soc-p-info { cursor: default; user-select: none; -webkit-user-select: none; }
.soc-p-name .soc-rbadge { margin-left: 6px; }

.soc-badge {
    flex: none;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--accent, #4cc2ff);
    color: #08202e;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Phase C: two-tier channel badges */
.soc-badge-mention { background: #f23f43; color: #fff; }
.soc-badge-dot {
    flex: none;
    width: 8px; height: 8px; min-width: 8px; padding: 0;
    border-radius: 4px;
    background: var(--accent, #4cc2ff);
    opacity: .65;
    align-self: center;
}
.soc-chan.soc-has-unread .soc-chan-name { font-weight: 700; color: #fff; }
/* Phase C: rail mention badge (red) — overrides the white unread style */
.soc-badge.unread.soc-rail-mention { background: #f23f43; color: #fff; }


.soc-userpanel {
    flex: none;
    border-top: 1px solid var(--win-border, rgba(255,255,255,.08));
    background: #161616;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
/* Desktop: stretch the bottom-left voice/user bar all the way to the far
   left, under the 72px server rail — like Discord's user bar. The rail keeps
   its + / compass buttons clear of the bar by reserving padding-bottom equal
   to the bar's live height (--soc-up-h, set in renderUserPanel), so a long
   server list still scrolls and those buttons stay reachable above the bar.
   #socialPage prefix: the generic .soc-rail rule later in this file declares
   `padding: 12px 0`, which would otherwise wipe this padding-bottom (later
   declaration wins) and let the voice bar cover the rail's last icons. */
@media (min-width: 769px) {
    .soc-userpanel {
        margin-left: -72px;
        position: relative;
        z-index: 2;
    }
    #socialPage .soc-rail {
        padding-bottom: calc(var(--soc-up-h, 120px) + 14px);
    }
}
.soc-up-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.soc-up-conn { font-size: 13px; font-weight: 700; color: #43bf94; flex: none; }
.soc-up-conn.off { color: #9a9a9a; }
.soc-up-connch { font-size: 12px; color: var(--win-text-2, #cfcfcf); opacity: .8; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-up-calltimer { font-size: 12px; font-weight: 700; color: var(--accent, #4cc2ff); font-variant-numeric: tabular-nums; letter-spacing: .3px; flex: none; }
.soc-up-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.soc-up-ping { display: inline-flex; align-items: center; cursor: pointer; padding: 3px 2px; border-radius: 5px; transition: background .15s; }
.soc-up-ping:hover { background: rgba(255,255,255,.10); }
.soc-bars { display: inline-flex; align-items: flex-end; gap: 2px; margin-right: 2px; }
.soc-bars i { width: 3px; border-radius: 1px; background: rgba(255,255,255,.18); display: block; }
.soc-bars i:nth-child(1) { height: 5px; }
.soc-bars i:nth-child(2) { height: 8px; }
.soc-bars i:nth-child(3) { height: 11px; }
.soc-bars i:nth-child(4) { height: 14px; }
.soc-bars i.on { background: currentColor; }
.soc-up-pingms { font-size: 11px; font-weight: 600; margin-left: 5px; }
/* v77.3: my loss indicator in the bottom-left status bar (↑ upload, ↓ download) */
.soc-up-loss { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: rgba(230,234,238,.75); white-space: nowrap; }
.soc-up-loss b { font-weight: 700; }
.soc-up-disconnect {
    width: 32px; height: 28px;
    border: 1px solid rgba(232,17,35,.6);
    border-radius: 7px;
    background: rgba(232,17,35,.18);
    color: #ff8f9d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s;
}
.soc-up-disconnect:hover { background: #e81123; border-color: #e81123; color: #fff; }
.soc-up-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.soc-big {
    height: 42px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.05);
    color: var(--win-text-2, #cfcfcf);
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, border-color .12s;
}
.soc-big:hover { background: rgba(255,255,255,.11); color: #fff; }
.soc-big.active { background: rgba(76,194,255,.14); border-color: var(--accent, #4cc2ff); color: var(--accent, #4cc2ff); }
.soc-up-foot { display: flex; align-items: center; gap: 8px; }
.soc-up-id { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.soc-up-av { flex: none; cursor: pointer; border-radius: 50%; transition: transform .12s ease; }
.soc-up-av:hover { transform: scale(1.08); }
.soc-up-idtxt { display: flex; flex-direction: column; min-width: 0; }
.soc-up-name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-up-status { font-size: 10.5px; color: var(--win-text-2, #cfcfcf); opacity: .75; }
.soc-up-status.muted { color: #f0b232; opacity: 1; }
.soc-ping-toggle {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 4px;
    color: var(--win-text-2, #cfcfcf);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    cursor: pointer;
    transition: background .12s;
}
.soc-ping-toggle:hover { background: rgba(255,255,255,.12); }
.soc-up-err {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #e81123;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .1s;
}
.soc-up-err:hover { transform: scale(1.15); }
.soc-txt-btn {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 5px;
    color: var(--win-text-2, #cfcfcf);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.soc-txt-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: #fff; }
.soc-txt-btn.active { background: rgba(76,194,255,.15); border-color: var(--accent, #4cc2ff); color: var(--accent, #4cc2ff); }


/* ---------------- voice channel presence (Discord-style) ---------------- */
.soc-vwrap {
    margin: 2px 4px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.045);
    /* v50: same subtle dark depth as the chat column (.soc-main) */
    background: linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,0) 55%, rgba(0,0,0,.14) 100%);
}
.soc-vlist { padding: 1px 6px 3px 26px; display: flex; flex-direction: column; gap: 1px; }
.soc-vuser {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--win-text-2, #cfcfcf);
    cursor: pointer;
}
.soc-vuser:hover { background: rgba(255,255,255,.06); color: #fff; }
.soc-vuser.me { color: var(--win-text-2, #cfcfcf); }
.soc-vuser-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- message delete ----------------
   Floated out of the text flow: sits at the far right, centered on the
   message, so it adds zero height and the chat lines stay tightly packed. */
.soc-msg-del {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: rgba(10, 12, 16, 0.55);
    color: var(--win-text-2, #cfcfcf);
    font-size: 10px;
    line-height: 1;
    opacity: 0;
    cursor: pointer;
}
.soc-msg:hover .soc-msg-del { opacity: .75; }
.soc-msg-del:hover { background: rgba(232,17,35,.85); color: #fff; opacity: 1; }

/* ---------------- delete confirmation popover ---------------- */
.soc-del-pop {
    position: fixed;
    z-index: 4000;
    width: 236px;
    box-sizing: border-box;
    background: var(--win-bg, #1f2025);
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 10px;
    padding: 10px 12px 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    animation: socDelPopIn .14s ease;
}
.soc-del-pop[hidden] { display: none; }
@keyframes socDelPopIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.soc-del-pop-q { font-size: 13px; font-weight: 600; color: var(--win-text, #fff); margin-bottom: 6px; }
.soc-del-pop-msg {
    font-size: 12px;
    color: var(--win-text-2, #cfcfcf);
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 8px;
    max-height: 54px;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.soc-del-pop-btns { display: flex; gap: 8px; justify-content: flex-end; }
.soc-del-pop-btns .soc-btn { padding: 5px 12px; font-size: 12px; }
.soc-del-pop-del { background: #e81123; border-color: #e81123; color: #fff; font-weight: 600; }
.soc-del-pop-del:hover { background: #ff2d40; border-color: #ff2d40; }
.soc-del-pop-tip { margin-top: 7px; font-size: 10px; color: var(--win-text-2, #cfcfcf); opacity: .55; text-align: right; }

/* ---------------- Phase 1 item 10: report modal ---------------- */
.soc-report-modal {
    position: fixed; inset: 0; z-index: 4200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
    animation: socReportFade .12s ease;
}
.soc-report-modal[hidden] { display: none; }
@keyframes socReportFade { from { opacity: 0; } to { opacity: 1; } }
.soc-report-box {
    width: min(420px, calc(100vw - 32px)); box-sizing: border-box;
    background: var(--win-bg, #1f2025);
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 14px; padding: 18px 18px 14px;
    box-shadow: 0 18px 48px rgba(0,0,0,.6);
    animation: socReportIn .16s ease;
}
@keyframes socReportIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
/* v56 polish: icon-chip header matching the app's stroke-icon language */
.soc-report-head { display: flex; align-items: center; gap: 10px; }
.soc-report-hic { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: #f0b232; background: rgba(240,178,50,.14); }
.soc-report-hic .hi { flex: none; }
.soc-report-h { font-size: 15px; font-weight: 700; color: var(--win-text, #fff); }
.soc-report-sub { font-size: 12px; color: var(--win-text-2, #cfcfcf); margin: 2px 0 12px; overflow-wrap: anywhere; }
.soc-report-submit { display: inline-flex; align-items: center; }
.soc-report-submit .hi { flex: none; }
.soc-report-label { font-size: 12px; font-weight: 600; color: var(--win-text, #fff); margin: 12px 0 5px; }
.soc-report-opt { font-weight: 400; color: var(--win-text-2, #cfcfcf); opacity: .7; }
.soc-report-select, .soc-report-text {
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,.05); color: var(--win-text, #fff);
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit;
}
.soc-report-select:focus, .soc-report-text:focus { outline: none; border-color: var(--accent, #4cc2ff); }
.soc-report-text { resize: vertical; min-height: 62px; }
.soc-report-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.soc-report-btns .soc-btn { padding: 7px 14px; font-size: 13px; gap: 6px; }
.soc-report-submit { background: #e81123; border-color: #e81123; color: #fff; font-weight: 600; }
.soc-report-submit:hover { background: #ff2d40; border-color: #ff2d40; }

/* Phase 1 item 10 report-action notices now use the site-wide Win11 toast
   (window.WM.toast with persistent=true, see social.js _persistentAlert) so
   they match every other notification's styling. No custom CSS needed. */

/* ---------------- user options + profile modals ---------------- */
.soc-av-lg { width: 52px; height: 52px; font-size: 22px; }
.soc-uo-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.soc-uo-name { font-size: 15px; font-weight: 700; }
.soc-uo-sub { font-size: 11px; color: var(--win-text-2, #cfcfcf); }
.soc-uo-btns { display: flex; flex-direction: column; gap: 6px; }
.soc-uo-btns .soc-btn { justify-content: flex-start; }
.soc-prof-av { display: flex; justify-content: center; margin: 10px 0 6px; }
.soc-set-profile { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.soc-set-av { flex: none; display: flex; }
.soc-set-pname { font-size: 14px; font-weight: 700; }

/* v51 — settings profile: avatar hero banner (see below). Section centers it. */
.soc-set-profile-sec { display: flex; flex-direction: column; align-items: center; }
/* Settings "My apps" section (right after Storage): Notes / Live / Games in
   one equal row. Custom-designed — same visual family as the DM-panel quick grid. */
.soc-apps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}
.soc-apps-btn {
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px 11px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    color: var(--win-text, #e9eaec);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    transition: background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}
.soc-apps-btn:hover {
    background: rgba(76,194,255,.12);
    border-color: rgba(76,194,255,.42);
    color: #fff;
    transform: translateY(-1px);
}
.soc-apps-btn:active { background: rgba(76,194,255,.2); transform: none; }
.soc-apps-btn svg { flex: none; color: var(--accent, #4cc2ff); }
/* v51 — settings profile hero: Spotify/Discord-style banner. Layers back→front:
   base fill → blurred-avatar glow → palette gradients → film grain → avatar disc.
   The palette is extracted from the avatar in JS (canvas, cached, themed
   fallback) — no libraries, no external assets. */
.soc-avhero {
    position: relative;
    width: 100%;
    height: 190px;
    margin: 12px auto 4px;
    border-radius: 16px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #1e1f22; /* base fill — the banner never looks empty */
    /* fallback palette (muted theme blue + purple) — replaced by JS when the
       avatar's own colors are extracted */
    --h-c1:  rgb(64,105,159);
    --h-c2:  rgb(94,82,158);
    --h-c3:  rgb(58,66,92);
    --h-c1g: rgba(64,105,159,.50);
    --h-c2g: rgba(94,82,158,.42);
}
.soc-avhero-layer { position: absolute; inset: 0; pointer-events: none; }
/* L1 — blurred avatar: the "glow" that ties the banner to the photo
   (opacity 0 until a real avatar exists; scale hides the blur edge bleed) */
.soc-avhero-blur {
    background-size: cover; background-position: center;
    filter: blur(40px) saturate(1.4);
    transform: scale(1.25);
    opacity: 0;
    transition: opacity .6s ease;
}
.soc-avhero-blur.soc-avhero-on { opacity: .6; }
/* L2 — two soft radial gradients from the extracted palette */
.soc-avhero-grad {
    background:
        radial-gradient(120% 95% at 10% 0%, var(--h-c1g) 0%, rgba(0,0,0,0) 55%),
        radial-gradient(130% 110% at 90% 100%, var(--h-c2g) 0%, rgba(0,0,0,0) 58%);
    mix-blend-mode: screen;
}
/* L3 — film grain (inline SVG turbulence: zero external assets) */
.soc-avhero-grain {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    background-size: 140px 140px;
    opacity: .05;
    mix-blend-mode: overlay;
}
/* Avatar disc — circular hero with ring + depth shadow */
.soc-avhero-avatar { position: relative; z-index: 2; width: 150px; height: 150px; flex: none; }
.soc-avhero-img {
    width: 100%; height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #17181d;
    border: 2px solid rgba(255,255,255,.72);
    box-shadow: 0 12px 36px rgba(0,0,0,.55), 0 0 0 5px rgba(0,0,0,.18), 0 0 24px var(--h-c1g, rgba(64,105,159,.25));
}
/* scoped to the hero container (higher specificity) so the later base
   .soc-av 30px rule can't shrink it */
.soc-avhero-img .soc-av-hero { width: 100%; height: 100%; border-radius: 20px; font-size: 52px; }
/* ⋯ stays at the bottom-right of the avatar — semi-transparent dark circle,
   above every banner layer so it's legible over any palette */
.soc-avhero-dots {
    position: absolute; right: -3px; bottom: -3px;
    width: 32px; height: 32px; padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.3);
    background: rgba(15,15,19,.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #e8e9ec;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s ease, transform .12s ease;
    z-index: 3;
}
.soc-avhero-dots:hover { background: rgba(42,44,52,.92); transform: scale(1.06); }
@media (max-width: 560px) {
    .soc-avhero { height: 160px; }
    .soc-avhero-avatar { width: 110px; height: 110px; }
    .soc-avhero-img { border-radius: 14px; }
    .soc-avhero-img .soc-av-hero { border-radius: 14px; font-size: 38px; }
}
/* ⋯ avatar menu popover (Change Picture / Delete) */
.soc-avmenu {
    position: fixed;
    z-index: 2147483000;
    min-width: 168px;
    padding: 5px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(24,24,28,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    display: flex; flex-direction: column; gap: 2px;
}
.soc-avmenu-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none; border-radius: 7px;
    background: transparent;
    color: var(--win-text, #f0f0f0);
    font-size: 12.5px;
    cursor: pointer;
    text-align: left;
    transition: background .12s, color .12s;
}
.soc-avmenu-item:hover { background: rgba(255,255,255,.09); }
.soc-avmenu-item .hi { color: var(--win-text-2, #cfcfcf); flex: none; }
.soc-avmenu-item.danger { color: #ff6b6e; }
.soc-avmenu-item.danger .hi { color: #ff6b6e; }
.soc-avmenu-item.danger:hover { background: rgba(242,63,67,.16); color: #ff8a8d; }
/* v54 — presence status (Online/Away/Busy/Offline) — bottom-left panel + menus */
.soc-up-status-st { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; opacity: 1; }
.soc-up-status-st:hover { opacity: .8; }
.soc-st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.soc-st-dot.st-online { background: #23a55a; }
.soc-st-dot.st-away { background: #f0b232; }
.soc-st-dot.st-busy { background: #f23f43; }
.soc-st-dot.st-offline { background: #80848e; }
.soc-st-label { opacity: .8; }
.soc-st-opt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; vertical-align: middle; margin: 0 2px; }
.soc-st-opt.st-online { background: #23a55a; }
.soc-st-opt.st-away { background: #f0b232; }
.soc-st-opt.st-busy { background: #f23f43; }
.soc-st-opt.st-offline { background: #80848e; }
.soc-st-check { margin-left: auto; color: var(--win-text-2, #cfcfcf); }
.soc-statusmenu-hint { padding: 6px 10px 4px; font-size: 10.5px; color: var(--win-text-2, #cfcfcf); opacity: .6; line-height: 1.45; }
/* Status picker: shrink the box to the width of the option labels */
.soc-statusmenu { min-width: 0; width: max-content; }
.soc-statusmenu .soc-avmenu-item { width: auto; min-width: 100%; white-space: nowrap; }
/* v52 — avatar crop editor: card context preview with centered cutout */
.av-edit-card {
    position: relative;
    width: 100%;
    max-width: 340px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background:
        linear-gradient(155deg, rgba(76,194,255,.10) 0%, rgba(90,120,255,.06) 40%, rgba(255,255,255,.03) 100%),
        #1e1f22;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 12px 32px rgba(0,0,0,.5), 0 0 0 4px rgba(76,194,255,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.av-edit-card:active { cursor: grabbing; }
/* The avatar cutout window — exactly the shape users will see */
.av-edit-window {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.72);
    box-shadow: 0 8px 24px rgba(0,0,0,.55), 0 0 0 4px rgba(0,0,0,.2);
    background: #14151a;
    flex: none;
}
.av-edit-window img {
    position: absolute;
    max-width: none; max-height: none;
    pointer-events: none;
    will-change: width, height, left, top;
}
/* Dimmed card context labels (subtle, non-interactive) */
.av-edit-label {
    position: absolute;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.22);
    pointer-events: none;
}
.av-edit-label-tl { top: 12px; left: 16px; }
.av-edit-label-bl { bottom: 12px; left: 16px; }
.av-edit-ctl { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 320px; margin-top: 12px; }
.av-edit-lab { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--win-text-2, #cfcfcf); flex: none; }
.av-edit-ctl input[type=range] { flex: 1; accent-color: #4cc2ff; cursor: pointer; }
.av-edit-hint { font-size: 11px; color: var(--win-text-2, #cfcfcf); opacity: .75; text-align: center; margin-top: 8px; }

/* ---------------- main column ---------------- */
.soc-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* v49.5 — very subtle depth: a whisper of light at the top, gently
       darkening toward the bottom (fixed layer, doesn't scroll). */
    background:
        linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,0) 130px, rgba(0,0,0,0) 62%, rgba(0,0,0,.10) 88%, rgba(0,0,0,.16) 100%),
        #1f1f1f;
    position: relative;
    overflow: hidden; /* only .soc-messages scrolls — header + input always visible */
}
.soc-header {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--win-border, rgba(255,255,255,.08));
    /* a touch darker than the #1f1f1f message body so the header reads as its own band */
    background: #191919;
    /* depth: a soft shadow falling onto the messages just below the header */
    position: relative;
    z-index: 2;
    box-shadow: 0 7px 16px rgba(0,0,0,.36), 0 2px 5px rgba(0,0,0,.25);
}
.soc-head-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.soc-head-title > div { display: flex; flex-direction: column; min-width: 0; }
.soc-head-ic {
    flex: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(255,255,255,.06);
    color: var(--win-text-2, #cfcfcf);
    font-size: 13px;
}
/* DM header title is a tap target (opens the full profile) — say so. */
.soc-head-dm { cursor: pointer; border-radius: 8px; transition: background .12s ease; }
.soc-head-dm:hover { background: rgba(255,255,255,.05); }
.soc-head-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-head-sub { font-size: 11px; color: var(--win-text-2, #cfcfcf); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-head-actions { flex: none; display: flex; gap: 6px; margin-left: auto; }
.soc-iconbtn {
    flex: none;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.07);
    color: var(--win-text, #fff);
    font-size: 15px;
    cursor: pointer;
}
.soc-iconbtn:hover { background: var(--accent, #4cc2ff); color: #08202e; }

/* screen-share stage */
.soc-stage {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background: #191919;
    border-bottom: 1px solid var(--win-border, rgba(255,255,255,.08));
}
.soc-stage-card {
    width: 320px;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    background: #111;
}
.soc-stage-head {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--win-text-2, #cfcfcf);
    background: rgba(255,255,255,.04);
}
.soc-stage-video { display: block; width: 100%; max-height: 220px; background: #000; }

/* messages */
.soc-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden; /* no left-right scrollbar when content is wider than the window */
    display: flex;
    flex-direction: column;
    padding: 12px 0 4px;
}
.soc-day {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 16px;
    font-size: 11px;
    color: var(--win-text-2, #cfcfcf);
}
.soc-day::before, .soc-day::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }
/* Read state (Phase A): the "NEW" separator between last-read and first-unread.
   Same anatomy as .soc-day, red per the Discord visual language. */
.soc-newline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    color: #ED4245;
    user-select: none;
    pointer-events: none;
}
.soc-newline::before, .soc-newline::after { content: ''; flex: 1 1 auto; height: 1px; background: #ED4245; opacity: .75; }
.soc-newline span { flex: none; padding: 0 2px; }
.soc-msg { display: flex; gap: 10px; padding: 6px 16px; position: relative; }
/* Phase C: "you were mentioned" row — persists until scrolled past */
.soc-msg-mentioned { background: rgba(250, 166, 26, 0.05); border-radius: 6px; }
.soc-msg.soc-msg-mentioned:hover { background: rgba(250, 166, 26, 0.09); }
.soc-msg-mentioned::before {
    content: '';
    position: absolute;
    left: 4px; top: 5px; bottom: 5px;
    width: 2px; border-radius: 2px;
    background: rgba(250, 166, 26, 0.65);
}
.soc-msg:hover { background: rgba(255,255,255,.03); }
.soc-msg.sys { justify-content: center; }
.soc-sys { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--win-text-2, #cfcfcf); }
.soc-sys-ic { display: inline-flex; align-items: center; justify-content: center; color: #f2c744; flex: none; }
.soc-sys-ic svg { display: block; }
.soc-msg-body { min-width: 0; }
.soc-msg-head { display: flex; align-items: baseline; gap: 8px; }
.soc-msg-name { font-size: 16px; font-weight: 600; }
.soc-msg-time { font-size: 11px; color: var(--win-text-2, #cfcfcf); opacity: .8; }
.soc-msg-text { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.soc-msg-img { margin: 4px 0 2px; }

/* Phase B: mention pills — server decides live vs inert (msg.mentionTokens /
   msg.mentionInert); the client only renders. Live = delivered (click a user
   pill for their profile); inert = typed but not delivered (dim, disabled). */
.soc-mention { padding: 0 3px; border-radius: 3px; font-weight: 500; line-height: 1.35; white-space: nowrap; }
.soc-mention-live { background: rgba(88, 101, 242, .30); color: #dee0fc; cursor: pointer; transition: background .12s ease; }
.soc-mention-live:hover { background: rgba(88, 101, 242, .50); }

.soc-reply-snip .soc-mention { font-size: .95em; }

/* Discord-style grouping: back-to-back messages from the same sender skip the
   avatar + name so a fast conversation reads as one block. */
.soc-msg-compact { padding-top: 1px; padding-bottom: 2px; }
.soc-msg-compact > .soc-av { visibility: hidden; height: 0; } /* keep the avatar's WIDTH so grouped text aligns under the first message, but collapse its height — otherwise the 36px avatar stretches every compact row (flex align-items:stretch) and the gap after line 2 is ~10px bigger than the gap after line 1 */
.soc-msg-compact .soc-msg-name { display: none; }
.soc-msg-compact .soc-msg-head { gap: 6px; }
.soc-msg-compact .soc-msg-time { display: none; } /* Discord-style: only the first message of a group (or one after a 10 min gap) carries the time */
.soc-msg-compact .soc-msg-img { margin-top: 2px; }
.soc-msg-img img {
    display: block;
    max-width: min(540px, 93vw, 100%); /* never wider than the chat column — shrinks instead of scrolling */
    max-height: 480px;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    cursor: zoom-in; /* click to open the full-size viewer */
}
/* v73: skeleton → fade-in. The row shows the placeholder until the image
   decodes, then the image fades in — no blank pop-in. A broken image stays
   visible (dimmed) instead of vanishing. */
.soc-msg-img img { opacity: 0; transition: opacity .18s ease; }
.soc-msg-img img.soc-img-loaded { opacity: 1; }
.soc-msg-img img.soc-img-broken { opacity: 1; filter: grayscale(1) brightness(.6); }
/* Mobile: chat images ~25% smaller than the desktop max */
@media (max-width: 768px) {
    .soc-msg-img img { max-width: min(405px, 70vw, 100%); max-height: 360px; }
}

.soc-empty { padding: 10px 14px; font-size: 12px; color: var(--win-text-2, #cfcfcf); }
.soc-empty-msg {
    margin: 10px 16px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    color: var(--win-text-2, #cfcfcf);
    font-size: 12.5px;
    text-align: center;
    grid-column: 1 / -1;
}
.soc-empty-pad { padding: 18px; font-size: 12.5px; color: var(--win-text-2, #cfcfcf); text-align: center; }
.soc-locked {
    margin: 10px 16px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(232,17,35,.12);
    border: 1px solid rgba(232,17,35,.35);
    color: #ffb3bc;
    font-size: 12.5px;
}

/* welcome (no channel selected) */
.soc-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    padding: 24px;
    color: var(--win-text-2, #cfcfcf);
}
.soc-welcome-ic { font-size: 42px; color: var(--accent, #4cc2ff); }
.soc-welcome-users { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.soc-welcome-u {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.05);
    font-size: 12px;
}

/* ===== Communication Center home (dashboard) ===== */
.soc-home { display: flex; flex-direction: column; gap: 14px; padding: 10px 16px 18px; max-width: 600px; width: 100%; margin: 0 auto; color: var(--win-text-2, #cfcfcf); }
.soc-home-head { display: flex; align-items: flex-start; gap: 14px; }
.soc-home-ic { font-size: 40px; color: var(--accent, #4cc2ff); line-height: 1; margin-top: 4px; }
.soc-home-titles { flex: 1; min-width: 0; }
.soc-home-titles h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: var(--win-text, #fff); letter-spacing: .2px; }
.soc-home-sub { margin: 6px 0 0; font-size: 12.5px; opacity: .85; }
.soc-home-head .soc-welcome-conn { align-self: flex-start; margin-top: 8px; }

.soc-home-sec { border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.025); border-radius: 12px; padding: 12px 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.soc-home-sec-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--win-text-2, #cfcfcf); margin-bottom: 10px; opacity: .92; }
.soc-home-sec-ic { font-size: 14px; opacity: .9; }

/* live now */
.soc-home-live { display: flex; flex-direction: column; gap: 8px; }
.soc-home-live-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); }
.soc-home-live-ic { font-size: 18px; width: 30px; text-align: center; flex: none; }
.soc-home-live-main { flex: 1; min-width: 0; }
.soc-home-live-name { font-size: 13.5px; font-weight: 600; color: var(--win-text, #fff); display: flex; align-items: center; gap: 5px; }
.soc-home-live-avs { display: flex; align-items: center; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.soc-home-av { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(10,12,16,.85); display: inline-flex; }
.soc-home-av .soc-av { width: 100%; height: 100%; border-radius: 50%; }
.soc-home-avmore { font-size: 11px; opacity: .7; margin-left: 2px; }
.soc-home-lock { font-size: 11px; opacity: .7; }
.soc-home-join { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #e8e8ec; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.soc-home-join:hover { background: rgba(76,194,255,.18); border-color: rgba(76,194,255,.4); }
.soc-home-join svg { display: block; }
.soc-home-join.here { background: transparent; border-style: dashed; cursor: default; opacity: .7; }
.soc-home-empty { font-size: 12.5px; opacity: .7; padding: 4px 2px; }

/* inbox */
.soc-home-inbox { display: flex; flex-direction: column; gap: 6px; }
.soc-home-inbox-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.035); }
.soc-home-inbox-av { flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.soc-home-inbox-av .soc-av { width: 100%; height: 100%; border-radius: 50%; }
.soc-home-inbox-ic { font-size: 15px; }
.soc-home-inbox-label { flex: 1; min-width: 0; font-size: 12.5px; color: var(--win-text, #f0f0f0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-home-jump { flex: none; font-size: 12px; font-weight: 600; color: #e8e8ec; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 5px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.soc-home-jump:hover { background: rgba(76,194,255,.18); border-color: rgba(76,194,255,.4); }
.soc-home-jump svg { display: block; }
.soc-home-inbox-row .soc-req-act { margin-left: 0; }

/* resume chips */
.soc-home-resume { display: flex; flex-wrap: wrap; gap: 8px; }
.soc-home-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--win-text, #f0f0f0); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 6px 12px 6px 9px; cursor: pointer; }
.soc-home-chip:hover { background: rgba(76,194,255,.14); border-color: rgba(76,194,255,.35); }
.soc-home-chip-ic { font-size: 14px; }
.soc-home-chip-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* quick call (single full-width button) */
.soc-home-qa { display: grid; grid-template-columns: 1fr; gap: 8px; }
.soc-home-qa-b { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--win-text, #f0f0f0); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 13px 12px; cursor: pointer; transition: transform .08s ease, background .12s ease, border-color .12s ease; }
.soc-home-qa-b:hover { background: rgba(76,194,255,.14); border-color: rgba(76,194,255,.35); transform: translateY(-1px); }
.soc-home-qa-b:active { transform: translateY(0); }

/* status */
.soc-home-status { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.soc-home-stat { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,.035); }
.soc-home-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; opacity: .6; }
.soc-home-stat b { font-size: 13px; color: var(--win-text, #f4f4f4); font-weight: 600; }

/* custom line icons (stroke-based SVG, tinted to the site accent) */
.hi { display: block; vertical-align: middle; flex: none; }
.soc-home-sec-ic .hi, .soc-home-qa-b .hi, .soc-home-live-ic .hi, .soc-set-ic .hi,
.soc-home-inbox-ic .hi, .soc-home-chip-ic .hi, .soc-home-lock .hi, .soc-home-join .hi { color: var(--accent, #4cc2ff); }

/* quick settings (live voice-control toggles) */
.soc-home-set { display: flex; flex-direction: column; gap: 2px; }
.soc-set-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.soc-set-row + .soc-set-row { border-top: 1px solid rgba(255,255,255,.05); }
.soc-set-ic { display: inline-flex; flex: none; }
.soc-set-lab { flex: 1; min-width: 0; font-size: 13px; color: var(--win-text, #f0f0f0); }
.soc-switch {
    flex: none;
    appearance: none;
    width: 40px; height: 22px;
    border-radius: 11px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.14);
    cursor: pointer;
    position: relative;
    padding: 0;
    transition: background .15s ease, border-color .15s ease;
}
.soc-switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #e8e8ec; display: block; transition: left .15s ease; }
.soc-switch.on { background: rgba(76,194,255,.55); border-color: rgba(76,194,255,.7); }
.soc-switch.on i { left: 20px; }
.soc-switch.danger.on { background: rgba(232,17,35,.6); border-color: rgba(232,17,35,.8); }
.soc-vol { flex: 1; min-width: 0; accent-color: var(--accent, #4cc2ff); }

/* home footer: mobile-only centered swipe hint (hidden entirely on PC) */
.soc-home-foot { display: none; }
.soc-foot-txt { font-size: 12.5px; color: var(--win-text-2, #cfcfcf); opacity: .85; text-align: center; }

@media (max-width: 768px) {
    .soc-home-foot { display: flex; align-items: center; justify-content: center; padding: 12px 12px; min-height: 36px; }
}

/* "In voice channel now" + "Quick call" sections: mobile only */
.soc-home-mobile-only { display: none; }
@media (max-width: 768px) {
    .soc-home-mobile-only { display: block; }
}

/* pick modals (Call / Join / Invite / New channel) */
.soc-pick-head { font-size: 15px; font-weight: 700; color: var(--win-text, #fff); margin-bottom: 10px; }
.soc-pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.soc-pick-row { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--win-text, #f0f0f0); background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 7px 10px; cursor: pointer; text-align: left; width: 100%; }
.soc-pick-row:hover { background: rgba(76,194,255,.14); border-color: rgba(76,194,255,.3); }
.soc-pick-row .soc-av { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.soc-pick-ic { width: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center; opacity: .95; }
.soc-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-pick-tag { font-size: 10px; opacity: .6; text-transform: uppercase; letter-spacing: .4px; flex: none; }
.soc-pick-cnt { font-size: 11px; opacity: .6; flex: none; }

@media (max-width: 768px) {
    .soc-home { max-width: 100%; padding: 10px 12px 16px; gap: 12px; }
    .soc-home-status { grid-template-columns: 1fr 1fr; }
}

/* welcome-screen connection status (retry / refresh) */
.soc-welcome-conn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.5);
}
.soc-wc-txt { font-size: 12.5px; color: #cfcfcf; }
.soc-wc-fail .soc-wc-txt { color: #ffb3bc; }
.soc-wc-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.07);
    color: #e8e8ec;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
}
.soc-wc-btn:hover { background: rgba(255,255,255,.14); }

/* typing + input */
.soc-typing { min-height: 18px; padding: 2px 20px 0; font-size: 11px; font-style: italic; color: var(--win-text-2, #cfcfcf); }
.soc-inputrow {
    flex: none;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    /* No wrapping: the input shrinks (flex-basis 60px + min-width 0) so the
       emoji + send buttons ALWAYS stay on the same line as the input, even
       in a small app window. */
    padding: 8px 14px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--win-border, rgba(255,255,255,.08));
}
/* The input box: the bordered/background box is the wrapper; the textarea
   inside it is borderless so pasted-image chips can sit inside the same box. */
.soc-inputwrap {
    position: relative;
    display: flex;
    align-items: flex-end;
    flex: 1 1 60px;
    min-width: 0;
    border-radius: 8px;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    background: rgba(255,255,255,.05);
}
.soc-inputwrap:focus-within { border-color: var(--accent, #4cc2ff); }
.soc-inputwrap textarea { flex: 1 1 auto; }
/* The composer box must sit at exactly the button height (38px) when empty —
   same as .soc-plus / .soc-send. Scoped with the ID so it beats the global
   #socialPage textarea rule (min-height 40px, padding 11px), which other
   multi-line textareas (fwd comment, report detail) still rely on. */
#socialPage .soc-inputwrap { min-height: 38px; box-sizing: border-box; } /* border-box: 38px includes the 1px borders, matching the buttons */
#socialPage .soc-inputwrap textarea {
    min-height: 36px; /* 38px wrapper minus 1px border each side */
    padding: 7px 13px; /* one 20px line + 14px padding = 34 ≤ 36 → box = exactly 38px */
    line-height: 20px;
}
.soc-inputwrap textarea:focus-visible { box-shadow: none; }
#socialPage textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    resize: none;
    min-height: 40px;
    max-height: 150px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--win-text, #fff);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    padding: 11px 13px;
}
#socialPage textarea:focus { outline: none; }

/* ---------------- right column: people ---------------- */
.soc-right {
    flex: none;
    width: 260px;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #191919;
    border-left: 1px solid var(--win-border, rgba(255,255,255,.08));
}
.soc-tabs { flex: none; display: flex; border-bottom: 1px solid var(--win-border, rgba(255,255,255,.08)); }
/* Header row wrapper: on desktop it's invisible (the mobile-only toggle inside
   is hidden), so the tabs still span the full panel width exactly as before. */
.soc-right-head { display: flex; align-items: center; flex: none; }
.soc-right-head .soc-tabs { flex: 1; min-width: 0; }
.soc-tab {
    flex: 1;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--win-text-2, #cfcfcf);
    font-size: 11px;
    padding: 8px 4px;
    cursor: pointer;
}
.soc-tab:hover { color: #fff; }
.soc-tab.active { color: #fff; border-bottom-color: var(--accent, #4cc2ff); }
.soc-rlist { flex: 1; overflow-y: auto; padding: 6px; }
.soc-person {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 7px;
}
.soc-person:hover { background: rgba(255,255,255,.05); }
.soc-person.off { opacity: .5; }
.soc-sec-label {
    padding: 12px 12px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .6px;
    color: var(--win-text-2, #cfcfcf);
    opacity: .85;
}
.soc-person .soc-dot { border-color: #1e1f22; }
.soc-p-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.soc-p-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-p-tag {
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: var(--win-text-2, #cfcfcf);
}
.soc-p-tag.friend { background: rgba(76,194,255,.16); color: var(--accent, #4cc2ff); }
/* item 11a: muted-user indicator (distinct from .soc-dm.muted = offline peer) */
.soc-p-tag.soc-muted-tag { background: rgba(240,180,41,.14); color: #f0b429; cursor: default; }
.soc-muted-dm { flex: none; font-size: 11px; line-height: 1; opacity: .85; margin-right: 1px; cursor: default; }
.soc-p-sub { font-size: 10.5px; color: var(--win-text-2, #cfcfcf); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v43: away (AFK) status gets a dimmer tint; mobile users get a tiny phone icon */
.soc-p-sub.away { color: var(--win-text-3, #8b93a5); opacity: .9; }
.soc-p-mob { display: inline-flex; align-items: center; vertical-align: -1px; margin: 0 1px; color: var(--accent, #4cc2ff); opacity: .75; }
.soc-p-actions { flex: none; display: flex; gap: 3px; }

/* ---------------- avatars ---------------- */
.soc-av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    background: #3a4a5f;
    border: 1.5px solid var(--av-border, rgba(255,255,255,.18));
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.soc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-av-sm { width: 24px; height: 24px; font-size: 11px; }
.soc-av-md { width: 36px; height: 36px; font-size: 15px; }
.soc-av-init { font-weight: 700; color: #fff; background: linear-gradient(135deg, #41608a, #5b4a7a); }

/* People list: avatar click → big square preview (fast scale+fade) */
.soc-avprev {
    position: fixed;
    z-index: 99990;
    width: 190px;
    height: 190px;
    visibility: hidden;
    opacity: 0;
    transform: scale(0.86) translateY(4px);
    transition: opacity 0.13s ease-out, transform 0.13s ease-out, visibility 0.13s;
    pointer-events: none;
}
.soc-avprev.open {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.soc-avprev-in {
    width: 100%;
    height: 100%;
    border-radius: 22px;
    overflow: hidden;
    background: #3a4a5f;
    border: 2px solid var(--av-border, rgba(255,255,255,.22));
    box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
}
.soc-avprev-in .soc-av { width: 100%; height: 100%; border-radius: 0; border: none; box-shadow: none; }
.soc-avprev-in .soc-av-init { font-size: 72px; }

/* status dots — consistent Discord-style positioning (bottom-right, thick bg border) */
.soc-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid #1e1f22;
    background: #22c55e;
    right: -1px;
    bottom: -1px;
}
.soc-dot.idle { background: #f59e0b; }
.soc-dot.dnd { background: #e81123; }
.soc-dot.off { background: #555; }
.soc-dot.offline { background: #555; } /* alias: profile popout passes 'offline'; .off is the row-list name */
.soc-dot.online { background: #22c55e; }

/* ---------------- buttons ---------------- */
/* Inline-flex row: an icon (.hi) and its label always sit on the SAME line,
   vertically centered (Discord-style). Text-only buttons look identical. */
.soc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    background: rgba(255,255,255,.06);
    color: var(--win-text, #fff);
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.2;
    min-height: 34px;
    box-sizing: border-box;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}
.soc-btn:hover { background: rgba(255,255,255,.12); }
.soc-btn:active { transform: translateY(1px); }
.soc-btn .hi { flex: none; }
.soc-btn-ok { background: var(--accent, #4cc2ff); border-color: var(--accent, #4cc2ff); color: #08202e; font-weight: 600; }
.soc-btn-ok:hover { background: var(--accent-strong, #2ba6f0); }
.soc-btn-danger { background: transparent; border-color: rgba(232,17,35,.6); color: #ff8f9d; }
.soc-btn-danger:hover { background: #e81123; border-color: #e81123; color: #fff; }

.soc-mini {
    flex: none;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    color: var(--win-text, #fff);
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.soc-mini:hover { background: var(--accent, #4cc2ff); color: #08202e; }
.soc-mini.active { background: rgba(76,194,255,.22); color: var(--accent, #4cc2ff); }
.soc-mini.danger:hover { background: #e81123; color: #fff; }
.soc-mini-btn { width: auto; height: auto; padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ---------------- forms / modal ---------------- */
.soc-f-label {
    display: block;
    margin: 8px 0 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--win-text-2, #cfcfcf);
}
.soc-f-hint { margin-top: 6px; font-size: 11px; color: var(--win-text-2, #cfcfcf); }
.soc-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 7px;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    background: rgba(255,255,255,.05);
    color: var(--win-text, #fff);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
}
.soc-input:focus { outline: none; border-color: var(--accent, #4cc2ff); }
.soc-input option { background: #2b2b2b; color: #fff; }
.soc-radio { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.soc-keyrow { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.soc-keybtn { min-width: 64px; }
.soc-set-sec { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--win-border, rgba(255,255,255,.08)); }
.soc-meter { height: 8px; margin-top: 6px; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.08); }
.soc-meter > div { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent, #4cc2ff), #7ed8ff); }
.soc-res-sel {
    border-radius: 6px;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    background: #262626;
    color: var(--win-text, #fff);
    font-size: 12px;
    padding: 4px 6px;
    cursor: pointer;
}
.soc-res-sel option { background: #2b2b2b; }
.soc-invite-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; margin: 10px 0; }
.soc-invite-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; }
.soc-invite-item:hover { background: rgba(255,255,255,.04); }
.soc-invite-item .soc-mini-btn { margin-left: auto; }

.soc-modalback {
    position: absolute;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.55);
    /* N+16: no backdrop blur — the page behind stays crisp (and cheap on phones) */
}
/* v59: a modal opened from inside the Settings Shell is re-parented to <body>
   and tagged .soc-over-shell (see modal()/closeModal()). It must sit ABOVE the
   shell (fixed, z-index 99990) but BELOW the desktop titlebar (z-index 99999),
   or the user has to close server settings before using the modal. */
.soc-modalback.soc-over-shell { position: fixed; z-index: 99995; }
.soc-modal {
    width: min(420px, calc(100% - 32px));
    max-height: calc(100% - 40px);
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    background: var(--win-bg-2, #2b2b2b);
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
    padding: 14px;
    /* v61: the modal is a FIXED dark surface — it must declare its own text
       color instead of inheriting it. When opened over the Settings Shell it
       is re-parented to <body>, where the inherited color can be a dark
       value → "black text on dark gray" (Roles panel, server settings, …).
       Explicit light text keeps every modal readable in every context. */
    color: #e8ecf1;
}
.soc-modal h3 { margin: 0 0 8px; font-size: 14.5px; }
.soc-modalback { animation: socFadeIn .14s ease; }
.soc-modal { animation: socModalIn .16s ease; }
@keyframes socFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes socModalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.soc-modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ---------------- call dialog + panel ---------------- */
.soc-caldlg {
    position: absolute;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
}
.soc-caldlg[hidden] { display: none !important; }
.soc-caldlg-card {
    text-align: center;
    padding: 26px 34px;
    border-radius: 12px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    background: rgba(32,32,32,.92);
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.soc-caldlg-ic { font-size: 38px; animation: socPulse 1.4s ease-in-out infinite; }
.soc-caldlg-name { margin-top: 8px; font-size: 16px; font-weight: 700; }
.soc-caldlg-sub { margin-top: 2px; font-size: 12px; color: var(--win-text-2, #cfcfcf); }
.soc-caldlg-btns { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
@keyframes socPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.soc-callpanel { position: absolute; right: 14px; bottom: 14px; z-index: 40; }
.soc-callpanel[hidden] { display: none !important; }
.soc-call-card {
    width: 250px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    background: rgba(32,32,32,.94);
    backdrop-filter: blur(8px);
    box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.soc-call-head { display: flex; align-items: center; gap: 10px; }
.soc-call-ic { flex: none; font-size: 26px; }
.soc-call-name { font-size: 13px; font-weight: 700; }
.soc-call-stat { font-size: 11px; color: var(--win-text-2, #cfcfcf); }
.soc-call-btns { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.soc-call-stage { display: none; margin-top: 10px; }
.soc-call-stage:empty { display: none; }
.soc-call-stage:not(:empty) { display: block; }
.soc-call-stage .soc-call-stage-video, .soc-call-stage video {
    width: 100%; max-height: 220px; object-fit: contain;
    border-radius: 8px; background: #000; display: block; border: 1px solid rgba(255,255,255,.12);
}

/* ---------------- toasts ---------------- */
/* PC: top-right, but offset LEFT of the members panel (.soc-right = 260px) + a
   12px gap, so toasts never cover the members / Active Now list. */
.soc-toasts {
    position: absolute;
    top: 12px;
    right: 272px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}
.soc-toast {
    pointer-events: auto;
    width: 270px;
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    background: rgba(28,28,30,.94);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
    animation: socToastIn .18s ease;
}
@keyframes socToastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.soc-toast.out { animation: socToastOut .18s ease forwards; pointer-events: none; }
@keyframes socToastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px); } }
.soc-toast-t { font-size: 12px; font-weight: 700; color: var(--accent, #4cc2ff); }
.soc-toast.err .soc-toast-t { color: #ff8f9d; }
.soc-toast-m { margin-top: 2px; font-size: 12px; color: var(--win-text-2, #cfcfcf); }
.soc-toast-acts { display: flex; gap: 6px; margin-top: 8px; }
/* v76: "your mic isn't reaching the server" banner (SFU ground truth) */
.soc-micwarn {
    position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-8px);
    z-index: 100000; display: flex; align-items: center; gap: 10px; max-width: min(620px, calc(100vw - 24px));
    background: #1d1f24; border: 1px solid rgba(242,63,67,.55); border-radius: 12px;
    padding: 10px 10px 10px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(242,63,67,.12);
    opacity: 0; transition: opacity .18s ease, transform .18s ease;
}
.soc-micwarn.open { opacity: 1; transform: translateX(-50%) translateY(0); }
.soc-micwarn-ico { color: #f23f43; font-size: 16px; line-height: 1; flex: 0 0 auto; }
.soc-micwarn-txt { font-size: 12.5px; line-height: 1.45; color: #d7dbe0; }
.soc-micwarn-txt b { color: #fff; }
.soc-micwarn-x {
    flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 7px; cursor: pointer;
    background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); font-size: 15px; line-height: 1; padding: 0;
}
.soc-micwarn-x:hover { background: rgba(242,63,67,.25); color: #fff; }
@media (max-width: 640px) {
    .soc-micwarn { left: 12px; right: 12px; transform: translateY(-8px); max-width: none; }
    .soc-micwarn.open { transform: translateY(0); }
}

/* Desktop-app update progress card (reuses the .mp-toast base from desktop.css;
   added classes only for the progress bar + meta line). */
.mp-upd-prog .mp-upd-track {
    margin-top: 8px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,.12);
    overflow: hidden;
}
.mp-upd-prog .mp-upd-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent, #4cc2ff), #7ee0ff);
    transition: width .25s ease;
}
.mp-upd-prog .mp-upd-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- mobile: drawers + header buttons ---------------- */
.soc-mob-only { display: none; }
.soc-drawer-back { display: none; }

@media (max-width: 768px) {
    /* Very short screens (keyboard + voice channel both up): let the mobile
       voice bar compress so the composer never gets pushed off-screen. */
    .soc-mobvoice { flex: 0 1 auto; min-height: 0; padding: 4px 8px; }
    /* Transparent on purpose: the chat/cards behind the open drawer stay
       fully visible (no dim, no blur). It still catches taps so tapping
       outside closes the drawer. */
    .soc-drawer-back {
        position: absolute;
        inset: 0;
        z-index: 64;
        background: transparent;
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }
    #socialPage.soc-left-open .soc-drawer-back,
    #socialPage.soc-right-open .soc-drawer-back,
    #socialPage.soc-rail-open .soc-drawer-back { opacity: 1; pointer-events: auto; }
    .soc-left {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 65;
        width: min(60vw, 240px);
        border-right: none;
        box-shadow: 0 0 40px rgba(0,0,0,.5);
        transform: translateX(-103%);
        transition: transform .12s ease; /* close (fast) */
    }
    /* In-drawer close button = the same toggle as the header button (lit,
       because the drawer is open). Left drawer: absolute top-right; people
       drawer: inline at the top-left of the category row. */
    .soc-drawer-x {
        position: absolute;
        top: 6px;
        right: 6px;
        z-index: 2;
        width: auto;
        min-width: 40px;
        height: 30px;
        padding: 0 7px;
        gap: 3px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(76,194,255,.4);
        border-radius: 8px;
        background: rgba(76,194,255,.14);
        color: #bfe6ff;
        font-size: 12px;
        line-height: 1;
        cursor: pointer;
    }
    .soc-drawer-x:active { background: rgba(76,194,255,.3); }
    #socRightClose { position: static; }
    /* The channels close button sits INSIDE the highlighted Friends row, not
       floating over the panel edge: that row's top-right corner is at
       top:8px / right:16px (navrow padding 6px 10px + navitem margin 2px 6px). */
    #socLeftClose { top: 8px; right: 16px; }
    #socialPage.soc-left-open .soc-left { transform: none; transition: transform .18s ease; } /* open */
    .soc-right {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        z-index: 65;
        /* Widened (was 54vw/215px): the DM profile panel's 2-column app grid
           (Files/Images/Music/Video) clipped at the right edge on a 390pt
           screen. 66vw/272px fits every item with margin to spare. */
        width: min(66vw, 272px);
        border-left: none;
        box-shadow: 0 0 40px rgba(0,0,0,.5);
        transform: translateX(103%);
        transition: transform .12s ease; /* close (fast) */
    }
    #socialPage.soc-right-open .soc-right { transform: none; transition: transform .18s ease; } /* open */
    /* People drawer header row: [toggle]  …  [Online (n)][Friends (n)] — the
       two tabs hug the right edge, side by side, never stacked or wrapped.
       The user rows compress slightly to fit the narrow drawer. */
    .soc-right-head { gap: 4px; }
    .soc-right-head .soc-tabs { flex-wrap: nowrap; justify-content: flex-end; padding: 0 4px 0 0; }
    .soc-right .soc-tab {
        white-space: nowrap;
        min-width: 0;
        flex: none;
        padding: 8px 6px;
        font-size: 10.5px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .soc-right .soc-rlist { padding: 4px; }
    .soc-right .soc-person { gap: 6px; padding: 5px 5px; }
    .soc-mob-only { display: inline-flex; align-items: center; justify-content: center; }
    .soc-stage-card { width: 100%; }
    .soc-stage-video { max-height: 42vh; }
    /* During a call the center call-stage (card grid) carries ALL controls on
       the phone — the floating panel just covered half the screen. Hide it. */
    .soc-callpanel { display: none !important; }
    /* Call stage header actions: keep them on the phone in compact rows */
    .soc-head-actions { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
    .soc-head-actions .soc-btn { padding: 4px 8px; font-size: 11px; }
    /* DM header Call button: icon-only on phones (the text label was the
       widest action and pushed the row to wrap) — hover/tap area stays big
       enough, and the label still shows on desktop. */
    .soc-call-act .soc-call-lbl { display: none; }
    .soc-call-act { padding: 4px 9px; }
    /* Voice-channel header invite button: ~50% smaller on phones. */
    #socActInvite { padding: 3px 7px; font-size: 9px; gap: 4px; }
    .soc-toasts { left: 12px; right: 12px; align-items: stretch; }
    .soc-toast { width: auto; }
    .soc-vstage { gap: 10px; padding: 12px; }
    .soc-userpanel { padding: 8px 10px; gap: 7px; }
    .soc-big { height: 36px; font-size: 15px; }
    /* Voice stage on phones: let the grid size to its tiles and scroll inside
       .soc-messages instead of overflowing over the voice bar / each other */
    .soc-vstage { flex: none; grid-auto-rows: auto; min-height: 0; }
    .soc-sharecard { max-height: 44vh; }
    .soc-vc-card { min-height: 96px; padding: 12px 10px; }
    /* Drawers overlay the middle on phones: the card grid / chat keep their
       full width and are simply covered by the open drawer (no re-centering). */
}

/* ================= 1:1 CALL SPLIT LAYOUT (call stage on top, DM chat below) ================= */
.soc-messages.soc-in-call {
    overflow: hidden;
    padding: 0;
}
.soc-call-split {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.soc-call-stage {
    flex: 0 1 auto;      /* take ONLY the space the cards need — divider moves up */
    max-height: 34%;     /* ...but never eat the chat; cards shrink together to fit */
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Top (cards) slightly darker than the chat below (.soc-main #1f1f1f),
       with a designed divider: crisp 2px line + soft drop shadow so the
       two halves read as distinct, deliberate panels. */
    background: linear-gradient(180deg, #171717 0%, #1a1a1a 100%);
    border-bottom: 2px solid rgba(255,255,255,.14);
    box-shadow: 0 6px 14px rgba(0,0,0,.35);
    position: relative;
    z-index: 1;
}
.soc-call-chat {
    background: #1f1f1f;
}
.soc-call-stage .soc-vstage {
    max-width: 860px;
    margin: 0 auto;
    min-height: 0;
    flex: none;
    align-content: stretch; /* equal-row grid: every card the same size */
}
/* Let user cards shrink inside the equal-sized call grid cells */
.soc-call-stage .soc-vc-card { min-height: 0; padding: 6px 10px; gap: 4px; }
/* v50: call cards keep the new rectangular avatar shape, scaled to the compact card */
.soc-call-stage .soc-av-xl { width: 60px; height: 45px; font-size: 17px; }
.soc-call-stage .soc-vc-av .soc-av-xl { border-radius: 10px; }
.soc-call-stage .soc-vc-name { font-size: 11px; }
/* v58: when a 16:9 screen/camera tile is in the 1:1 stage, user cards become
   compact horizontal chips and the media tile keeps its natural aspect ratio
   (the old fixed 52px equal rows squashed the media into an unreadable strip
   — the "cards don't fit well" complaint). */
.soc-call-stage.soc-has-media { max-height: 52%; }
.soc-call-stage.soc-has-media .soc-vstage { align-content: start; }
.soc-call-stage.soc-has-media .soc-vc-card {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}
.soc-call-stage.soc-has-media .soc-av-xl { width: 38px; height: 29px; font-size: 12px; }
.soc-call-stage.soc-has-media .soc-vc-av .soc-av-xl { border-radius: 7px; }
.soc-call-stage.soc-has-media .soc-vc-name { font-size: 12px; max-width: 120px; }
.soc-call-chat {
    flex: 1 1 50%;
    min-height: 0;
    overflow-y: auto;
}
/* On smaller windows, give the video a little less room so the chat stays usable */
@media (max-width: 720px), (max-height: 640px) {
    .soc-call-stage { flex: 0 1 46%; }
    .soc-call-chat { flex: 1 1 54%; }
}

/* ================= VOICE STAGE (Discord-style) ================= */
/* v50: rectangular avatar (4:3) — matches the shape users crop to */
.soc-av-xl { width: 120px; height: 90px; font-size: 32px; }
.soc-vstage {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* JS overrides with a dynamic count */
    gap: 12px;
    padding: 16px;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    align-content: start;
    justify-items: stretch;
    min-height: 120px;
    flex: 1;
}
.soc-vc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 14px;
    border-radius: 16px;
    background:
        radial-gradient(120% 78% at 50% 30%, var(--card-av-tint, rgba(76,194,255,.16)) 0%, transparent 60%),
        linear-gradient(160deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.015) 42%, rgba(0,0,0,.07) 100%),
        #232428;
    border: 1px solid rgba(255,255,255,.10);
    transition: box-shadow .15s ease, border-color .15s ease;
    min-width: 0;
    min-height: 140px;
}
/* Thin accent line across the top in the user's identity color — subtle,
   centered, faded at the edges (reads as "their color" without flooding a
   small surface). */
.soc-vc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 16px; right: 16px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--card-av-line, rgba(76,194,255,.45)) 28%, var(--card-av-line, rgba(76,194,255,.45)) 72%, transparent);
    pointer-events: none;
}
.soc-vc-card::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(112deg, transparent 30%, rgba(255,255,255,.07) 45%, transparent 58%);
    pointer-events: none;
}
/* Calm hover: soft colored halo + a 1px lift (lift disabled under reduced motion). */
.soc-vc-card:hover {
    box-shadow: 0 10px 26px rgba(0,0,0,.38), 0 0 24px -8px var(--card-av-glow, rgba(76,194,255,.45));
    border-color: rgba(255,255,255,.16);
}
/* Keep a visible, on-brand focus ring on the card's controls. */
.soc-vc-vol:focus-visible, .soc-vc-menu:focus-visible {
    outline: 2px solid #4cc2ff;
    outline-offset: 2px;
}
.soc-vc-vol, .soc-vc-menu { z-index: 1; }
/* Per-user volume button (top-LEFT of a peer's voice card) — the ⋯ menu
   sits top-right. Popover anchors to the card, so the side doesn't matter. */
.soc-vc-vol {
    position: absolute;
    top: 7px; left: 7px;
    width: 26px; height: 26px;
    flex: none;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: var(--win-text-2, #cfcfcf);
    font-size: 13px; line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
    padding: 0;
}
.soc-vc-vol:hover { background: rgba(255,255,255,.14); color: #fff; }
/* Muted state (one-tap mute FOR YOU): crossed speaker + red, matching the
   red used for mute/deafen badges elsewhere. */
.soc-vc-vol.muted {
    color: #f23f43;
    border-color: rgba(242,63,67,.45);
    background: rgba(242,63,67,.12);
    --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16.5 9.5l5 5M21.5 9.5l-5 5'/></svg>");
}
.soc-vc-vol.muted:hover { background: rgba(242,63,67,.22); color: #ff6b6e; }
/* Volume popover */
.soc-volpop {
    position: fixed;
    z-index: 2147483000;
    width: 160px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(20,20,24,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
    display: flex; flex-direction: column; gap: 8px;
    color: var(--win-text, #fff);
}
.soc-volpop-head { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-volpop-range { width: 100%; accent-color: #4cc2ff; cursor: pointer; }
.soc-volpop-val { font-size: 11px; color: var(--win-text-2, #cfcfcf); text-align: right; }
/* Talking = green ring around the avatar + green name (Discord style) */
.soc-vc-av { position: relative; display: flex; align-items: center; justify-content: center; }
/* v52: rounded-rect avatar tile with palette glow ring */
.soc-vc-av .soc-av-xl {
    border-radius: 16px;
    transition: box-shadow .2s ease;
    border: 2px solid var(--card-av-glow, rgba(76,194,255,.35));
    box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 0 12px var(--card-av-glow-sub, rgba(76,194,255,.18));
}
/* Small phones / narrow windows: if a card gets narrower than the fixed
   120px avatar, the avatar scales down to fit instead of forcing the grid
   track wider than the viewport (that clipped the right-hand card). */
.soc-vstage .soc-vc-av .soc-av-xl { max-width: 100%; height: auto; aspect-ratio: 4 / 3; min-width: 0; }
.soc-vc-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--win-text, #fff);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
/* Talking = green ring around the avatar + green name (Discord style) */
.soc-vc-card.talking .soc-vc-av .soc-av-xl { border-color: #23a55a; box-shadow: 0 0 0 3px #23a55a, 0 0 22px rgba(35,165,90,.6); }
.soc-vc-card.talking .soc-vc-name { color: #23a55a; }
/* Muted badge (red ring around mic icon, bottom-right of avatar) */
.soc-vc-mute {
    position: absolute; right: -4px; bottom: -4px;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(0,0,0,.65); border: 2.5px solid #f23f43;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1;
    z-index: 2;
}
.soc-vc-deaf { border-color: #f23f43; }
/* Mute / deafen chips in the left-drawer voice member list */
.soc-vuser-mute {
    flex: none;
    font-size: 11px; line-height: 1;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #f23f43;
    background: rgba(0,0,0,.5);
    display: inline-flex; align-items: center; justify-content: center;
}
.soc-vuser-deaf { border-color: #f23f43; }
/* v72: stream chips in the left-drawer voice list (🖥 screen share /
   📷 camera) — same 18px circular shape as the mute chip, SVG-masked icon. */
.soc-vuser-stream {
    flex: none;
    font-size: 0;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--accent, #4cc2ff);
    background: rgba(0,0,0,.5);
    display: inline-flex; align-items: center; justify-content: center;
}
.soc-vuser-stream::before {
    content: ''; width: 11px; height: 11px; background-color: var(--accent, #4cc2ff);
    -webkit-mask: var(--bic) center / 11px 11px no-repeat; mask: var(--bic) center / 11px 11px no-repeat;
}
.soc-vuser-stream-share {
    --bic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='2.5' y='4' width='19' height='12.5' rx='2'/><path d='M8.5 20h7'/><path d='M12 16.5V20'/></svg>");
}
.soc-vuser-stream-cam { border-color: #23a55a; }
.soc-vuser-stream-cam::before {
    background-color: #23a55a;
    --bic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='2.5' y='6' width='13' height='12' rx='2.5'/><path d='M15.5 10.5l6-3.5v10l-6-3.5'/></svg>");
}
.soc-vuser.talking .soc-vuser-name { color: #fff; }
.soc-vuser.talking .soc-av-sm { box-shadow: 0 0 0 2px #23a55a; border-radius: 50%; }

/* v73: VLAN presence — voice-list chip (same 18px circular shape as the
   mute / stream chips), green to read as "networked", click to copy the IP. */
.soc-vuser-vlan {
    flex: none;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #23a55a;
    background: rgba(0,0,0,.5);
    display: inline-flex; align-items: center; justify-content: center;
    color: #4cd47f;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease;
}
.soc-vuser-vlan .hi { width: 11px; height: 11px; }
.soc-vuser-vlan:hover { box-shadow: 0 0 0 1.5px rgba(35,165,90,.5); transform: scale(1.08); }

/* v73: VLAN rail badge — bottom-left corner of the server icon. Distinct
   green so it reads separately from voice (accent) / share (accent). */
.soc-rail-vlanbadge {
    position: absolute; left: -3px; bottom: -3px; z-index: 3;
    width: 22px; height: 22px; padding: 0;
    border-radius: 50%;
    background: #1a1b1e;
    border: 2px solid #23a55a;
    display: flex; align-items: center; justify-content: center;
    color: #4cd47f;
    cursor: pointer;
    transition: box-shadow .18s ease, border-color .18s ease;
}
.soc-rail-vlanbadge .hi { width: 13px; height: 13px; }
.soc-rail-vlanbadge:hover { border-color: #4cd47f; }
/* .me: I have this server's VLAN on — brighter + a soft breathing glow. */
.soc-rail-vlanbadge.me {
    border-color: #4cd47f;
    color: #62e09a;
    animation: socVlanGlow 2.6s ease-in-out infinite;
}
@keyframes socVlanGlow {
    0%, 100% { box-shadow: 0 0 6px rgba(35,165,90,.45); }
    50%      { box-shadow: 0 0 12px rgba(35,165,90,.85); }
}

/* v73: VLAN detail popover (click a rail badge) — full peer list with IPs. */
.soc-vlanpopover {
    position: fixed; z-index: 9999;
    width: 300px; max-width: calc(100vw - 24px);
    max-height: 60vh;
    background: #2b2d31;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.55);
    display: flex; flex-direction: column;
    overflow: hidden;
    font-size: 13px;
    color: #e8ecf3;
    font-family: inherit;
}
.soc-vlanpop-head {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 12px;
    background: rgba(35,165,90,.12);
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex: none;
}
.soc-vlanpop-ic { color: #4cd47f; display: inline-flex; }
.soc-vlanpop-ic .hi { width: 16px; height: 16px; }
.soc-vlanpop-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.soc-vlanpop-count { flex: none; font-size: 11.5px; color: #4cd47f; font-weight: 600; background: rgba(35,165,90,.18); padding: 2px 9px; border-radius: 10px; }
/* v74: location label under the popover head (owner-set; never the VPS name) */
.soc-vlanpop-loc {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 12px;
    background: rgba(35,165,90,.07);
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: 12px;
    color: #b8e6c8;
    flex: none;
}
.soc-vlanpop-loc .hi { width: 13px; height: 13px; color: #4cd47f; flex: none; }
.soc-vlanpop-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.soc-vlanrow {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255,255,255,.03);
}
.soc-vlanrow:hover { background: rgba(255,255,255,.07); }
.soc-vlanrow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.soc-vlanrow-you { font-style: normal; color: #4cd47f; font-size: 11px; font-weight: 600; margin-left: 3px; }
.soc-vlanrow-ip { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; color: #9fd4ff; cursor: pointer; white-space: nowrap; }
.soc-vlanrow-ip:hover { text-decoration: underline; }
.soc-vlanrow-since { font-size: 11px; opacity: .55; white-space: nowrap; }
.soc-vlanpop-empty { padding: 16px 10px; font-size: 13px; opacity: .7; text-align: center; line-height: 1.5; }

/* DM close button */
.soc-dm-x {
    flex: none;
    width: 18px; height: 18px;
    border: none; background: transparent;
    color: var(--win-text-2, #cfcfcf);
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .15s;
    display: flex; align-items: center; justify-content: center;
}
.soc-dm:hover .soc-dm-x { opacity: .7; }
.soc-dm-x:hover { opacity: 1 !important; background: rgba(255,255,255,.12); color: #fff; }

/* Share / camera tiles in voice stage (Discord-style 16:9 with name badge) */
.soc-sharecard {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255,255,255,.12);
    min-width: 0;
}
.soc-sharecard video, .soc-sharecard .sc-video video {
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}
.soc-share-badge {
    position: absolute; left: 10px; bottom: 10px; z-index: 2;
    max-width: calc(100% - 20px);
    padding: 3px 9px; border-radius: 7px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff; font-size: 11px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.soc-sharecard:hover .soc-share-badge { opacity: 1; }
/* Share-menu uplink requirement hint */
.soc-sm-need {
    padding: 2px 2px 8px;
    font-size: 10px;
    color: rgba(255,255,255,.45);
    line-height: 1.35;
}
/* Quality badge (top-right corner of share cards) */
.soc-share-qual {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    padding: 2px 7px; border-radius: 5px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    color: #fff; font-size: 10px; font-weight: 700;
    pointer-events: none;
    letter-spacing: .3px;
}

/* Hold-to-talk button (footer + mobile bar) — big, touch-friendly target */
.soc-ptt-hold {
    touch-action: none; user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; padding: 0 10px; border-radius: 8px;
}
.soc-ptt-hold.held, .smv-ptt.held { background: rgba(35,165,90,.5) !important; }

/* Mobile voice bar — stays visible even when the left drawer is closed */
.soc-mobvoice {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 6px 10px; flex: none;
    background: rgba(0,0,0,.35);
    border-top: 1px solid rgba(255,255,255,.08);
}
.soc-mobvoice[hidden] { display: none; }
.smv-id { display: flex; align-items: center; gap: 7px; min-width: 0; cursor: pointer; }
.smv-name { font-size: 12px; font-weight: 600; color: var(--win-text, #fff); white-space: nowrap; }
.smv-status { font-size: 10.5px; color: var(--win-text-2, #cfcfcf); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smv-status.muted { color: #f23f43; }
.smv-btns { display: flex; gap: 6px; flex: none; }
.smv-b {
    width: 34px; height: 34px; flex: none; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.07);
    color: #fff; font-size: 14px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
}
.smv-b:active { background: rgba(255,255,255,.2); }
.smv-b.active { background: rgba(242,63,67,.35); border-color: rgba(242,63,67,.7); }
.smv-ptt {
    width: 52px; height: 52px; font-size: 20px;
    background: rgba(35,165,90,.22); border-color: rgba(35,165,90,.6);
    touch-action: none; user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.smv-ptt.held { background: rgba(35,165,90,.65); border-color: rgba(35,165,90,1); box-shadow: 0 0 12px rgba(35,165,90,.5); }
@media (max-width: 380px) { .smv-ptt { width: 48px; height: 48px; font-size: 18px; } }
.smv-leave { background: rgba(242,63,67,.25); border-color: rgba(242,63,67,.6); }
@media (min-width: 769px) { .soc-mobvoice { display: none !important; } }

/* Small icon button (voice settings in the compact footer row) */
.soc-small-btn {
    width: 26px; height: 26px;
    flex: none;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: var(--win-text-2, #cfcfcf);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
    padding: 0;
}
.soc-small-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* Desktop Mode modal */
.soc-desktop-steps { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.soc-desktop-step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--win-text-2, #cfcfcf); line-height: 1.55; }
.soc-desktop-step code { background: rgba(255,255,255,.08); border-radius: 4px; padding: 1px 5px; font-size: 12px; color: #e6e6e6; }
.soc-desktop-hint { font-size: 12px; opacity: .75; }
.soc-desktop-hint a { color: var(--accent, #4cc2ff); text-decoration: none; }

/* Desktop Mode button in window title bar */
.win-ctrl.win-ctrl-extra { width: 38px; opacity: .85; }
.win-ctrl.win-ctrl-extra:hover { background: rgba(76,194,255,.16); opacity: 1; }

/* ---------------- Polish round (N+13) ---------------- */

/* Muted = red slashed mic (clear, everywhere it appears) */
.mic-muted {
    position: relative;
    display: inline-block;
    filter: grayscale(1) brightness(2.2);
    color: #f23f43;
}
.mic-muted::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 145%; height: 2px;
    background: #f23f43;
    transform: translate(-50%,-50%) rotate(-40deg);
    border-radius: 2px;
    pointer-events: none;
}
.soc-big.active .mic-muted { filter: grayscale(1) brightness(1.6); }

/* Sticky Done — the action row stays visible no matter the screen height.
   Scoped to the settings modal (.soc-set-modal) so the compact create /
   delete-confirm modals keep their normal 14px padding + plain button row. */
.soc-modal.soc-set-modal { display: flex; flex-direction: column; padding: 0; }
.soc-modal.soc-set-modal h3 { padding: 14px 14px 4px; flex: none; }
.soc-modal.soc-set-modal > .soc-set-sec { padding: 0 14px; }
.soc-modal.soc-set-modal > .soc-set-sec:first-of-type { padding-top: 8px; }
.soc-modal.soc-set-modal .soc-modal-btns {
    position: sticky; bottom: 0; margin-top: 10px;
    padding: 10px 14px;
    background: linear-gradient(to top, var(--win-bg-2, #2b2b2b) 72%, rgba(43,43,43,0));
    border-top: 1px solid rgba(255,255,255,.07);
    border-radius: 0 0 12px 12px;
    z-index: 2;
}
/* More compact settings on phones */
@media (max-width: 768px) {
    .soc-modal { width: calc(100% - 20px); max-height: calc(100% - 20px); }
    .soc-set-sec { margin-bottom: 4px !important; }
    .soc-set-sec .soc-f-label { margin-bottom: 3px; }
    .soc-modal h3 { padding-top: 12px; }
}

/* Focused (clicked) share/camera tile — grows to fill the row */
.soc-sharecard.focused {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    border-color: var(--accent, #4cc2ff);
    box-shadow: 0 0 0 1px var(--accent, #4cc2ff), 0 10px 30px rgba(0,0,0,.45);
}
@media (max-width: 768px) {
    .soc-sharecard.focused {
        max-width: 85vw;
        max-height: 58vh;
    }
    .soc-sharecard.focused video { max-height: calc(58vh - 40px); object-fit: contain; }
}

/* Tile controls: pause / stop / maximize (visible on hover, always on touch) */
.soc-sc-ctrls {
    position: absolute; right: 8px; bottom: 8px; z-index: 3;
    display: flex; gap: 6px;
    opacity: 0; transition: opacity .15s;
    pointer-events: auto;
}
.soc-sharecard:hover .soc-sc-ctrls,
.soc-sharecard.focused .soc-sc-ctrls { opacity: 1; }
@media (hover: none) { .soc-sc-ctrls { opacity: 1; } }
.soc-sc-btn {
    min-width: 34px; min-height: 34px; padding: 0 9px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff; font-size: 14px; line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.soc-sc-btn:active { background: rgba(255,255,255,.25); }
.soc-sc-btn.sc-danger { color: #ff7b7d; border-color: rgba(242,63,67,.55); }
.soc-sc-btn.sc-unfocus { display: none; }
.soc-sharecard.focused .soc-sc-btn.sc-unfocus { display: inline-flex; }

/* Shared-audio controls on peer share tiles: the 🔊 mute toggle is always
   on the small card; the volume slider only appears at medium (focused)
   size or fullscreen — it's too wide for the small tile. */
.soc-sv {
    display: none; align-items: center;
    min-height: 34px; padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(0,0,0,.62);
}
.soc-sharecard.focused .soc-sv,
.soc-sharecard:fullscreen .soc-sv { display: inline-flex; }
.soc-sv-range {
    width: 64px; height: 14px;
    accent-color: var(--accent, #4cc2ff);
    cursor: pointer;
    margin: 0;
}
.soc-sharecard:fullscreen .soc-sv-range { width: 120px; }
/* Shared-audio mute toggle state (red = muted, same language as the mic mute) */
.soc-sc-btn.svmute.muted { color: #ff7b7d; border-color: rgba(242,63,67,.55); }

/* Fullscreen TILE — the card holder itself is fullscreened (not just the
   <video>), so the control bar + volume slider stay visible on top of it. */
.soc-sharecard:fullscreen {
    width: 100%; height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    background: #000;
    display: flex; align-items: center; justify-content: center;
}
.soc-sharecard:fullscreen video {
    width: 100%; height: 100%;
    /* v58: reset the small-stage caps (e.g. .soc-call-stage video { max-height:
       220px }) that otherwise survive into fullscreen and leave a small
       centered video with black around it on 1:1 calls. */
    max-width: none; max-height: none;
    object-fit: contain;
    border: none; border-radius: 0;
}
/* Pop-out is open: the in-page tile is fully hidden (display:none), so the
   app's self-heal play() calls can't revive it and the tile stops decoding.
   The stream keeps flowing to the pop-out window + the audio element. */
.soc-sharecard.soc-popout-hidden { display: none !important; }

/* Minimize-to-mini-player: the grid no longer emits a holder for a minimized
   card, but hide any straggler holder the same way pop-out does (self-heal
   play() calls become no-ops and nothing decodes in the grid). */
.soc-sharecard.soc-min-hidden { display: none !important; }

/* Floating mini-player dock (bottom-right). One small tile per minimized
   share/camera card, stacked. Kept deliberately simple: video + name +
   Restore / Close. */
.soc-minidock {
    position: fixed; right: 16px; bottom: 16px; z-index: 9000;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: auto;
    max-height: calc(100vh - 32px); overflow-y: auto;
}
.soc-minitile {
    width: min(264px, calc(100vw - 32px));
    background: #1e1f22;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 38px rgba(0,0,0,.55);
}
.soc-minitile video {
    width: 100%; aspect-ratio: 16 / 9; object-fit: contain;
    background: #000; display: block;
}
.soc-mini-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 5px 8px;
    background: rgba(0,0,0,.35);
}
.soc-mini-name {
    font-size: 12px; font-weight: 600; color: #e6e8eb;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.soc-mini-btns { display: flex; gap: 4px; flex: none; }
.soc-mini-btns .soc-sc-btn { min-width: 28px; min-height: 28px; font-size: 13px; }
.soc-sharecard:fullscreen .soc-sc-ctrls { opacity: 1; right: 16px; bottom: 16px; transition: opacity .12s; }
/* Auto-hide: controls fade out after 6 s of no mouse movement (slow, nice
   fade) and snap back fast the moment the mouse moves again. */
.soc-sharecard:fullscreen.fs-idle .soc-sc-ctrls { opacity: 0; pointer-events: none; transition: opacity .5s; }
.soc-sharecard:fullscreen.fs-idle { cursor: none; }

/* Stopped-sharing state: dim + blur last frame, overlay label */
.soc-sharecard.soc-card-stopped { border-color: rgba(255,255,255,.08); }
.soc-sharecard.soc-card-stopped video { opacity: .3; filter: blur(4px); pointer-events: none; }
.soc-sharecard.soc-card-stopped .soc-sc-ctrls { opacity: 0 !important; pointer-events: none; }
.soc-stopped-overlay {
    position: absolute; inset: 0; z-index: 4;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.5);
    border-radius: inherit;
    color: rgba(255,255,255,.85); font-size: 14px; font-weight: 600;
    pointer-events: none;
}

/* "Stop watching" paused-share chip (dashed placeholder in the tile grid) */
.soc-sharecard.soc-watchpause {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    background: rgba(255,255,255,.05);
    border-style: dashed;
}
.soc-wp-text { font-size: 12.5px; color: rgba(255,255,255,.6); padding: 0 10px; text-align: center; }
.soc-watchpause .soc-sc-btn { font-size: 13px; font-weight: 600; color: var(--accent, #4cc2ff); }

/* Maximize overlay (fullscreen fallback) */
.soc-focusback {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.94);
    display: flex; align-items: center; justify-content: center;
}
.soc-focusbox { width: min(1080px, 96vw); max-height: 96vh; display: flex; flex-direction: column; }
.soc-focusbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 6px 8px; color: #fff; font-weight: 600;
}
.soc-focusbox video {
    width: 100%; max-height: calc(96vh - 40px);
    background: #000; border-radius: 10px; object-fit: contain;
}

/* Voice-card ⋯ menu button */
.soc-vc-menu {
    position: absolute; top: 7px; right: 7px; z-index: 3;
    min-width: 30px; min-height: 30px; padding: 0 7px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.5);
    color: var(--win-text-2, #cfcfcf); font-size: 15px; line-height: 1;
    cursor: pointer; opacity: .55;
    display: inline-flex; align-items: center; justify-content: center;
}
.soc-vc-card:hover .soc-vc-menu { opacity: 1; }
.soc-vc-menu:hover { background: rgba(255,255,255,.16); color: #fff; }
@media (hover: none) { .soc-vc-menu { opacity: .8; } }

/* Right sidebar ⋯ menu (anchored popover) */
.soc-pmenu {
    animation: socCtxIn .12s ease; transform-origin: left top;
    position: fixed; z-index: 950;
    min-width: 172px; max-width: 220px;
    border-radius: 10px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.16));
    background: var(--win-bg-2, #2b2b2b);
    box-shadow: 0 14px 40px rgba(0,0,0,.55);
    padding: 5px;
    display: flex; flex-direction: column; gap: 2px;
}
.soc-pmenu-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; min-height: 34px;
    border: none; border-radius: 7px;
    background: transparent; color: var(--win-text, #fff);
    font-size: 12.5px; font-weight: 600; text-align: left;
    cursor: pointer;
}
.soc-pmenu-item { transition: background .12s ease, color .12s ease; }
.soc-pmenu-item span { font-size: 13px; width: 18px; text-align: center; }
.soc-pmenu-item:hover { background: rgba(255,255,255,.09); }
.soc-pmenu-item.call { color: #43bf94; }
.soc-pmenu-item.call span { filter: hue-rotate(90deg); }
.soc-pmenu-item.danger { color: #f23f43; }
.soc-pmenu-item.danger:hover { background: rgba(242,63,67,.14); }

/* Bigger, effect-free mobile PTT hold target */
.smv-ptt {
    width: 60px; height: 60px; font-size: 24px;
}
@media (max-width: 380px) { .smv-ptt { width: 54px; height: 54px; font-size: 22px; } }
.smv-b, .smv-ptt, .soc-ptt-hold {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
.smv-ptt:active { transform: scale(.97); }

/* ---------------- Round N+13 ---------------- */

/* Mobile top-bar: obvious expand hints + red leave-voice button */
#socialPage .soc-mob-leave {
    display: none;
    color: #f23f43;
    background: rgba(242,63,67,.16);
    border: 1px solid rgba(242,63,67,.45);
    font-weight: 700;
    margin-left: 2px;
}
#socialPage.soc-invoice .soc-mob-leave { display: inline-flex; }
/* Mobile Join state: viewing a voice channel we are NOT in → green rejoin button */
#socialPage.soc-mobviewvoice .soc-mob-leave { display: inline-flex; }
#socialPage .soc-mob-leave.soc-mob-join {
    color: #7ee787;
    background: rgba(46,160,67,.16);
    border-color: rgba(46,160,67,.5);
}
/* Header drawer toggles: neutral when their drawer is CLOSED, lit when OPEN
   (matching the in-drawer close button, which is only visible while open). */
.soc-drawer-hint {
    width: auto;
    min-width: 40px;
    padding: 0 8px;
    gap: 3px;
    font-size: 13px;
}
#socialPage.soc-left-open #socMobLeft,
#socialPage.soc-right-open #socMobRight {
    background: rgba(76,194,255,.14);
    border: 1px solid rgba(76,194,255,.4);
    color: #bfe6ff;
}
#socialPage.soc-left-open #socMobLeft:active,
#socialPage.soc-right-open #socMobRight:active {
    background: rgba(76,194,255,.3);
}

/* DM header: call button is green (Discord-style go) */
.soc-btn-green { background: #23a55a; border-color: #23a55a; color: #fff; font-weight: 600; }
.soc-btn-green:hover { background: #1e8f4e; }

/* N+16: DM header call/hang-up — greenish phone (go); while on a call with
   that user the same slot turns into a red-outlined HANG UP action */
.soc-call-act { background: rgba(35,165,90,.16); border-color: rgba(35,165,90,.55); color: #7ee2a8; font-weight: 600; }
.soc-call-act:hover { background: rgba(35,165,90,.3); color: #a5f0c5; }
.soc-call-act.hangup { background: rgba(232,17,35,.12); border-color: #e81123; color: #ff8f9d; }
.soc-call-act.hangup:hover { background: #e81123; border-color: #e81123; color: #fff; }

/* N+16: compact create-channel dialog — segmented type buttons */
.soc-ch-type { display: flex; gap: 6px; margin-bottom: 10px; }
.soc-ch-type-b {
    flex: 1; padding: 7px 10px; font-size: 12.5px; cursor: pointer;
    background: rgba(255,255,255,.05); border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 8px; color: inherit;
    transition: background .12s, border-color .12s;
}
.soc-ch-type-b:hover { background: rgba(255,255,255,.1); }
.soc-ch-type-b.on { background: var(--accent, #4cc2ff); border-color: var(--accent, #4cc2ff); color: #08202e; font-weight: 600; }

/* N+16: themed delete-channel confirm */
.soc-del-ic { font-size: 34px; text-align: center; margin: 2px 0 8px; }
.soc-del-txt { font-size: 13px; line-height: 1.5; margin: 0 0 6px; text-align: center; }

/* Sub-category labels inside the Online tab (REQUESTS / BLOCKED) reuse
   .soc-sec-label, but make sure they stand out in the right sidebar */
#socRList .soc-sec-label { margin-top: 6px; }

/* ---------------- Round N+14 ---------------- */

/* Mobile leave ✕ (top bar): mobile only — hidden on PC */
@media (min-width: 769px) {
    #socialPage .soc-mob-leave { display: none !important; }
}

/* Ping number as visible text on mobile (touch = no hover); PC keeps bars + tooltip */
.soc-pingms-mob { display: none; font-size: 11px; font-weight: 600; margin-left: 5px; }
@media (max-width: 768px) {
    .soc-pingms-mob { display: inline; font-size: 10px; margin-left: 2px; }
    /* Measured from a phone screenshot: the hangup button's right edge
       overshoots the camera button's edge by a few px, and the ping readout
       sits a bit far from the status text. Positive right-margin pulls the
       whole right cluster left (it is right-anchored), which tucks the ping
       closer to the status line AND lands the red button on the edge of the
       button row below. */
    .soc-up-right { gap: 4px; }
    .soc-up-ping { padding: 3px 1px; }
    .soc-up-disconnect { width: 30px; height: 26px; margin-right: 1px; }
}

/* Joining state: pulsing amber "Connecting…" + dimmed voice controls */
.soc-up-conn.connecting { color: #f0b232; }
.soc-up-conn.connecting::before { content: '●'; margin-right: 5px; animation: socJoinPulse 1s ease-in-out infinite; }
.soc-up-conn.call { color: var(--accent, #4cc2ff); }
@keyframes socJoinPulse { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.soc-up-joining .soc-up-btns { opacity: .45; pointer-events: none; }

/* Noise-suppression quick toggle (user-panel foot row, left of Open/PTT, S hotkey) */
.soc-up-denoise { padding: 2px 6px; font-size: 10px; }
.soc-up-denoise.active { background: rgba(67,191,148,.16); border-color: rgba(67,191,148,.55); color: #43bf94; }

/* ---------------- Round N+18 ---------------- */

/* Camera switch button (next to 📷 in user panel / mobile bar / call stage) */
.soc-camsel {
    min-width: 30px; height: 30px; padding: 0 7px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    color: #cfd6e4; font-size: 14px; line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.soc-camsel:hover { background: rgba(255,255,255,.14); }
.soc-camsel:active { background: rgba(255,255,255,.22); }
.soc-up-btns .soc-camsel { align-self: center; }
/* call-stage variant — sit inside the .soc-btn row without breaking its size */
.soc-btn.soc-camsel { min-width: 34px; padding: 0 8px; }
/* mobile bar variant — same size as its neighbors, slightly dimmer glyph */
.smv-camsel { font-size: 14px; opacity: .85; }
/* PC voice panel: the camera-switch button (only rendered while sharing)
   adds a 5th column to the 4-up button row. */
.soc-up-btns.has-camsel { grid-template-columns: repeat(5, 1fr); }
.soc-camsel { font-size: 14px; opacity: .85; }

/* Camera picker popover */
.soc-campop {
    position: fixed; z-index: 10000;
    min-width: 190px; max-width: 270px;
    background: #2b2b2b;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.55);
    padding: 6px;
}
.soc-campop-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    color: rgba(255,255,255,.55); padding: 4px 8px 6px;
}
.soc-campop-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px; border-radius: 7px; cursor: pointer;
    font-size: 13px; color: #e8ecf3;
    min-width: 0;
}
.soc-campop-item:hover { background: rgba(255,255,255,.08); }
.soc-campop-item.active { background: rgba(76,194,255,.14); }
.soc-campop-name {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.soc-campop-dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: rgba(255,255,255,.25);
}
.soc-campop-item.active .soc-campop-dot { background: var(--accent, #4cc2ff); }
.soc-campop-act { margin-left: auto; flex: none; color: var(--accent, #4cc2ff); }
.soc-campop-empty { padding: 8px; color: rgba(255,255,255,.6); font-size: 13px; }

/* v57: HQ/LQ quality toggle in the camera popup (stays open after click) */
.soc-camq { display: flex; gap: 6px; padding: 2px 8px 6px; }
.soc-camq-btn {
    flex: 1; padding: 6px 0; border-radius: 7px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.05); color: #e8ecf3;
    font-size: 12px; font-weight: 600; letter-spacing: .04em;
    cursor: pointer;
}
.soc-camq-btn:hover { background: rgba(255,255,255,.1); }
.soc-camq-btn.on {
    background: rgba(76,194,255,.16);
    border-color: rgba(76,194,255,.5);
    color: var(--accent, #4cc2ff);
}

/* v59: status corners on share/cam cards — 👁 viewer count top-LEFT, quality
   chip top-RIGHT. DOM order is quality-first, so row-reverse puts the viewer
   badge on the left. Spans the card so the two sit in opposite corners
   instead of clustered side by side. flex-start keeps BOTH badges at exactly
   8px from the top (same as the quality chip's original top:8px) and the
   left:8px / right:8px container gives the viewer badge the same 8px margin
   from the left edge the quality chip has from the right. Same layout shows
   in fullscreen and fades with the controls when idle. */
.soc-card-hud {
    position: absolute; top: 8px; left: 8px; right: 8px; z-index: 5;
    display: flex; flex-direction: row-reverse; align-items: flex-start;
    justify-content: space-between; gap: 6px;
    pointer-events: none;
}
.soc-card-hud > * { pointer-events: auto; }
.soc-card-hud .soc-share-qual { position: static; }
/* v58: viewer-count badge on EVERY share/cam card (mine + peers); hover =
   viewer names. Tooltip opens DOWNWARD inside the 16:9 card (the card is
   overflow:hidden, so a top tooltip would be clipped). */
.soc-vbadge {
    position: absolute; top: 8px; right: 8px; z-index: 5;
    display: inline-flex; gap: 4px; align-items: center;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.14);
    padding: 3px 8px; border-radius: 999px;
    font-size: 11px; color: #e8ecf3;
    cursor: help;
}
.soc-card-hud .soc-vbadge { position: relative; }
.soc-vbadge .soc-vb-n { font-weight: 700; color: var(--accent, #4cc2ff); }
.soc-vbadge .soc-vb-tip {
    position: absolute; top: calc(100% + 8px); left: 0;
    background: #141518;
    border: 1px solid rgba(255,255,255,.14);
    padding: 6px 10px; border-radius: 8px;
    font-size: 12px; color: #e8ecf3;
    width: max-content; max-width: 240px; white-space: normal;
    line-height: 1.4;
    opacity: 0; pointer-events: none; transition: opacity .12s;
}
.soc-vbadge:hover .soc-vb-tip { opacity: 1; }
/* v58: in fullscreen the HUD stays top-right and fades with the controls
   when idle (same 6 s idle timer as .soc-sc-ctrls). */
.soc-sharecard:fullscreen .soc-card-hud { transition: opacity .25s; }
.soc-sharecard:fullscreen.fs-idle .soc-card-hud,
.soc-sharecard:fullscreen.fs-idle .soc-card-hud > * { opacity: 0; pointer-events: none; }

/* ---------------- Round N+22 ---------------- */

/* Connection indicator on voice cards: gray out + yellow "!" badge */
.soc-vc-connecting { opacity: .48; }
.soc-vc-conn {
    position: absolute; top: -4px; right: -4px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #f0b232; color: #1a1a1a;
    font-size: 13px; font-weight: 800; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #1f1f1f;
    z-index: 3;
    cursor: help;
    pointer-events: auto;
}

/* Fullscreen video tile: hide all native controls, black bg */
video.soc-sharecard:fullscreen, .soc-sharecard video:fullscreen,
.soc-focuscard video:fullscreen, video:fullscreen {
    object-fit: contain;
    background: #000;
}
video:fullscreen::-webkit-media-controls,
video:fullscreen::-webkit-media-controls-enclosure,
video:fullscreen::-webkit-media-controls-panel,
video:fullscreen::-webkit-media-controls-start-overlay {
    display: none !important;
}

/* User card options menu (narrow popover — replaces old volume popover) */
/* v55: User card menu — polished */
.soc-ucard-menu {
    position: fixed; z-index: 960;
    width: 200px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, #24262b, #1e2025);
    box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.3);
    padding: 8px;
    display: flex; flex-direction: column; gap: 2px;
    color: #eef1f4;
    font-family: inherit;
}

/* Share setup popover: surface (Window/Screen) + quality (480/720/1080) */
.soc-sharemenu {
    position: fixed; z-index: 960;
    width: 216px;
    border-radius: 12px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.16));
    background: var(--win-bg-2, #2b2b2b);
    box-shadow: 0 14px 44px rgba(0,0,0,.6);
    padding: 10px;
    display: flex; flex-direction: column; gap: 10px;
    color: var(--win-text, #fff);
}
.soc-sm-head { font-size: 13px; font-weight: 700; }
.soc-sm-sec { display: flex; flex-direction: column; gap: 6px; }
.soc-sm-sec label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.5); }
.soc-sm-row { display: flex; gap: 6px; }
.soc-sm-btn {
    flex: 1;
    padding: 7px 4px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05);
    color: var(--win-text, #fff);
    font-size: 12.5px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.soc-sm-btn:hover { background: rgba(255,255,255,.1); }
.soc-sm-btn.on { border-color: var(--accent, #4cc2ff); background: rgba(76,194,255,.14); }
.soc-sm-hint { font-size: 11px; color: rgba(255,255,255,.45); line-height: 1.35; }
.soc-sm-start {
    width: 100%;
    margin: 12px 0 6px;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid rgba(76,194,255,.5);
    background: rgba(76,194,255,.18);
    color: #bfe6ff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s;
}
.soc-sm-start:hover { background: rgba(76,194,255,.3); }
.soc-ucm-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    margin-bottom: 6px;
}
.soc-ucm-head img {
    width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none;
}
.soc-ucm-head .soc-ucm-name {
    font-size: 13px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.soc-ucm-sec {
    padding: 8px 12px 4px;
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
    color: rgba(230,234,238,.5);
}
.soc-ucm-vol {
    padding: 4px 10px 6px;
    display: flex; flex-direction: column; gap: 3px;
}
.soc-ucm-range {
    width: 100%; accent-color: #4cc2ff; cursor: pointer; height: 4px;
}
.soc-ucm-volval {
    font-size: 10px; color: rgba(255,255,255,.5); text-align: right;
}
.soc-ucm-net {
    padding: 4px 12px 10px;
    display: flex; flex-direction: column; gap: 5px;
}
.soc-ucm-net div {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 12px; color: rgba(230,234,238,.65); line-height: 1.4;
}
/* v77.1: b cells are inline-flex so the SVG mic icon (ucmNetMic) aligns
   cleanly with the text rows; svg is a block inside so baseline doesn't
   add phantom spacing. currentColor from the b's color tints the stroke. */
.soc-ucm-net b { color: #fff; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: flex-end; }
.soc-ucm-net b svg { display: block; }

/* ---- Hover tooltip for the bottom-left status bar's network info.
   Persistent node (lives in <body>), shown on hover; survives re-renders,
   so it never flickers the way the old native title tooltip did. ---- */
.soc-hnet {
    position: fixed; z-index: 15000;
    min-width: 190px; max-width: 280px;
    padding: 8px 11px;
    background: rgba(20,20,24,.97);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    font-size: 12px; line-height: 1.4;
    opacity: 0; transform: translateY(4px);
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
}
.soc-hnet.show { opacity: 1; transform: translateY(0); }
.soc-hnet-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 0; }
.soc-hnet-row span { color: #b9b9c0; }
.soc-hnet-row b { color: #fff; font-weight: 600; }

/* ---- Network stats panel (click the bottom-left status bar to toggle) ----
   Anchored above the voice control; no page darkening. */
/* v55: Network stats panel — polished typography & spacing */
.soc-nsm {
    position: fixed; z-index: 15000;
    background: linear-gradient(180deg, #1e2025, #191b1f);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.3);
    padding: 14px 16px 14px;
    opacity: 0;
    transform: translateY(16px) scale(.98);
    transform-origin: bottom left;
    transition: transform .18s cubic-bezier(.2,.85,.3,1.15), opacity .15s ease;
}
.soc-nsm.open { opacity: 1; transform: translateY(0) scale(1); }
.soc-nsm.closing { opacity: 0; transform: translateY(10px); transition: transform .13s ease-in, opacity .12s ease-in; }
.soc-nsm-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; color: #f0f3f6; margin: 0 0 12px; letter-spacing: .2px; }
.soc-nsm-x {
    border: none; background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
    width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 11px; line-height: 1;
}
.soc-nsm-x:hover { background: rgba(255,255,255,.16); color: #fff; }
.soc-nsm-body { display: flex; flex-direction: column; gap: 6px; }
.soc-nsm-live {
    display: flex; flex-direction: column; gap: 4px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px; padding: 9px 12px;
}
.soc-nsm-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; color: rgba(230,234,238,.7); line-height: 1.5; }
.soc-nsm-row b { color: #fff; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.soc-nsm-sec {
    font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(230,234,238,.5); margin-top: 14px; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.soc-nsm-graphwrap {
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    border-radius: 9px; padding: 6px;
}
.soc-nsm-graphwrap canvas { width: 100%; height: auto; display: block; }
.soc-nsm-legend { display: flex; gap: 16px; font-size: 11.5px; color: rgba(230,234,238,.55); padding: 8px 4px 0; }
.soc-nsm-legend .up { color: #43bf94; font-weight: 600; }
.soc-nsm-legend .dn { color: #4cc2ff; font-weight: 600; }
.soc-nsm-peers { display: flex; flex-direction: column; gap: 3px; max-height: 160px; overflow-y: auto; }
.soc-nsm-peer {
    display: grid; grid-template-columns: 1fr auto auto auto auto auto;
    gap: 14px; align-items: baseline;
    font-size: 12px; color: rgba(255,255,255,.6);
    padding: 5px 10px; border-radius: 7px;
    background: rgba(255,255,255,.04);
}
.soc-nsm-peer .n { color: #fff; font-weight: 600; }
.soc-nsm-peer .p { color: rgba(255,255,255,.6); white-space: nowrap; }
.soc-nsm-peer .r { color: #4cc2ff; font-weight: 600; white-space: nowrap; }
.soc-nsm-peer .t { color: rgba(255,255,255,.5); white-space: nowrap; }
.soc-nsm-peer .l { color: rgba(255,255,255,.4); white-space: nowrap; min-width: 42px; text-align: right; }
.soc-nsm-peer .m { font-size: 11px; white-space: nowrap; color: rgba(255,255,255,.35); text-align: right; }
.soc-nsm-peer .m.good { color: #43bf94; }
.soc-nsm-peer .m.bad { color: #f23f43; font-weight: 600; }
.soc-nsm-none { font-size: 12px; color: rgba(255,255,255,.45); padding: 8px 2px; }
.soc-nsm-hint { font-size: 11.5px; color: rgba(230,234,238,.4); margin: 10px 0 0; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); }
.soc-ucm-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; min-height: 36px;
    border: none; border-radius: 8px;
    background: transparent; color: #eef1f4;
    font-size: 13px; font-weight: 500; text-align: left;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.soc-ucm-item span { font-size: 13px; width: 18px; text-align: center; }
.soc-ucm-item:hover { background: rgba(255,255,255,.09); }
.soc-ucm-check {
    width: 16px; height: 16px; flex: none;
    border-radius: 4px;
    border: 2px solid rgba(255,255,255,.35);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; line-height: 1; color: transparent;
}
.soc-ucm-item.checked .soc-ucm-check {
    background: var(--accent, #4cc2ff); border-color: var(--accent, #4cc2ff);
    color: #08202e;
}
.soc-ucm-item.danger { color: #f23f43; }
.soc-ucm-item.danger:hover { background: rgba(242,63,67,.14); }

/* ---------------- staged image chip (pasted, ready to send) ----------------
   Sits INSIDE the input box, left of the text — a tiny icon, never larger
   than the box itself. v48: max-width guard so on narrow screens the chip
   shrinks INSIDE the box instead of overflowing onto the ＋ attach button. */
.soc-attach { position: relative; display: inline-flex; flex: none; margin: 5px 6px 5px 6px; min-width: 0; max-width: calc(100% - 4px); }
.soc-attach img {
    display: block; width: 30px; height: 30px; max-width: 100%; max-height: 30px; object-fit: cover;
    border-radius: 6px; border: 1px solid var(--accent, #4cc2ff);
    background: rgba(0,0,0,.35);
}
.soc-attach-x {
    position: absolute; top: -6px; right: -6px;
    width: 15px; height: 15px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.3);
    background: #e81123; color: #fff; font-size: 8px; line-height: 1;
    cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.soc-attach-x:hover { background: #ff4d5e; }
/* v73: upload-in-progress / failed states for the paste chip — the user can
   see the image is uploading instead of wondering if Enter did anything. */
.soc-attach-loading img { animation: socAttachPulse 1.1s ease-in-out infinite; }
.soc-attach-err img { opacity: .55; filter: saturate(.35); }
.soc-attach-err { border-radius: 7px; box-shadow: 0 0 0 1.5px rgba(255, 77, 94, .8); }
@keyframes socAttachPulse { 0%, 100% { opacity: .4; } 50% { opacity: .85; } }

/* ---------------- composer ＋ button & file popovers ---------------- */
.soc-plus {
    flex: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    background: rgba(255,255,255,.05);
    color: var(--win-text, #fff);
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.soc-plus:hover { background: var(--accent, #4cc2ff); color: #08202e; }
/* ---------------- composer send button (primary action, right side) --------
   The main tap target on mobile; mirrors the site's accent style on desktop. */
.soc-send {
    flex: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-strong, #2ba6f0);
    background: var(--accent, #4cc2ff);
    color: #08202e;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}
.soc-send:hover { background: var(--accent-strong, #2ba6f0); box-shadow: 0 2px 12px rgba(76,194,255,.35); }
.soc-send:active { transform: scale(.96); }
.soc-send:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 2px; }
/* Composer emoji button — ghost style (secondary to Send). Desktop only:
   mobile keyboards already have their own emoji key. */
.soc-emoji-btn {
    flex: none;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: none;
    color: var(--win-text-2, #cfcfcf);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.soc-emoji-btn:hover { background: rgba(76,194,255,.14); color: var(--accent, #4cc2ff); border-color: rgba(76,194,255,.3); }
.soc-emoji-btn:active { transform: scale(.94); }
.soc-emoji-btn:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 2px; }
@media (max-width: 768px) { .soc-emoji-btn { display: none; } }

/* ---------------- composer mic button (voice messages) ----------------
   Ghost style like the emoji button, but this is a PRIMARY action on mobile
   (emoji is hidden there), so it gets the full 38px tap target on phones. */
.soc-mic {
    flex: none;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: none;
    color: var(--win-text-2, #cfcfcf);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    touch-action: none; /* hold-to-talk: no scroll/zoom gestures steal the press */
    -webkit-touch-callout: none; /* suppress the iOS long-press callout while holding */
    -webkit-tap-highlight-color: transparent; /* no Android tap flash on the hold */
    -webkit-user-select: none;
    user-select: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.soc-mic:hover { background: rgba(76,194,255,.14); color: var(--accent, #4cc2ff); border-color: rgba(76,194,255,.3); }
.soc-mic:active { transform: scale(.94); }
.soc-mic:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 2px; }
.soc-mic.recording {
    color: #ff5f6d;
    border-color: rgba(255,95,109,.5);
    background: rgba(255,95,109,.14);
    animation: socMicPulse 1.2s ease-in-out infinite;
}
@keyframes socMicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,95,109,.35); }
    50%      { box-shadow: 0 0 0 6px rgba(255,95,109,0); }
}
@media (max-width: 768px) {
    .soc-mic { width: 38px; height: 38px; }
}

/* ---------------- recording overlay (hold-to-talk) ----------------
   Floats above the chat, bottom center. Red pulsing dot + live timer +
   level bars + ✕ cancel (a SECOND finger on touch, Esc on keyboard). */
.soc-vrec {
    position: fixed;
    left: 50%;
    bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,95,109,.35);
    background: rgba(18, 18, 24, .96);
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: inherit;
}
.soc-vrec-dot {
    flex: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ff5f6d;
    animation: socVrecDot 1.1s ease-in-out infinite;
}
@keyframes socVrecDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,95,109,.45); }
    50%      { opacity: .55; box-shadow: 0 0 0 8px rgba(255,95,109,0); }
}
.soc-vrec-main { flex: 1 1 auto; min-width: 0; }
.soc-vrec-title { font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.soc-vrec-sub { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 2px; white-space: nowrap; }
.soc-vrec-level {
    flex: none;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}
.soc-vrec-level span {
    width: 3px;
    height: 5px;
    border-radius: 2px;
    background: #ff5f6d;
    transition: height .08s linear;
}
.soc-vrec-time {
    flex: none;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
}
.soc-vrec-cancel {
    flex: none;
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
    padding: 0;
    touch-action: manipulation;
}
.soc-vrec-cancel:active { transform: scale(.92); background: rgba(255,95,109,.25); }
.soc-vrec.sending .soc-vrec-dot { animation: none; background: var(--accent, #4cc2ff); opacity: .8; }
/* 60s cap state: amber dot (recording stopped, decision pending). The mic
   button itself keeps pulsing red (.soc-mic.recording / socMicPulse) as the
   "tap me to send" indicator for 6 seconds. */
.soc-vrec.cap .soc-vrec-dot { animation: none; background: #ffb020; opacity: .95; }

/* ---------------- voice-message player (in the message list) ----------------
   Compact: mic tile + play/pause + seek bar + time. One at a time per tab
   (wired in _wireVm). .vm-error dims the card when the file is gone. */
.soc-vm {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin: 6px 0 2px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.045);
}
.soc-vm:hover { background: rgba(255,255,255,.07); }
.soc-vm-art {
    flex: none;
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(76,194,255,.16);
    color: var(--accent, #4cc2ff);
}
.soc-vm-play {
    flex: none;
    width: 30px; height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--accent, #4cc2ff);
    color: #08202e;
    cursor: pointer;
    padding: 0;
    transition: transform .1s ease, background .15s ease;
}
.soc-vm-play:hover { background: var(--accent-strong, #2ba6f0); }
.soc-vm-play:active { transform: scale(.92); }
.soc-vm-bar {
    flex: 1 1 auto;
    height: 6px;
    min-width: 90px;
    max-width: 320px;
    border-radius: 3px;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    overflow: hidden;
}
.soc-vm-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: var(--accent, #4cc2ff);
    transition: width .12s linear;
}
.soc-vm-time {
    flex: none;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: rgba(255,255,255,.65);
    min-width: 84px; /* stable room for "0:00 / 0:48" so the card never reflows */
    text-align: right;
    white-space: nowrap;
}
.soc-vm-audio-el, .soc-vm .soc-vm-el { display: none; }
.soc-vm.playing .soc-vm-art { background: rgba(76,194,255,.3); }
.soc-vm.vm-error { opacity: .55; }
.soc-vm.vm-error .soc-vm-bar, .soc-vm.vm-error .soc-vm-play { pointer-events: none; }

/* ================= v45: REACT / REPLY / FORWARD ================= */

/* Hover toolbar (desktop) — anchored to the top-right corner of the row.
   Shown on row hover / focus-within; replaced by the mobile ⋯ button. */
.soc-mtb {
    position: absolute; top: -14px; right: 8px; z-index: 20;
    display: flex; align-items: center; gap: 2px;
    background: #26282d;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    border-radius: 9px;
    padding: 2px;
    box-shadow: 0 6px 18px rgba(0,0,0,.45);
    opacity: 0; pointer-events: none; transform: translateY(2px);
    transition: opacity .12s ease, transform .12s ease;
}
.soc-msg:hover .soc-mtb, .soc-msg:focus-within .soc-mtb { opacity: 1; pointer-events: auto; transform: translateY(0); }
.soc-mtb-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 28px; padding: 0;
    background: none; border: none; border-radius: 7px;
    color: var(--win-text-3, #8b93a5); cursor: pointer;
    transition: background .12s ease, color .12s ease, transform .1s ease;
}
.soc-mtb-btn:hover { background: rgba(76,194,255,.16); color: var(--accent, #4cc2ff); }
.soc-mtb-btn:active { transform: scale(.92); }
.soc-mtb-btn:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 1px; }
.soc-mtb svg { display: block; }
.soc-msg:focus-visible { outline: 2px solid rgba(76,194,255,.5); outline-offset: -2px; border-radius: 8px; }

/* v49 — Discord-style per-row action cluster. Rendered inline inside each
   message row, pinned to the TOP-RIGHT of the row, revealed on row hover
   (pure CSS). A subtle dark pill keeps the icons legible over message text.
   Desktop only — mobile keeps the ⋯ bottom sheet instead. */
/* v49.1 — compact: smaller + narrower buttons.
   v49.3 — floats JUST ABOVE the hovered row's highlight (like Discord):
   no layout push, no text shift, no box expansion. It overlaps the message
   above while hovered, which is exactly how Discord behaves. */
.soc-msg-acts {
    /* overlaps the row's top edge by 2px → no hover gap between text and bar */
    position: absolute; right: 10px; bottom: calc(100% - 2px); z-index: 2;
    display: flex; align-items: center; gap: 0;
    padding: 2px; border-radius: 6px;
    background: rgba(20,23,29,.72); backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.07);
    opacity: 0; pointer-events: none; transition: opacity .1s ease;
}
/* hover-bridge: the bar also stays up while the pointer is on the bar itself
   (it floats above the row, so row :hover alone would drop it mid-move) */
.soc-msg:hover .soc-msg-acts, .soc-msg-acts:hover { opacity: 1; pointer-events: auto; }
.soc-msg-acts .soc-mtb-btn { width: 22px; height: 18px; border-radius: 5px; font-size: 12px; line-height: 1; min-width: 0; padding: 0; }
.soc-msg-acts .soc-mtb-btn svg { width: 13px; height: 13px; }
.soc-msg-acts .soc-mtb-btn[data-mact="last"] { padding: 0 4px; }
/* v49.2 — quick-react tray (Discord): inline row that expands next to the
   smiley when it's hovered. Clicking a tray emoji reacts instantly. */
.soc-qrw { display: inline-flex; align-items: center; }
.soc-qr { display: none; align-items: center; }
.soc-qrw:hover .soc-qr { display: inline-flex; }
.soc-qr .soc-mtb-btn { width: 21px; font-size: 12px; }
.soc-msg-acts .soc-act-del:hover { background: rgba(232,17,35,.18); color: #ff7b85; }
@media (max-width: 768px) { .soc-msg-acts { display: none; } }

/* v46 edited-at marker (Discord-style: tiny, gray, in the head row) */
.soc-edited { font-size: 11px; color: var(--win-text-3, #8b93a5); font-style: italic; white-space: nowrap; }

/* v46 media embeds — link → thumbnail card → inline player. Matches the
   site palette (accent #4cc2ff, dark surfaces, 8-10px radii). */
.soc-embwrap { margin: 6px 0 2px; display: flex; flex-direction: column; gap: 8px; }
.soc-emb { position: relative; display: block; width: 420px; max-width: 100%; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--win-border, rgba(255,255,255,.08)); background: #1a1c21; cursor: pointer; }
/* (v47: the per-card address line was removed on request — the typed text
   of the message now sits above the card and carries the link.) */
.soc-emb-thumb { position: relative; aspect-ratio: 16/9; background: #131519;
    display: flex; align-items: center; justify-content: center; color: var(--win-text-3, #8b93a5); }
.soc-emb-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-emb-thumb.noimg { background: linear-gradient(135deg, #1e2732 0%, #161a20 100%); }
.soc-emb-play { position: relative; z-index: 2; width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(9,11,15,.6); border: 1px solid rgba(255,255,255,.16); color: #fff;
    transition: background .12s ease, transform .12s ease; }
.soc-emb:hover .soc-emb-play { background: var(--accent, #4cc2ff); border-color: transparent; transform: scale(1.07); }
.soc-emb-tag { position: absolute; left: 8px; bottom: 7px; z-index: 2; font-size: 10.5px; font-weight: 600; letter-spacing: .4px;
    color: #eef1f7; background: rgba(9,11,15,.62); padding: 2px 8px; border-radius: 6px; }
.soc-emb-player { width: 100%; }
.soc-emb-iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; background: #000; }
.soc-emb-iframe.tall { aspect-ratio: auto; height: 152px; }
/* v47: fullscreen chrome — expand button, top bar, swipe-down hint, sizing */
.soc-emb-player { position: relative; }
.soc-emb-stage { position: relative; }
.soc-emb-fs { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px;
    border: none; border-radius: 8px; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(9,11,15,.62); color: #fff;
    opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease; }
.soc-emb:hover .soc-emb-fs { opacity: 1; }
.soc-emb-fs:hover { background: var(--accent, #4cc2ff); color: #0b0d10; }
.soc-emb-fsbar { display: none; align-items: center; gap: 8px; flex: none; padding: 7px 10px;
    background: rgba(10,12,16,.94); border-bottom: 1px solid var(--win-border, rgba(255,255,255,.08));
    color: var(--win-text-2, #cfcfcf); font-size: 12px; }
.soc-emb-fsbar-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 600; color: #eef1f7; }
.soc-emb-fsbar-hint { flex: none; font-size: 10.5px; color: var(--win-text-3, #8b93a5); display: none; }
.soc-emb-exit { flex: none; width: 28px; height: 28px; border: none; border-radius: 7px; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); color: #fff;
    transition: background .12s ease, color .12s ease; }
.soc-emb-exit:hover { background: rgba(232,17,35,.75); }
/* Fullscreen state: real (:fullscreen) or pseudo (.isfs, iOS Safari fallback) */
.soc-emb-player:fullscreen, .soc-emb-player:-webkit-fullscreen, .soc-emb.isfs .soc-emb-player {
    position: fixed; inset: 0; z-index: 4001; width: 100%; height: 100%;
    margin: 0; background: #000; display: flex; flex-direction: column; }
.soc-emb-player:fullscreen .soc-emb-stage, .soc-emb.isfs .soc-emb-player .soc-emb-stage {
    flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.soc-emb-player:fullscreen .soc-emb-iframe, .soc-emb.isfs .soc-emb-player .soc-emb-iframe {
    width: 100%; height: 100%; aspect-ratio: auto; }
.soc-emb-player:fullscreen .soc-emb-fsbar, .soc-emb.isfs .soc-emb-fsbar { display: flex; }
.soc-emb-player:fullscreen .soc-emb-fs, .soc-emb.isfs .soc-emb-fs { opacity: 0; pointer-events: none; }
@media (hover: none) and (pointer: coarse) {
    .soc-emb-player:fullscreen .soc-emb-fsbar-hint, .soc-emb.isfs .soc-emb-fsbar-hint { display: inline; }
}
/* (v46: the custom Stop footer was removed — inline players keep their own
   native pause/stop/volume controls.) */
/* Premium in-chat music player — site palette (accent #4cc2ff, dark
   surfaces, 10px radii): address on top, art tile + track + play, seek bar. */
.soc-emb-audio { width: 420px; max-width: 100%; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--win-border, rgba(255,255,255,.08)); background: #1a1c21;
    transition: opacity .2s ease; }
.soc-emb-aud-body { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.soc-emb-aud-art { flex: none; width: 44px; height: 44px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; color: #0b0d10;
    background: linear-gradient(135deg, var(--accent, #4cc2ff) 0%, #8fdcff 100%);
    box-shadow: 0 4px 14px rgba(76,194,255,.22); }
.soc-emb-aud-meta { flex: 1; min-width: 0; }
.soc-emb-aud-name { font-size: 13px; font-weight: 600; color: var(--win-text, #fff);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-emb-aud-sub { font-size: 10.5px; color: var(--win-text-3, #8b93a5);
    letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.soc-emb-aud-play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent, #4cc2ff); color: #0b0d10;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.soc-emb-aud-play:hover { transform: scale(1.06); box-shadow: 0 4px 16px rgba(76,194,255,.4); }
.soc-emb-aud-play:active { transform: scale(.95); }
.soc-emb-aud-play svg { display: block; }
.soc-emb-aud-bar { position: relative; height: 5px; margin: 0 12px; border-radius: 999px; cursor: pointer;
    background: rgba(255,255,255,.1); overflow: hidden; flex: none; }
.soc-emb-aud-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
    background: linear-gradient(90deg, var(--accent, #4cc2ff), #8fdcff); border-radius: 999px; }
.soc-emb-aud-times { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 10px;
    font-size: 10.5px; color: var(--win-text-3, #8b93a5); font-variant-numeric: tabular-nums; }
/* v47: music player volume — icon (mute toggle) + slim slider, site palette */
.soc-emb-aud-vol { display: inline-flex; align-items: center; gap: 7px; }
.soc-emb-aud-volbtn { flex: none; width: 24px; height: 24px; border: none; border-radius: 6px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; background: none; cursor: pointer;
    color: var(--win-text-3, #8b93a5); transition: background .12s ease, color .12s ease; }
.soc-emb-aud-volbtn:hover { background: rgba(76,194,255,.14); color: var(--accent, #4cc2ff); }
.soc-emb-aud-volrange { flex: none; -webkit-appearance: none; appearance: none; width: 64px; height: 4px;
    border-radius: 999px; background: rgba(255,255,255,.12); outline: none; cursor: pointer; }
.soc-emb-aud-volrange::-webkit-slider-thumb { -webkit-appearance: none; appearance: none;
    width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #4cc2ff); border: none; }
.soc-emb-aud-volrange::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent, #4cc2ff); border: none; }
.soc-emb-audio .soc-emb-aud-el { display: none; }
.soc-emb-audio.aud-error { opacity: .55; }
.soc-emb-media { display: flex; flex-direction: column; gap: 5px; width: 100%; max-width: 480px; }
.soc-emb-media audio { display: block; width: 100%; height: 40px; }
.soc-emb-media video { display: block; width: 100%; max-height: 220px; background: #000; border-radius: 8px; }
.soc-emb-imgwrap { border-radius: 10px; overflow: hidden; border: 1px solid var(--win-border, rgba(255,255,255,.08)); }
.soc-emb-imgwrap img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
@media (max-width: 768px) { .soc-emb, .soc-emb-audio, .soc-emb-media, .soc-emb-imgwrap { width: 100%; max-width: 100%; } }

/* Mobile ⋯ button — shown instead of the hover toolbar on small screens.
   (v46: the button itself was removed from the markup on request — this
   block is kept inert in case it is ever revived.) */
.soc-mmore {
    display: none; align-items: center; justify-content: center; flex: none;
    width: 28px; height: 28px; margin-top: 14px; padding: 0;
    background: none; border: none; border-radius: 7px;
    color: var(--win-text-3, #8b93a5); cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.soc-mmore:hover { background: rgba(255,255,255,.08); color: var(--win-text, #fff); }

/* Reaction pills */
.soc-rpills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.soc-rpills[hidden] { display: none; }
.soc-rpill {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    padding: 2px 9px 2px 7px;
    font-size: 13px; line-height: 1.5;
    cursor: pointer;
    animation: socRpillIn .15s ease-out;
    transition: background .12s ease, border-color .12s ease, transform .1s ease;
}
.soc-rpill:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.soc-rpill:active { transform: scale(.95); }
.soc-rpill.own { background: rgba(76,194,255,.16); border-color: rgba(76,194,255,.55); }
.soc-rpill-cnt { font-size: 11.5px; color: var(--win-text-2, #cfcfcf); }
.soc-rpill.own .soc-rpill-cnt { color: var(--accent, #4cc2ff); font-weight: 600; }
@keyframes socRpillIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Reply quote (frozen preview) — clickable to jump to the original. */
.soc-reply {
    display: flex; align-items: baseline; gap: 7px;
    max-width: 560px;
    border-left: 3px solid var(--accent, #4cc2ff);
    padding: 3px 8px 3px 9px; margin-bottom: 4px;
    font-size: 12.5px; border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background .12s ease;
}
.soc-reply:hover { background: rgba(76,194,255,.07); }
.soc-reply-name { flex: none; font-weight: 600; color: var(--accent, #4cc2ff); }
.soc-reply-snip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--win-text-2, #cfcfcf); opacity: .85; }
/* v49.4 — reply preview for image messages: mini thumbnail with an image
   icon behind it (shows through if the thumbnail fails to load). */
.soc-reply-thumb { position: relative; width: 26px; height: 26px; flex: none; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.07); }
.soc-reply-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-thumb-ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--win-text-3, #8b93a5); }
.soc-replybar-thumb { width: 30px; height: 30px; }
.soc-reply svg { flex: none; opacity: .8; }
.soc-reply-gone { cursor: default; border-left-color: rgba(255,255,255,.2); }
.soc-reply-gone span { color: var(--win-text-3, #8b93a5); font-style: italic; }
.soc-reply-gone:hover { background: none; }

/* Forward header */
.soc-fwd {
    display: flex; align-items: center; gap: 6px;
    border-left: 3px solid rgba(76,194,255,.55);
    padding: 2px 8px 2px 9px; margin-bottom: 4px;
    font-size: 12px; color: var(--win-text-3, #8b93a5);
}
.soc-fwd b { color: var(--accent, #4cc2ff); font-weight: 600; }
.soc-fwd svg { flex: none; }

/* Soft-deleted placeholder row */
.soc-msg-gone .soc-av { opacity: .35; filter: grayscale(.6); }
.soc-msg-gone-note {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-style: italic;
    color: var(--win-text-3, #8b93a5);
    margin-top: 1px;
}
/* Moderation-removed variant (admin takedown via a report) — distinct, authoritative */
.soc-msg-gone-mod .soc-av { opacity: .3; filter: grayscale(.8); }
.soc-msg-gone-mod-note {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-style: normal; font-weight: 600;
    color: #f0b429;
    background: rgba(240,180,41,.1);
    border: 1px solid rgba(240,180,41,.28);
    border-radius: 8px; padding: 5px 10px; margin-top: 2px;
}

/* Scroll-to-original flash highlight */
@keyframes socMsgFlash { 0% { background: rgba(76,194,255,.22); } 100% { background: transparent; } }
.soc-msg-flash { animation: socMsgFlash 1.1s ease-out; border-radius: 8px; }

/* Emoji picker — one shared instance; desktop = positioned panel,
   mobile = fixed bottom sheet (class .mob added by JS). */
.soc-epick {
    position: fixed; z-index: 4500; /* must be ABOVE #desktop-shell (900) — body-level overlay */
    width: 300px;
    /* Small windows: never wider than the viewport (the search box inside is
       width:100% and must fit inside the picker, not overflow the window). */
    box-sizing: border-box;
    max-width: calc(100vw - 16px);
    background: #26282d;
    border: 1px solid var(--win-border, rgba(255,255,255,.1));
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,.6);
    padding: 10px;
}
.soc-epick-searchwrap { position: relative; margin-bottom: 6px; }
.soc-epick-searchwrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); opacity: .55; pointer-events: none; }
.soc-epick-searchwrap input {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--win-border, rgba(255,255,255,.1));
    border-radius: 8px;
    color: var(--win-text, #fff);
    font-size: 12.5px;
    padding: 6px 10px 6px 30px;
    outline: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.soc-epick-searchwrap input:focus { border-color: var(--accent, #4cc2ff); box-shadow: 0 0 0 2px rgba(76,194,255,.18); }
.soc-epick-searchwrap input::placeholder { color: var(--win-text-3, #8b93a5); }
.soc-epick-label { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--win-text-3, #8b93a5); margin: 7px 2px 4px; }
.soc-epick-quick, .soc-epick-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.soc-epick-quick button, .soc-epick-grid button {
    width: 32px; height: 30px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 7px;
    font-size: 17px; cursor: pointer;
    transition: background .1s ease, transform .1s ease;
}
.soc-epick-quick button:hover, .soc-epick-grid button:hover { background: rgba(76,194,255,.16); transform: scale(1.12); }
.soc-epick-none { grid-column: 1 / -1; padding: 12px 4px; font-size: 12px; color: var(--win-text-3, #8b93a5); text-align: center; }
.soc-epick.mob { left: 10px; right: 10px; bottom: 10px; top: auto; width: auto; max-height: 60vh; overflow-y: auto; }

/* Reply preview bar (above the input row) */
.soc-replybar {
    display: flex; align-items: center; gap: 10px;
    margin: 0 14px 2px;
    background: rgba(76,194,255,.07);
    border: 1px solid rgba(76,194,255,.25);
    border-left: 3px solid var(--accent, #4cc2ff);
    border-radius: 8px;
    padding: 7px 10px 7px 12px;
    animation: socRbIn .18s ease-out;
}
@keyframes socRbIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.soc-replybar-t { flex: 1 1 auto; min-width: 0; font-size: 12.5px; }
.soc-replybar-t b { color: var(--accent, #4cc2ff); font-weight: 600; }
.soc-replybar-snip { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--win-text-3, #8b93a5); font-size: 12px; margin-top: 1px; }
.soc-replybar-snip > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#socRbX {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0;
    background: none; border: 1px solid transparent; border-radius: 7px;
    color: var(--win-text-3, #8b93a5); cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
#socRbX:hover { background: rgba(255,255,255,.08); color: #fff; }
#socRbX:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 1px; }

/* Mobile bottom sheet (⋯ menu) */
.soc-sheetbg { position: fixed; inset: 0; z-index: 4600; /* above #desktop-shell (900) */ background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.soc-sheetbg[hidden], .soc-sheet[hidden] { display: none !important; }
.soc-sheet {
    width: 100%;
    background: #26282d;
    border-top: 1px solid var(--win-border, rgba(255,255,255,.1));
    border-radius: 14px 14px 0 0;
    padding: 8px 0 12px;
    animation: socSheetIn .18s ease-out;
}
@keyframes socSheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
.soc-sheet-grab { width: 36px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.2); margin: 0 auto 10px; }
.soc-sheet-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 18px;
    background: none; border: none;
    color: var(--win-text, #f0f0f0);
    font-size: 14px; font-weight: 500;
    cursor: pointer; text-align: left;
    transition: background .12s ease;
}
.soc-sheet-item:hover { background: rgba(255,255,255,.06); }
.soc-sheet-ic { display: inline-flex; color: var(--accent, #4cc2ff); }

/* Right-click context menu (desktop) */
.soc-cmenu {
    position: fixed; z-index: 4700; /* above #desktop-shell (900) */
    animation: socCtxIn .12s ease; transform-origin: left top;
    min-width: 185px;
    background: #26282d;
    border: 1px solid var(--win-border, rgba(255,255,255,.1));
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0,0,0,.6);
    padding: 5px;
}
.soc-cmenu[hidden] { display: none !important; }
.soc-cmenu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 10px;
    background: none; border: none; border-radius: 7px;
    color: var(--win-text, #f0f0f0);
    font-size: 13px;
    cursor: pointer; text-align: left;
    transition: background .1s ease;
}
.soc-cmenu-item span { display: inline-flex; color: var(--win-text-3, #8b93a5); }
.soc-cmenu-item:hover { background: rgba(255,255,255,.07); }
.soc-cmenu-item:hover span { color: var(--accent, #4cc2ff); }
.soc-cmenu-item:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: -2px; }
.soc-cmenu-danger { color: #f23f43; }
.soc-cmenu-danger span { color: #f23f43; }
.soc-cmenu-danger:hover { background: rgba(242,63,67,.12); }
.soc-cmenu-danger:hover span { color: #f23f43; }
.soc-cmenu-sep { height: 1px; background: rgba(255,255,255,.08); margin: 4px 6px; }

/* Forward modal extras */
.soc-fwd-prev {
    margin-top: 6px;
    font-size: 12px; color: var(--win-text-3, #8b93a5);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.soc-fwd-searchwrap { position: relative; margin: 10px 16px; }
.soc-fwd-searchwrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: .55; pointer-events: none; }
.soc-fwd-searchwrap input {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--win-border, rgba(255,255,255,.1));
    border-radius: 8px;
    color: var(--win-text, #fff);
    font-size: 13px;
    padding: 8px 12px 8px 32px;
    outline: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.soc-fwd-searchwrap input:focus { border-color: var(--accent, #4cc2ff); box-shadow: 0 0 0 2px rgba(76,194,255,.18); }
.soc-fwd-searchwrap input::placeholder { color: var(--win-text-3, #8b93a5); }
.soc-fwd-sec {
    font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
    color: var(--win-text-3, #8b93a5);
    padding: 8px 10px 3px;
}
.soc-pick-row.sel { background: rgba(76,194,255,.16); border-color: rgba(76,194,255,.55); }
.soc-fwd-foot { padding: 10px 16px 14px; border-top: 1px solid var(--win-border, rgba(255,255,255,.08)); margin-top: 4px; }
.soc-fwd-foot textarea {
    width: 100%; margin-bottom: 10px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--win-border, rgba(255,255,255,.1));
    border-radius: 8px;
    color: var(--win-text, #fff);
    font-size: 13px; font-family: inherit;
    padding: 8px 10px;
    outline: none; resize: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.soc-fwd-foot textarea:focus { border-color: var(--accent, #4cc2ff); box-shadow: 0 0 0 2px rgba(76,194,255,.18); }
.soc-fwd-foot textarea::placeholder { color: var(--win-text-3, #8b93a5); }

/* Mobile: swap the hover toolbar for the ⋯ button */
@media (max-width: 768px) {
    .soc-mtb { display: none; }
    .soc-mmore { display: inline-flex; }
}
.soc-filepop {
    position: absolute;
    left: 12px;
    bottom: calc(100% + 6px);
    z-index: 90;
    min-width: 250px;
    max-width: 360px;
    max-height: 280px;
    overflow-y: auto;
    background: #1e1e1e;
    border: 1px solid var(--win-border, rgba(255,255,255,.16));
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.55);
    padding: 5px;
}
.soc-filepop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    background: none;
    color: var(--win-text, #fff);
    font-size: 12.5px;
    text-align: left;
    padding: 7px 9px;
    border-radius: 7px;
    cursor: pointer;
}
.soc-filepop-item:hover { background: rgba(255,255,255,.07); }
.soc-filepop-item.active { background: rgba(76,194,255,.16); }
.soc-filepop-item span:first-child { flex: none; font-size: 14px; }
/* Image/video rows get a small live thumbnail IN FLOW (v48 — it can never
   cover the filename); the wrapper's silver line icon sits behind it and
   shows through if the thumbnail 404s/errors. Music/other rows use the same
   line-glyph family as the rest of the site (CSS-mask, silver stroke). */
.soc-filepop-thwrap {
    position: relative; flex: none; width: 34px; height: 24px; border-radius: 5px;
    overflow: hidden; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.45);
    display: inline-flex; align-items: center; justify-content: center;
}
.soc-filepop-thwrap::before {
    content: ''; width: 15px; height: 15px; background-color: rgba(255,255,255,.55);
    -webkit-mask: var(--thic) center / 15px 15px no-repeat; mask: var(--thic) center / 15px 15px no-repeat;
}
.soc-filepop-thwrap.th-img { --thic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><circle cx='8.5' cy='10' r='1.7'/><path d='M4 17l4.5-4.5 3.4 3.4 3-3L20 17.5'/></svg>"); }
.soc-filepop-thwrap.th-vid { --thic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='6' width='16' height='12' rx='2'/><path d='M10.5 9.5l4 2.5-4 2.5z' fill='%23000' stroke='none'/></svg>"); }
.soc-filepop-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; pointer-events: none; }
.soc-filepop-ic {
    width: 18px; height: 18px; flex: none; display: inline-block; font-size: 0;
    background-color: currentColor;
    -webkit-mask: var(--fic) center / 18px 18px no-repeat; mask: var(--fic) center / 18px 18px no-repeat;
}
.soc-filepop-ic.fic-music { --fic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M9 17.5V5l9-2.2v11.7'/><circle cx='7' cy='17.5' r='2'/><circle cx='16' cy='14.5' r='2'/></svg>"); }
.soc-filepop-ic.fic-other, .soc-filepop-ic.fic-file { --fic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M14.8 7.2L8.6 13.4a2.6 2.6 0 0 0 3.7 3.7l5.6-5.6a4.3 4.3 0 0 0-6.1-6.1L6.3 9.6'/></svg>"); }
.soc-filepop-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-filepop-size { flex: none; font-size: 10.5px; color: var(--win-text-2, #cfcfcf); opacity: .75; }
.soc-filepop-empty { padding: 10px; font-size: 12px; color: var(--win-text-2, #cfcfcf); }
.soc-filepop-hint { padding: 6px 9px 3px; font-size: 10px; color: var(--win-text-2, #cfcfcf); opacity: .6; }
/* Clickable links inside chat messages (file links, URLs) */
.soc-msg-link { color: var(--accent, #4cc2ff); text-decoration: none; overflow-wrap: anywhere; }
.soc-msg-link:hover { text-decoration: underline; }

/* ---------------- chat image lightbox (pop-out viewer) ---------------- */
/* v49: z-index must sit in the app's full-screen overlay band (4000+) —
   at 400 the desktop-mode taskbar (z 2000) painted over the lightbox and
   hid its bottom control row.
   v52: raised to 100000 so a shared file clicked INSIDE the profile modal
   (z 99999) opens the lightbox ABOVE it, as intended. Still below the
   confirm box (999999). */
.soc-lb {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(8,10,14,.86); backdrop-filter: blur(6px);
    overflow: hidden; opacity: 0;
    transition: opacity .18s ease;
}
.soc-lb[hidden] { display: none !important; }
.soc-lb.open { opacity: 1; }
.soc-lb-stage {
    display: flex; max-width: 100%; max-height: 100%;
    transform: scale(.3);
    transform-origin: var(--lb-ox, 50%) var(--lb-oy, 50%);
    transition: transform .22s cubic-bezier(.2, 1.35, .4, 1);
    touch-action: none; /* we handle pinch/pan ourselves */
}
.soc-lb.open .soc-lb-stage { transform: scale(1); }
.soc-lb img {
    max-width: 92vw; max-height: 88vh;
    width: auto; height: auto;
    border-radius: 8px; box-shadow: 0 30px 90px rgba(0,0,0,.65);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.soc-lb-x {
    position: absolute; top: 14px; right: 16px;
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.10); color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer; z-index: 2;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.soc-lb-x:hover { background: #e81123; border-color: #e81123; }
.soc-lb-ctrls {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 2;
}
.soc-lb-btn {
    min-width: 46px; height: 46px; padding: 0 12px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.09); color: #fff;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.soc-lb-btn:hover { background: var(--accent, #4cc2ff); color: #08202e; border-color: transparent; }

/* ---------------- v48: lightbox annotation (draw on a chat image) -------- */
.soc-lb-imgwrap { position: relative; display: flex; max-width: 100%; max-height: 100%; }
.soc-lb-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    display: none; touch-action: none; cursor: crosshair; z-index: 1; border-radius: 8px;
}
.soc-lb-canvas.on { display: block; }
.soc-lb.drawing .soc-lb-ctrls { display: none; }
.soc-lb-drawbtn { display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; }
.soc-lb-drawbar {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
    z-index: 3; max-width: calc(100vw - 24px);
    background: rgba(17,20,26,.94); border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px; padding: 8px 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(8px);
}
.soc-lb-drawbar[hidden] { display: none; }
.soc-lb-drawgrp { display: flex; align-items: center; gap: 5px; }
.soc-lb-sep { width: 1px; height: 22px; background: rgba(255,255,255,.12); margin: 0 3px; flex: none; }
.soc-lb-swatch {
    width: 21px; height: 21px; border-radius: 50%; flex: none; cursor: pointer; padding: 0;
    border: 2px solid rgba(255,255,255,.25);
    transition: transform .12s ease, box-shadow .12s ease;
}
.soc-lb-swatch:hover { transform: scale(1.14); }
.soc-lb-swatch.on { box-shadow: 0 0 0 2px #11141a, 0 0 0 4px rgba(255,255,255,.85); }
.soc-lb-size {
    width: 27px; height: 27px; border-radius: 7px; flex: none; cursor: pointer; padding: 0;
    border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07);
    display: flex; align-items: center; justify-content: center;
    transition: background .12s ease;
}
.soc-lb-size span { display: block; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.soc-lb-size[data-s="6"] span { width: 7px; height: 7px; }
.soc-lb-size[data-s="11"] span { width: 11px; height: 11px; }
.soc-lb-size:hover { background: rgba(255,255,255,.16); }
.soc-lb-size.on { border-color: var(--accent, #4cc2ff); box-shadow: 0 0 0 1px var(--accent, #4cc2ff); }
.soc-lb-drawbar .soc-lb-btn { height: 38px; min-width: 38px; }
.soc-lb-drawsave {
    height: 38px; padding: 0 14px; border-radius: 10px; border: none; cursor: pointer;
    background: var(--accent, #4cc2ff); color: #08202e; font-weight: 600; font-size: 12.5px;
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.28);
}
.soc-lb-drawsave:hover { filter: brightness(1.12); color: #08202e; background: var(--accent, #4cc2ff); }
@media (max-width: 768px) {
    .soc-lb-drawbar { bottom: 12px; padding: 7px 9px; border-radius: 11px; }
    .soc-lb-drawsave { height: 34px; padding: 0 11px; }
    .soc-lb-drawbar .soc-lb-btn { height: 34px; min-width: 34px; }
}

/* ---------------- ↓ jump-to-unread / jump-to-latest (bottom-right of chat) ---------------- */
.soc-jump {
    position: absolute;
    right: 14px;
    bottom: 96px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.16));
    background: var(--win-bg-2, #2b2b2b);
    color: var(--win-text, #fff);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.soc-jump:hover { background: var(--accent, #4cc2ff); color: #08202e; border-color: transparent; }

/* ---------------- N+17: GLOBAL CALL UI (docked, centered above the taskbar) ----------------
   Lives OUTSIDE the Communication Center window (document.body), so it
   survives the window being minimized or closed. It reads as a panel that
   unfolds upward out of the taskbar: the bar's own acrylic surface + blur,
   anchored just above it, growing from its base edge with a soft spring.
   The same rules apply on mobile (--taskbar-h is 52px there). */
#socGlobalCall {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(var(--taskbar-h, 48px) + 6px);
    transform: translateX(-50%);
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 12px);
}
/* Phone: lift the call toaster up by roughly its own height so it clears the
   taskbar / thumb zone and reads as a proper notification banner. */
@media (max-width: 768px) {
    /* Lifted a further ~half of the original 62 px (31 px) on top. */
    #socGlobalCall { bottom: calc(var(--taskbar-h, 48px) + 6px + 62px + 31px); }
}
.sog-card {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
    max-width: calc(100vw - 32px);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-top-color: rgba(255,255,255,.22);
    background: var(--acrylic, rgba(32,32,32,.78));
    backdrop-filter: blur(30px) saturate(1.3);
    -webkit-backdrop-filter: blur(30px) saturate(1.3);
    box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 24px rgba(76,194,255,.08), inset 0 1px 0 rgba(255,255,255,.07);
    transform-origin: 50% 100%;
    animation: sogGrow .32s cubic-bezier(.2,.9,.3,1.15);
}
.sog-card[hidden] { display: none !important; }
/* Grows upward out of the taskbar: unfolds from the base edge (transform-
   origin bottom) with a slight springy overshoot — like a taskbar popup. */
@keyframes sogGrow {
    0%   { opacity: 0; transform: translateY(65%) scaleY(.42); }
    100% { opacity: 1; transform: translateY(0) scaleY(1); }
}
#sogIncoming {
    border-color: rgba(126,226,168,.55);
    /* Ringing: border + glow pulse (starts after the grow-in finishes). */
    animation: sogGrow .32s cubic-bezier(.2,.9,.3,1.15), socRingPulse 1.4s ease-in-out .35s infinite;
}
#sogIncoming .sog-ic { animation: socPulse 1.4s ease-in-out infinite; }
@keyframes socRingPulse {
    0%, 100% { border-color: rgba(126,226,168,.35); box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 0 0 rgba(126,226,168,0), inset 0 1px 0 rgba(255,255,255,.07); }
    50%      { border-color: rgba(126,226,168,1);   box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 0 5px rgba(126,226,168,.20), inset 0 1px 0 rgba(255,255,255,.07); }
}
/* Answering: card collapses toward the pressed button (origin set inline
   from the button's center); decline turns the ring red. Then the button
   itself shrinks + fades. */
#sogIncoming.sog-bye {
    animation: sogBye 0.2s cubic-bezier(0.6, 0, 0.92, 0.55) forwards;
    transform-origin: var(--bye-ox, 50%) 50%;
}
#sogIncoming.sog-bye-decline { border-color: rgba(232,17,35,.95); box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 0 4px rgba(232,17,35,.28), inset 0 1px 0 rgba(255,255,255,.07); --bye-glow: rgba(232,17,35,.6); }
#sogIncoming.sog-bye-accept { border-color: rgba(126,226,168,1); box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 0 4px rgba(126,226,168,.3), inset 0 1px 0 rgba(255,255,255,.07); --bye-glow: rgba(126,226,168,.65); }
@keyframes sogBye {
    0%   { opacity: 1; transform: none; box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 0 2px var(--bye-glow, rgba(126,226,168,.3)); }
    100% { opacity: 0.1; transform: scale(0.03, 0.3); box-shadow: 0 0 0 4px var(--bye-glow, rgba(126,226,168,.65)), 0 0 42px 12px var(--bye-glow, rgba(126,226,168,.65)); }
}
#sogIncoming .sog-bye-btn { animation: sogBtnBye 0.12s cubic-bezier(0.5, 0, 0.9, 0.5) 0.12s forwards; }
@keyframes sogBtnBye {
    0%   { opacity: 1; transform: none; }
    100% { opacity: 0; transform: scale(0.3); }
}
.sog-ic { flex: none; font-size: 22px; line-height: 1; }
/* Incoming-call caller avatar (replaces the phone icon) */
.sog-av-slot { display: flex; align-items: center; justify-content: center; }
.sog-av-slot .soc-av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.sog-av-slot .soc-av img { width: 100%; height: 100%; object-fit: cover; }
.sog-av-slot .soc-av-init { font-size: 15px; }
.sog-body { flex: 1; min-width: 0; }
.sog-name {
    margin: 0; padding: 0; border: 0; background: none;
    font: inherit; font-size: 14px; font-weight: 700;
    color: var(--win-text, #f2f2f2);
    text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: default; display: inline-block; max-width: 100%;
}
#sogInName { cursor: pointer; }
#sogInName:hover { color: #7ee2a8; text-decoration: underline; }
.sog-sub { margin-top: 2px; font-size: 11.5px; color: var(--win-text-2, #a9a9a9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sog-btns { display: flex; gap: 6px; flex: none; }
.sog-b {
    width: 34px; height: 34px; flex: none; border-radius: 50%;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.16));
    background: rgba(255,255,255,.06);
    color: var(--win-text, #f2f2f2);
    font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, border-color .12s, color .12s;
}
.sog-b:hover { background: rgba(255,255,255,.15); }
.sog-b.ok { background: rgba(35,165,90,.3); border-color: rgba(35,165,90,.7); color: #a5f0c5; }
.sog-b.ok:hover { background: rgba(35,165,90,.45); color: #c9f7dc; }
.sog-b.danger:hover { background: rgba(232,17,35,.3); border-color: #e81123; color: #fff; }
.sog-b.on { background: rgba(232,17,35,.28); border-color: rgba(232,17,35,.65); color: #ff8f9d; }

/* ---------------- N+17: green "available to call" phone icon ----------------
   The icon is an inline SVG painted with currentColor, so it inherits the
   button's green (online/available). Gray only when the peer is offline. */
.soc-call-svg { flex: none; display: inline-block; vertical-align: -2px; }
.soc-btn .soc-call-svg { margin-right: 6px; }
.soc-mini.soc-call-go { color: #7ee2a8; }
.soc-mini.soc-call-go:hover { background: rgba(35,165,90,.3); color: #a5f0c5; }
.soc-call-act.off { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); color: #9a9a9a; }
.soc-call-act.off:hover { background: rgba(255,255,255,.1); color: #cfcfcf; }

/* ---------------- N+18: global card name navigation + fallback share stage ---------------- */
/* N+19: the whole card body is clickable (dblclick desktop / tap touch).
   Buttons suppress the tap-highlight flash so only non-button taps light up
   the card; button taps rely on their own hover/active styling. */
#sogCallName, #sogChanName, #sogInName { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sog-b { -webkit-tap-highlight-color: transparent; }
.sog-b:active { background: rgba(255,255,255,.22); }
#sogCallName:hover, #sogChanName:hover { color: #7ee2a8; text-decoration: underline; }
/* The 1:1 call card grows when the fallback shared-screen video is mounted on it.
   N+24: width capped to the viewport so the card fits phone screens. */
#sogCall .sog-stage { display: none; width: 100%; margin-top: 6px; }
#sogCall.has-stage { flex-wrap: wrap; align-items: flex-start; width: min(420px, calc(100vw - 24px)); }
#sogCall.has-stage .sog-stage { display: block; }
.sog-stage { position: relative; }
.sog-stage video, .sog-stage .soc-call-stage-video, .sog-stage .sog-v {
    width: 100%; max-height: min(220px, 44vh); object-fit: contain;
    border-radius: 8px; background: #000; display: block; border: 1px solid rgba(255,255,255,.12);
}
.sog-stage .sog-v { animation: sogVin .18s ease; }
@keyframes sogVin { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------- N+23: mini card live share/camera preview + controls ---------------- */
/* Share/camera control buttons — only visible when someone is streaming. */
.sog-sharebtn { display: none; }
.sog-card.has-share .sog-sharebtn { display: inline-flex; }
/* Voice-channel mini card gets the same live preview + widen behavior as the call card. */
#sogChan .sog-stage { display: none; width: 100%; margin-top: 6px; }
#sogChan.has-stage { flex-wrap: wrap; align-items: flex-start; width: min(420px, calc(100vw - 24px)); }
#sogChan.has-stage .sog-stage { display: block; }

/* N+24: tab strip to swap between multiple live streams (top-left of the
   video). Small pills, glassy, in line with the theme. */
.sog-tabs {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    display: flex; gap: 5px; max-width: calc(100% - 16px); overflow-x: auto;
    padding: 2px; scrollbar-width: none;
}
.sog-tabs::-webkit-scrollbar { display: none; }
.sog-tab {
    flex: none; max-width: 92px;
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(8,12,20,.72); backdrop-filter: blur(6px);
    color: #dfe9f5; font-size: 11px; line-height: 1;
    padding: 4px 10px; border-radius: 999px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer; display: inline-flex; align-items: center;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, color .12s, border-color .12s;
}
.sog-tab:hover { background: rgba(76,194,255,.18); }
.sog-tab.act { background: rgba(76,194,255,.25); border-color: rgba(76,194,255,.7); color: #c4e9ff; }
/* N+24: hidden parking dock — stays in the DOM (watchdog-safe) but invisible. */
.sog-park { display: none !important; }

/* ============================================================
   COMMUNITY CENTER — Design system
   A hand-tuned layer aligned to the MyPortal desktop: unified
   surfaces, silver/blue accent, custom sliders & switches,
   premium buttons, refined scrollbars, on-brand focus rings.
   Everything is scoped to #socialPage and prefixed so it wins.
   ============================================================ */
#socialPage {
    --sc-acc: #4cc2ff;
    --sc-acc-strong: #2ba6f0;
    --sc-acc-soft: rgba(76,194,255,.16);
    --sc-text: #eef2f7;
    --sc-text-2: #aeb8c6;
    --sc-line: rgba(255,255,255,.08);
    --sc-line-2: rgba(255,255,255,.15);
    --sc-r: 10px;
    --sc-r-sm: 8px;
    --sc-focus: 0 0 0 3px rgba(76,194,255,.30);
    --sc-ease: cubic-bezier(.2,.8,.2,1);
    --sc-toplight: inset 0 1px 0 rgba(255,255,255,.06);
}

/* --- consistent, calm motion on every interactive element --- */
#socialPage button,
#socialPage a,
#socialPage input,
#socialPage select,
#socialPage textarea,
#socialPage .soc-chan,
#socialPage .soc-dm,
#socialPage .soc-vuser,
#socialPage .soc-tab,
#socialPage .sog-tab {
    transition: background .16s var(--sc-ease), color .16s var(--sc-ease),
                border-color .16s var(--sc-ease), box-shadow .18s var(--sc-ease),
                transform .12s var(--sc-ease), opacity .16s var(--sc-ease);
}

/* --- one consistent, visible, on-brand focus ring --- */
#socialPage :focus-visible { outline: none; box-shadow: var(--sc-focus); }
#socialPage input:focus-visible,
#socialPage textarea:focus-visible,
#socialPage select:focus-visible {
    outline: none;
    border-color: var(--sc-acc) !important;
    box-shadow: var(--sc-focus);
}

/* ============================================================
   Buttons — one family. Neutral = brushed glass; accent = lit.
   ============================================================ */
#socialPage .soc-btn,
#socialPage .soc-iconbtn,
#socialPage .soc-small-btn,
#socialPage .soc-sm-btn,
#socialPage .soc-txt-btn,
#socialPage .soc-mini,
#socialPage .soc-mini-btn,
#socialPage .soc-sc-btn,
#socialPage .soc-wc-btn,
#socialPage .soc-lb-btn,
#socialPage .soc-ping-toggle,
#socialPage .soc-big,
#socialPage .smv-b,
#socialPage .soc-ucm-item {
    border: 1px solid var(--sc-line-2);
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
    color: var(--sc-text);
    box-shadow: var(--sc-toplight), 0 1px 2px rgba(0,0,0,.35);
}
#socialPage button.soc-btn:hover,
#socialPage button.soc-small-btn:hover,
#socialPage button.soc-sm-btn:hover,
#socialPage button.soc-txt-btn:hover,
#socialPage button.soc-mini:hover,
#socialPage button.soc-mini-btn:hover,
#socialPage button.soc-sc-btn:hover,
#socialPage button.soc-wc-btn:hover,
#socialPage button.soc-lb-btn:hover,
#socialPage button.soc-ping-toggle:hover,
#socialPage button.soc-big:hover,
#socialPage button.smv-b:hover {
    background: linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,.08));
    border-color: rgba(255,255,255,.26);
    box-shadow: var(--sc-toplight), 0 3px 12px rgba(0,0,0,.4);
    transform: translateY(-1px);
}
#socialPage button.soc-btn:active,
#socialPage button.soc-mini:active,
#socialPage button.soc-sm-btn:active,
#socialPage button.soc-txt-btn:active,
#socialPage button.soc-small-btn:active,
#socialPage button.soc-sc-btn:active,
#socialPage button.soc-wc-btn:active,
#socialPage button.soc-big:active,
#socialPage button.smv-b:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 6px rgba(0,0,0,.4);
}

/* --- primary / accent / state buttons: lit, not flat --- */
#socialPage .soc-btn-ok {
    background: linear-gradient(180deg, #74d3ff, #2ba6f0);
    border-color: rgba(255,255,255,.35);
    color: #04121e;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 14px rgba(43,166,240,.34);
}
#socialPage .soc-btn-ok:hover {
    background: linear-gradient(180deg, #8adcff, #34b2f5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 20px rgba(43,166,240,.5);
    transform: translateY(-1px);
}
#socialPage .soc-btn-green {
    background: linear-gradient(180deg, #34c973, #1e8f4e);
    border-color: rgba(255,255,255,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 14px rgba(35,165,90,.32);
}
#socialPage .soc-btn-green:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 20px rgba(35,165,90,.48); transform: translateY(-1px); }
#socialPage .soc-btn-danger:hover {
    background: linear-gradient(180deg, #ff5b6b, #e81123);
    box-shadow: 0 5px 18px rgba(232,17,35,.45);
    transform: translateY(-1px);
}
/* on / active toggle buttons: keep the accent, add a soft glow */
#socialPage .soc-sm-btn.on,
#socialPage .soc-txt-btn.active,
#socialPage .soc-mini.active,
#socialPage .soc-big.active,
#socialPage .smv-b.active {
    background: linear-gradient(180deg, rgba(76,194,255,.30), rgba(76,194,255,.14));
    border-color: rgba(76,194,255,.65);
    color: #cdeeff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 0 12px rgba(76,194,255,.28);
}
#socialPage .soc-mini.danger:hover,
#socialPage .soc-sc-btn.sc-danger:hover {
    background: linear-gradient(180deg, #ff5b6b, #e81123);
    box-shadow: 0 4px 14px rgba(232,17,35,.45);
}
/* disabled */
#socialPage button:disabled,
#socialPage button[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================================
   Sliders — a slim inset groove + a glossy, glowing knob
   ============================================================ */
#socialPage input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 20px; background: transparent; cursor: pointer;
    accent-color: var(--sc-acc); /* graceful fallback */
}
#socialPage input[type="range"]::-webkit-slider-runnable-track {
    height: 5px; border-radius: 999px;
    background: linear-gradient(180deg, rgba(0,0,0,.4), rgba(255,255,255,.10));
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.5);
}
#socialPage input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff, #c9d3df 55%, #9fb0c4);
    border: 1px solid rgba(255,255,255,.6);
    box-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 0 3px rgba(76,194,255,.14), 0 0 10px rgba(76,194,255,.35);
    transition: transform .12s var(--sc-ease), box-shadow .12s var(--sc-ease);
}
#socialPage input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.14); box-shadow: 0 1px 4px rgba(0,0,0,.6), 0 0 0 4px rgba(76,194,255,.2), 0 0 14px rgba(76,194,255,.5); }
#socialPage input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.22); }
#socialPage input[type="range"]::-moz-range-track { height: 5px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.10); }
#socialPage input[type="range"]::-moz-range-progress { height: 5px; border-radius: 999px; background: linear-gradient(90deg, #2ba6f0, #74d3ff); }
#socialPage input[type="range"]::-moz-range-thumb {
    width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6);
    background: radial-gradient(circle at 35% 30%, #fff, #c9d3df 55%, #9fb0c4);
    box-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 10px rgba(76,194,255,.35);
}

/* ============================================================
   Toggles — real switches for checkboxes, refined radios
   ============================================================ */
#socialPage .soc-radio { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 3px 0; }
#socialPage input[type="checkbox"] {
    -webkit-appearance: none; appearance: none;
    width: 36px; height: 20px; flex: none; margin: 1px 0 0; border: 0; padding: 0;
    border-radius: 999px; cursor: pointer; position: relative;
    background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(255,255,255,.10));
    border: 1px solid var(--sc-line-2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.5);
    transition: background .18s var(--sc-ease), border-color .18s var(--sc-ease), box-shadow .18s var(--sc-ease);
}
#socialPage input[type="checkbox"]::after {
    content: ''; position: absolute; top: 1px; left: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #c9d3df 60%, #9fb0c4);
    box-shadow: 0 1px 3px rgba(0,0,0,.5);
    transition: left .18s var(--sc-ease);
}
#socialPage input[type="checkbox"]:checked {
    background: linear-gradient(90deg, #2ba6f0, #74d3ff);
    border-color: rgba(255,255,255,.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 12px rgba(76,194,255,.35);
}
#socialPage input[type="checkbox"]:checked::after { left: 18px; }
#socialPage input[type="radio"] {
    -webkit-appearance: none; appearance: none;
    width: 17px; height: 17px; flex: none; margin: 2px 0 0; border: 0; padding: 0;
    border-radius: 50%; cursor: pointer; position: relative;
    background: rgba(0,0,0,.3);
    border: 1.5px solid var(--sc-line-2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.5);
    transition: border-color .15s var(--sc-ease), box-shadow .15s var(--sc-ease);
}
#socialPage input[type="radio"]:checked { border-color: var(--sc-acc); box-shadow: 0 0 8px rgba(76,194,255,.4); }
#socialPage input[type="radio"]:checked::after {
    content: ''; position: absolute; inset: 4px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #74d3ff);
    box-shadow: 0 0 6px rgba(76,194,255,.6);
}

/* --- selects: same brushed-glass treatment as buttons --- */
#socialPage select {
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
    border: 1px solid var(--sc-line-2);
    border-radius: 8px;
    color: var(--sc-text);
    box-shadow: var(--sc-toplight);
}

/* ============================================================
   Scrollbars — slim, rounded, on-brand
   ============================================================ */
#socialPage ::-webkit-scrollbar { width: 11px; height: 11px; }
#socialPage ::-webkit-scrollbar-track { background: transparent; }
#socialPage ::-webkit-scrollbar-corner { background: transparent; }
#socialPage ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255,255,255,.20), rgba(255,255,255,.10));
    border-radius: 999px; border: 3px solid transparent; background-clip: padding-box;
}
#socialPage ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(76,194,255,.45), rgba(76,194,255,.22));
    background-clip: padding-box;
}

/* ============================================================
   Panels, popovers, call card — subtle depth + a top light
   ============================================================ */
#socialPage .soc-call-card,
#socialPage .soc-volpop {
    box-shadow: 0 18px 50px rgba(0,0,0,.5), var(--sc-toplight);
    border: 1px solid var(--sc-line-2);
}

/* --- section headers + tabs: crisp, quiet, on-brand --- */
#socialPage .soc-sec { letter-spacing: .8px; }
#socialPage .soc-tab.active { text-shadow: 0 0 12px rgba(76,194,255,.5); }
#socialPage .sog-tab.act { box-shadow: 0 0 12px rgba(76,194,255,.4); }

/* --- status dots: subtle glow on online --- */
#socialPage .soc-dot.online { box-shadow: 0 0 4px rgba(35,165,90,.5); }

/* ============================================================
   COMMUNITY CENTER — icon set
   Monochrome silver line-glyphs (same family as the desktop
   ICONS / iconSvg set) rendered with a CSS mask. The mask takes
   the button's own `color`, so icons read silver at rest and
   turn the state color (blue/red) automatically when the
   existing .active / .on classes are applied. This is pure CSS:
   the emoji text is collapsed (font-size:0) and never re-read by
   JS, so the stateful emoji-toggle logic stays untouched and the
   icons can't be clobbered on a toggle.
   ============================================================ */
.soc-big, .smv-b, .soc-plus, .sog-b { position: relative; font-size: 0; }
.soc-big::before, .smv-b::before, .soc-plus::before, .sog-b::before {
    content: '';
    position: absolute; inset: 0; margin: auto;
    width: 20px; height: 20px;
    background-color: currentColor;
    -webkit-mask: var(--ic) center / 20px 20px no-repeat;
    mask: var(--ic) center / 20px 20px no-repeat;
    pointer-events: none;
}

/* --- composer ＋ (attach) --- */
.soc-plus { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 5.5v13'/><path d='M5.5 12h13'/></svg>"); }

/* --- voice user panel (.soc-big) --- */
#socUpMute { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/></svg>"); }
#socUpMute.active { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/><path d='M4 3.5L20 20.5'/></svg>"); }
#socUpDeafen { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16 8.5a5 5 0 0 1 0 7'/><path d='M18.6 6a8.5 8.5 0 0 1 0 12'/></svg>"); }
#socUpDeafen.active { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16.5 9.5l5 5M21.5 9.5l-5 5'/></svg>"); }
#socUpShare { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='12.5' rx='2'/><path d='M9 20.5h6'/><path d='M12 17v3.5'/></svg>"); }
#socUpCam { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M8 7l1.3-2h5.4L16 7'/><rect x='3' y='7' width='18' height='13' rx='2.5'/><circle cx='12' cy='13.5' r='3.4'/></svg>"); }
#socUpCam.active { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M8 7l1.3-2h5.4L16 7'/><rect x='3' y='7' width='18' height='13' rx='2.5'/><circle cx='12' cy='13.5' r='3.4'/><path d='M4 4L20 20.5'/></svg>"); }
#socUpCamSwitch { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M7 8.5h10'/><path d='M14.5 5.5L17.5 8.5 14.5 11.5'/><path d='M17 15.5H7'/><path d='M9.5 12.5L6.5 15.5 9.5 18.5'/></svg>"); }

/* --- mini voice bar (.smv-b) --- */
#smvMute { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/></svg>"); }
#smvMute.active { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/><path d='M4 3.5L20 20.5'/></svg>"); }
#smvDeafen { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16 8.5a5 5 0 0 1 0 7'/><path d='M18.6 6a8.5 8.5 0 0 1 0 12'/></svg>"); }
#smvDeafen.active { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16.5 9.5l5 5M21.5 9.5l-5 5'/></svg>"); }
#smvShare { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='12.5' rx='2'/><path d='M9 20.5h6'/><path d='M12 17v3.5'/></svg>"); }
#smvCam { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M8 7l1.3-2h5.4L16 7'/><rect x='3' y='7' width='18' height='13' rx='2.5'/><circle cx='12' cy='13.5' r='3.4'/></svg>"); }
#smvCam.active { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M8 7l1.3-2h5.4L16 7'/><rect x='3' y='7' width='18' height='13' rx='2.5'/><circle cx='12' cy='13.5' r='3.4'/><path d='M4 4L20 20.5'/></svg>"); }
#smvCamSwitch { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M7 8.5h10'/><path d='M14.5 5.5L17.5 8.5 14.5 11.5'/><path d='M17 15.5H7'/><path d='M9.5 12.5L6.5 15.5 9.5 18.5'/></svg>"); }
#smvPTTHold { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/></svg>"); }

/* --- global mini call / voice card (.sog-b) — body-level toaster --- */
#sogMute, #sogChMute { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/></svg>"); }
#sogMute.on, #sogChMute.on { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/><path d='M4 3.5L20 20.5'/></svg>"); }
#sogDeafen, #sogChDeafen { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16 8.5a5 5 0 0 1 0 7'/><path d='M18.6 6a8.5 8.5 0 0 1 0 12'/></svg>"); }
#sogDeafen.on, #sogChDeafen.on { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16.5 9.5l5 5M21.5 9.5l-5 5'/></svg>"); }
#sogShare, #sogChShare { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='12.5' rx='2'/><path d='M9 20.5h6'/><path d='M12 17v3.5'/></svg>"); }
#sogCam, #sogChCam { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M8 7l1.3-2h5.4L16 7'/><rect x='3' y='7' width='18' height='13' rx='2.5'/><circle cx='12' cy='13.5' r='3.4'/></svg>"); }
#sogCam.on, #sogChCam.on { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M8 7l1.3-2h5.4L16 7'/><rect x='3' y='7' width='18' height='13' rx='2.5'/><circle cx='12' cy='13.5' r='3.4'/><path d='M4 4L20 20.5'/></svg>"); }
/* Hang-up: classic handset rotated 135° (the universal "end call" shape),
   same feather line-glyph family as the rest of the mini-card buttons.
   Scaled 0.88 about center so the rotated corners never clip the viewBox;
   stroke bumped to 2.0 so the post-scale weight (~1.76) matches the set's 1.8. */
#sogEnd, #sogChLeave { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(12 12) rotate(135) scale(0.88) translate(-12 -12)'><path d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/></g></svg>"); }
/* incoming-call card: Accept keeps its built-in phone SVG (suppress the
   mask so it never shows a blank square); Decline gets a clean line X. */
#sogInAccept::before { display: none; }
#sogInDecline { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 6.5l11 11'/><path d='M17.5 6.5l-11 11'/></svg>"); }

/* --- ＋ attach menu (data-act only): image / file / link.
   Scoped to [data-act] so the slash-command file list (data-i),
   which keeps its own emoji, is left untouched. --- */
.soc-filepop-item[data-act] > span:first-child {
    width: 20px; height: 20px; flex: none; display: inline-block;
    font-size: 0; background-color: currentColor;
    -webkit-mask: var(--fpic) center / 20px 20px no-repeat; mask: var(--fpic) center / 20px 20px no-repeat;
}
.soc-filepop-item[data-act="img"] > span:first-child { --fpic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><circle cx='8.5' cy='10' r='1.7'/><path d='M4 17l4.5-4.5 3.4 3.4 3-3L20 17.5'/></svg>"); }
.soc-filepop-item[data-act="file"] > span:first-child { --fpic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M14.8 7.2L8.6 13.4a2.6 2.6 0 0 0 3.7 3.7l5.6-5.6a4.3 4.3 0 0 0-6.1-6.1L6.3 9.6'/></svg>"); }
.soc-filepop-item[data-act="link"] > span:first-child { --fpic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M10 14l4-4'/><path d='M12 8l1.5-1.5a3.5 3.5 0 0 1 5 5L17 13'/><path d='M12 16l-1.5 1.5a3.5 3.5 0 0 1-5-5L7 11'/></svg>"); }

/* ============================================================
   COMMUNITY CENTER — icon set (part 2)
   Small action buttons, mute/deafen badges, and the slash-command
   file picker. Same silver line-glyph family, same CSS-mask trick.
   Icon-only elements only — emoji+label buttons are left as-is.
   ============================================================ */

/* --- icon-only action buttons: kebab / message / settings / volume --- */
#socActMenu, .soc-chan-mgmt, .soc-p-more,
.soc-mini[data-dm], #socUpSettings { position: relative; font-size: 0; }
/* Voice-card corner buttons must stay absolutely positioned in the card's
   corners (see the .soc-vc-vol / .soc-vc-menu rules above). They were being
   pulled back into the flex column by the 'position: relative' above, so here
   we only keep the font-size:0 the icon mask needs — NOT the position. */
.soc-vc-menu, .soc-vc-vol { font-size: 0; }
#socActMenu::before, .soc-chan-mgmt::before, .soc-vc-menu::before, .soc-p-more::before,
.soc-mini[data-dm]::before, #socUpSettings::before, .soc-vc-vol::before {
    content: ''; position: absolute; inset: 0; margin: auto;
    width: 18px; height: 18px; background-color: currentColor;
    -webkit-mask: var(--ic) center / 18px 18px no-repeat; mask: var(--ic) center / 18px 18px no-repeat;
    pointer-events: none;
}
#socActMenu, .soc-chan-mgmt, .soc-vc-menu, .soc-p-more { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='6' r='1.7' fill='%23000'/><circle cx='12' cy='12' r='1.7' fill='%23000'/><circle cx='12' cy='18' r='1.7' fill='%23000'/></svg>"); }
.soc-mini[data-dm] { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M5 5h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9l-4 3.5V16H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z'/></svg>"); }
#socUpSettings { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/></svg>"); }
.soc-vc-vol { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16 8.5a5 5 0 0 1 0 7'/><path d='M18.6 6a8.5 8.5 0 0 1 0 12'/></svg>"); }

/* v55: Member ⋯ hidden until row hover — cleaner list */
.soc-p-more { opacity: 0; transition: opacity .15s ease; border-radius: 5px; }
.soc-person:hover .soc-p-more, .soc-person:focus-within .soc-p-more { opacity: 1; }
.soc-p-more:hover { background: rgba(255,255,255,.12) !important; color: #fff !important; }
/* v55: Channel/category section buttons — smaller, more subtle */
#socLeft .soc-sec-actions .soc-mini, #socLeft .soc-mini-edit {
    width: 18px; height: 18px; min-width: 18px; min-height: 18px;
    /* item 11l: 10px glyph → 14px (buttons stay 18px) — +/▾/⚙ were too small */
    font-size: 14px; color: rgba(230,234,238,.5);
    transition: color .12s, background .12s, transform .12s;
}
#socLeft .soc-sec-actions .soc-mini:hover, #socLeft .soc-mini-edit:hover {
    color: var(--accent, #4cc2ff); background: rgba(76,194,255,.10);
}

/* --- mute / deafen badges on user cards + the left-drawer voice list --- */
.soc-vc-mute, .soc-vuser-mute { font-size: 0; }
.soc-vc-mute .mic-muted, .soc-vuser-mute .mic-muted { display: none; }
.soc-vc-mute::before, .soc-vuser-mute::before {
    content: ''; width: 13px; height: 13px; background-color: #f23f43;
    -webkit-mask: var(--bic) center / 13px 13px no-repeat; mask: var(--bic) center / 13px 13px no-repeat;
}
.soc-vc-mute, .soc-vuser-mute { --bic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='9.5' y='3' width='5' height='11' rx='2.5'/><path d='M6.5 11a5.5 5.5 0 0 0 11 0'/><path d='M12 16.5V20'/><path d='M9 20h6'/><path d='M4 3.5L20 20.5'/></svg>"); }
.soc-vc-mute.soc-vc-deaf, .soc-vuser-mute.soc-vuser-deaf { --bic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16.5 9.5l5 5M21.5 9.5l-5 5'/></svg>"); }

/* --- slash-command file picker icons (v48): handled by the .soc-filepop-thwrap
   and .soc-filepop-ic rules above — per-file-kind icon, in-flow thumbnail. --- */

/* --- Part 3: per-user "\u22EF" option menu (.soc-pmenu) \u2014 silver line icons --- */
.soc-pmenu-item > span {
    width: 18px; height: 16px; flex: none;
    font-size: 0; line-height: 0;
    background-color: currentColor;
    --pmi: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 6.5l11 11'/><path d='M17.5 6.5l-11 11'/></svg>");
    -webkit-mask: var(--pmi) center / 16px 16px no-repeat; mask: var(--pmi) center / 16px 16px no-repeat;
}
.soc-pmenu-item[data-ic="msg"] > span { --pmi: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M5 5h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9l-4 3.5V16H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z'/></svg>"); }
.soc-pmenu-item[data-ic="call"] > span { --pmi: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6.6 4h2.6l1.4 4.1-2 1.5a11.6 11.6 0 0 0 5.3 5.3l1.5-2 4.1 1.4v2.6a2 2 0 0 1-2.2 2A16 16 0 0 1 4.6 6.2 2 2 0 0 1 6.6 4z'/></svg>"); }
.soc-pmenu-item[data-ic="add"] > span { --pmi: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 5.5v13'/><path d='M5.5 12h13'/></svg>"); }
.soc-pmenu-item[data-ic="block"] > span { --pmi: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='8'/><path d='M6.5 6.5l11 11'/></svg>"); }
.soc-pmenu-item[data-ic="ok"] > span { --pmi: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>"); }
.soc-pmenu-item[data-ic="x"] > span { --pmi: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 6.5l11 11'/><path d='M17.5 6.5l-11 11'/></svg>"); }
.soc-pmenu-item.call span { filter: none; }

/* ============================================================
   CHANNEL MENUS (polished) — create / manage / invite dialogs.
   Crafted header, segmented controls, section cards, batch-invite
   list with friend/online/invited tags. Same tokens as the rest
   of the Community Center.
   ============================================================ */

/* --- crafted dialog header: icon tile + title + subtitle --- */
.soc-ch-create-head {
    display: flex; align-items: center; gap: 11px;
    padding-bottom: 12px; margin-bottom: 12px;
    border-bottom: 1px solid var(--win-border-2, rgba(255,255,255,.14));
}
.soc-ch-create-ic {
    flex: none; width: 40px; height: 40px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; color: #08202e;
    background: linear-gradient(145deg, var(--accent, #4cc2ff), rgba(76,194,255,.55));
    box-shadow: 0 3px 12px rgba(76,194,255,.28);
}
.soc-ch-create-title { font-size: 15.5px; font-weight: 650; line-height: 1.25; }
.soc-ch-create-sub { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 2px; line-height: 1.35; }

/* --- segmented control (Type / Access) — replaces raw <select>s --- */
.soc-seg {
    display: flex; gap: 3px; padding: 3px; margin-bottom: 6px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 10px;
}
.soc-seg-b {
    flex: 1; padding: 6px 8px; font-size: 12.5px; cursor: pointer;
    background: transparent; border: none; border-radius: 7px;
    color: inherit; transition: background .13s, color .13s;
}
.soc-seg-b:hover { background: rgba(255,255,255,.09); }
/* v50: inline lock glyph inside the segmented Access buttons */
.soc-seg-b .soc-seg-ic { display: inline-flex; align-items: center; vertical-align: -1.5px; margin-right: 5px; }
.soc-seg-b .soc-seg-ic .hi { width: 12px; height: 12px; }
.soc-seg-b.on .soc-seg-ic .hi { color: #08202e; }
.soc-seg-b.on {
    background: var(--accent, #4cc2ff); color: #08202e; font-weight: 600;
    box-shadow: 0 2px 8px rgba(76,194,255,.3);
}
/* contextual hint under an Access segmented control */
.soc-ch-sub { font-size: 11.5px; color: rgba(255,255,255,.5); margin: 2px 1px 10px; line-height: 1.4; }

/* --- manage modal: section cards --- */
.soc-mgmt-sec {
    padding: 11px 12px; margin-bottom: 10px;
    background: rgba(255,255,255,.035);
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 11px;
}
.soc-mgmt-sec-head {
    font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
    color: rgba(255,255,255,.62); margin-bottom: 8px;
}
/* tiny "optional" pill inside a section head (e.g. invite list in the create dialog) */
.soc-mgmt-sec-opt {
    margin-left: 7px; font-size: 8.5px; font-weight: 600; letter-spacing: .06em;
    color: rgba(255,255,255,.45); background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.16); border-radius: 20px; padding: 1px 7px;
    vertical-align: 1px; text-transform: uppercase;
}
.soc-mgmt-sec.danger { border-color: rgba(232,17,35,.4); background: rgba(232,17,35,.05); }
.soc-mgmt-sec.danger .soc-mgmt-sec-head { color: #ff8f9d; }
.soc-mgmt-sec .soc-ch-sub { margin-bottom: 0; }
.soc-mgmt-sec .soc-inv-send { margin-top: 9px; }

/* rename: input + button on one row */
.soc-rename-row { display: flex; gap: 8px; align-items: center; }
.soc-rename-row .soc-input { flex: 1; min-width: 0; }

/* --- batch-invite block --- */
.soc-inv-tools {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 9px; margin-bottom: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 9px;
}
.soc-inv-count { margin-left: auto; font-size: 11px; color: rgba(255,255,255,.55); }

.soc-inv-list {
    max-height: 185px; overflow-y: auto;
    border: 1px solid var(--win-border-2, rgba(255,255,255,.14));
    border-radius: 9px; padding: 3px;
    background: rgba(0,0,0,.18);
}
.soc-inv-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 7px; border-radius: 7px; cursor: pointer;
    transition: background .12s;
}
.soc-inv-row:hover { background: rgba(255,255,255,.06); }
.soc-inv-row.inv { background: rgba(76,194,255,.14); }
.soc-inv-row input { accent-color: var(--accent, #4cc2ff); width: 14px; height: 14px; flex: none; cursor: pointer; margin: 0; }
.soc-inv-row-name { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-inv-row-tags { margin-left: auto; display: flex; gap: 4px; flex: none; }
.soc-inv-row-tags .t {
    font-size: 9.5px; font-weight: 600; line-height: 1.5;
    padding: 0 6px; border-radius: 20px;
    border: 1px solid transparent;
}
.soc-inv-row-tags .t.friend { color: #43bf94; background: rgba(67,191,148,.12); border-color: rgba(67,191,148,.35); }
.soc-inv-row-tags .t.on     { color: #7ee2a8; background: rgba(35,165,90,.12); border-color: rgba(35,165,90,.35); }
.soc-inv-row-tags .t.off    { color: rgba(255,255,255,.42); background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.16); }
.soc-inv-row-tags .t.inv    { color: #08202e; background: var(--accent, #4cc2ff); border-color: var(--accent, #4cc2ff); }

.soc-inv-send { display: flex; justify-content: flex-end; margin-top: 9px; }

/* invite list scrolls nicely on small screens */
@media (max-width: 480px) {
    .soc-inv-list { max-height: 150px; }
    .soc-inv-row-tags .t.off { display: none; } /* keep rows tight on phones */
}

/* ============ channel ⋯ manage button: 50% size, bare dots, no box ============ */
.soc-chan-mgmt {
    width: 12px;
    height: 12px;
    font-size: 0;
    background: transparent;
    border-radius: 50%;
    flex: none;
}
.soc-chan-mgmt:hover { background: transparent; color: var(--accent, #4cc2ff); }
.soc-chan-mgmt::before {
    width: 9px;
    height: 9px;
    -webkit-mask: var(--ic) center / 9px 9px no-repeat;
    mask: var(--ic) center / 9px 9px no-repeat;
}

/* ============ mobile: keep category "+" clear of the drawer close button ============ */
@media (max-width: 768px) {
    #socLeft .soc-sec:first-child .soc-mini { margin-right: 48px; }
}
/* ================= MEMBER STRIP (thin band under header) ================= */
.soc-memberstrip {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(0,0,0,.22);
    border-bottom: 1px solid rgba(255,255,255,.08);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(76,194,255,.4) transparent;
    max-height: 44px;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}
.soc-memberstrip::-webkit-scrollbar { height: 5px; }
.soc-memberstrip::-webkit-scrollbar-thumb { background: rgba(76,194,255,.35); border-radius: 3px; }
.soc-memberstrip::-webkit-scrollbar-track { background: transparent; }
.soc-memberstrip .ms-item {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px 2px 3px;
    border-radius: 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    transition: background .15s ease, border-color .15s ease;
}
.soc-memberstrip .ms-item:hover {
    background: rgba(76,194,255,.10);
    border-color: rgba(76,194,255,.35);
}
.soc-memberstrip .ms-item .soc-av-sm {
    width: 20px;
    height: 20px;
    font-size: 10px;
}
.soc-memberstrip .ms-name {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,.78);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-memberstrip .ms-x {
    display: none;
    flex: none;
    width: 15px;
    height: 15px;
    padding: 0;
    line-height: 1;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 9px;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, color .12s ease;
}
.soc-memberstrip .ms-item.ms-kickable:hover .ms-x {
    display: inline-flex;
}
.soc-memberstrip .ms-x:hover {
    background: #e81123;
    color: #fff;
}
@media (max-width: 768px) {
    .soc-memberstrip .ms-item.ms-kickable .ms-x {
        display: inline-flex;
    }
}

/* ============ INLINE FRIEND-REQUEST ACCEPT / DECLINE BADGES ============ */
.soc-req-act {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
.soc-req-act .soc-mini {
    width: 17px;
    height: 17px;
    border-radius: 9px;
    font-size: 9px;
    margin: 0;
    padding: 0;
}
.soc-req-act .soc-req-acc {
    background: rgba(67,191,148,.15);
    color: #43bf94;
}
.soc-req-act .soc-req-acc:hover { background: #43bf94; color: #08202e; }
.soc-req-act .soc-req-dec {
    background: rgba(232,17,35,.14);
    color: #ff7581;
}
.soc-req-act .soc-req-dec:hover { background: #e81123; color: #fff; }

.soc-inv-revoke-hint { margin: 8px 2px 0; font-size: 11px; color: rgba(255,255,255,.45); }

/* ============ CRAFTED DM NOTIFICATION (themed, minimal) ============ */
#socNotifHost {
    position: fixed;
    bottom: 66px;
    right: 18px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
}
.soc-notif {
    pointer-events: auto;
    width: 320px;
    max-width: calc(100vw - 36px);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    border-left: 3px solid var(--accent, #4cc2ff);
    background: linear-gradient(180deg, rgba(31,31,35,.97), rgba(24,24,28,.97));
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 40px rgba(0,0,0,.55);
    cursor: pointer;
    animation: socNotifIn .28s cubic-bezier(.2,.9,.3,1.18);
    transition: opacity .24s ease, transform .24s ease;
}
@keyframes socNotifIn {
    from { opacity: 0; transform: translateX(26px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.soc-notif-out { opacity: 0; transform: translateX(26px) scale(.98); }
.soc-notif-av {
    flex: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.soc-notif-av .soc-av { width: 100%; height: 100%; border-radius: 50%; }
.soc-notif-av .soc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-notif-av .soc-av-init { font-size: 16px; font-weight: 700; }
.soc-notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.soc-notif-name { font-size: 12.5px; font-weight: 700; color: var(--win-text, #fff); letter-spacing: .2px; }
.soc-notif-msg {
    font-size: 11.5px; color: var(--win-text-2, #cfcfcf);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92;
}
.soc-notif-reply {
    flex: none;
    padding: 6px 13px;
    border: 1px solid rgba(76,194,255,.35);
    background: rgba(76,194,255,.12);
    color: var(--accent, #4cc2ff);
    font-size: 11.5px; font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, color .12s, transform .1s;
}
.soc-notif-reply:hover { background: var(--accent, #4cc2ff); color: #06202f; }
.soc-notif-reply:active { transform: scale(.96); }
.soc-notif-x {
    flex: none;
    width: 22px; height: 22px;
    border: none; background: transparent;
    color: var(--win-text-2, #cfcfcf);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.soc-notif-x:hover { background: rgba(255,255,255,.10); color: #fff; }

@media (max-width: 768px) {
    #socNotifHost {
        top: 12px; bottom: auto;
        left: 12px; right: 12px;
        max-width: none;
        align-items: stretch;
        gap: 8px;
    }
    .soc-notif { width: auto; padding: 9px 11px; gap: 10px; }
    @keyframes socNotifIn {
        from { opacity: 0; transform: translateY(-18px) scale(.99); }
        to   { opacity: 1; transform: none; }
    }
    .soc-notif-out { opacity: 0; transform: translateY(-18px) scale(.99); }
    .soc-notif-av { width: 34px; height: 34px; }
    .soc-notif-reply { padding: 6px 11px; }
}

/* ---- per-sound rows in the settings modal (on/off + level + ▶ preview) ---- */
.soc-snd-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
}
.soc-snd-on {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}
.soc-snd-on input { accent-color: #4cc2ff; cursor: pointer; flex: none; }
.soc-snd-row input[type="range"] {
    flex: 0 1 130px;
    min-width: 70px;
    accent-color: #4cc2ff;
    cursor: pointer;
}
.soc-snd-play {
    flex: 0 0 auto;
    min-width: 30px;
    padding: 3px 9px;
    font-size: 11px;
    line-height: 1.4;
}
@media (max-width: 640px) {
    .soc-snd-row { flex-wrap: wrap; gap: 6px; }
    .soc-snd-on { flex-basis: 100%; }
    .soc-snd-row input[type="range"] { flex: 1 1 auto; }
}

/* ---------------- mic settings: "!" hover explainer + monitor button ---------------- */
.soc-q {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; flex: none; margin-left: 2px;
    border-radius: 50%;
    border: 1px solid rgba(76,194,255,.6);
    color: #4cc2ff;
    font-size: 10px; font-weight: 700; font-style: normal; line-height: 1;
    cursor: help; position: relative; user-select: none;
}
.soc-q::after {
    content: attr(data-tip);
    position: absolute; left: -6px; top: calc(100% + 8px);
    width: 215px; white-space: normal; text-align: left;
    background: rgba(15,17,23,.97); color: #c9d4e3;
    border: 1px solid rgba(76,194,255,.35); border-radius: 8px;
    padding: 8px 10px; font-size: 11px; font-weight: 400;
    text-transform: none; letter-spacing: 0;
    box-shadow: 0 10px 26px rgba(0,0,0,.55);
    opacity: 0; visibility: hidden; transform: translateY(-3px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    z-index: 40; pointer-events: none;
}
.soc-q::before {
    content: '';
    position: absolute; left: 2px; top: calc(100% + 2px);
    border: 5px solid transparent; border-bottom-color: rgba(76,194,255,.35);
    opacity: 0; visibility: hidden;
    transition: opacity .15s ease, visibility .15s;
    z-index: 40; pointer-events: none;
}
.soc-q:hover::after, .soc-q:hover::before { opacity: 1; visibility: visible; transform: none; }
.soc-monbtn { margin-top: 8px; }
.soc-monbtn.soc-mon-on {
    background: rgba(76,194,255,.16);
    border-color: rgba(76,194,255,.8);
    color: #7ed8ff;
    box-shadow: 0 0 0 1px rgba(76,194,255,.25), 0 0 14px rgba(76,194,255,.18);
}
.soc-monbtn.soc-mon-on:hover { background: rgba(76,194,255,.24); }

/* Mobile: hide desktop-only elements (PTT helper, Desktop Mode button) */
@media (max-width: 768px) {
    .soc-desktop-only { display: none !important; }
}

/* ============ DISCORD-LIKE SERVER RAIL (Phase 2) ============ */
.soc-rail {
    flex: none;
    width: 72px;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    background: #161616;
    border-right: 1px solid var(--win-border, rgba(255,255,255,.08));
    overflow-y: auto;
    overflow-x: hidden;
    /* Rail scrolling, made explicit: PC = wheel + middle-click drag · phone =
       vertical touch-drag. overscroll-behavior: none stops the rubber-band
       bounce at the edges (plain clamping now); touch-action: pan-y gives the
       rail native vertical touch-pan on phones (the swipe system already bails
       on vertical-dominant gestures, so drawer swipes are unaffected). */
    overscroll-behavior: none;
    touch-action: pan-y;
    scrollbar-width: none; /* Firefox: hide the scrollbar (standard property) */
}
/* No visible scrollbar on the rail (user preference) — it still scrolls.
   display:none is the reliable switch in Chromium overlay-scrollbar mode.
   Scoped under #socialPage so the specificity beats the broad
   `#socialPage * { scrollbar-width: thin }` and `#socialPage ::-webkit-scrollbar`
   rules later in the file (same fix for Firefox's scrollbar-width). */
#socialPage .soc-rail { scrollbar-width: none; }
#socialPage .soc-rail::-webkit-scrollbar { display: none; width: 0; height: 0; }
.soc-rail-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.soc-rail-icon {
    position: relative;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: #2b2d31;
    color: #dbdee1;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: visible;
    padding: 0;
    transition: border-radius .18s ease, background .18s ease, color .18s ease;
}
.soc-rail-face {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; border-radius: inherit;
}
.soc-rail-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-rail-icon:hover { border-radius: 16px; background: #3a3d42; }
.soc-rail-icon.on {
    border-radius: 16px;
    background: var(--accent, #4cc2ff);
    color: #0b1220;
}
/* Active icon stays solid + readable even while hovered (no dark-on-dark, no glow). */
.soc-rail-icon.on:hover { background: var(--accent, #4cc2ff); color: #0b1220; }
.soc-rail-icon::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    width: 4px;
    height: 34px;
    border-radius: 0 3px 3px 0;
    background: #fff;
    transform: translateY(-50%) scaleY(0);
    transform-origin: center;
    transition: transform .18s ease;
}
.soc-rail-icon:hover::before,
.soc-rail-icon.on::before { transform: translateY(-50%) scaleY(1); }
.soc-rail-add {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: #2b2d31;
    color: #23a55a;
    font-size: 32px; /* item 11l: plus glyph was too small inside the 48px button */
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: border-radius .18s ease, background .18s ease, color .18s ease;
}
.soc-rail-add:hover { border-radius: 16px; background: #23a55a; color: #fff; }
.soc-rail-compass {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: #2b2d31;
    color: #57f287;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
    transition: border-radius .18s ease, background .18s ease, color .18s ease;
}
.soc-rail-compass:hover { border-radius: 16px; background: #57f287; color: #0b1220; }
.soc-rail-dl {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: #2b2d31;
    color: #9aa0a6;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
    transition: border-radius .18s ease, background .18s ease, color .18s ease;
}
.soc-rail-dl:hover { border-radius: 16px; background: #3a3d42; color: var(--accent, #4cc2ff); }
.soc-rail-vlan {
    flex: none;
    width: 48px; height: 48px;
    border-radius: 24px; border: none;
    background: #2b2d31; color: var(--accent, #4cc2ff);
    font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; margin-top: 4px;
    transition: border-radius .18s ease, background .18s ease, color .18s ease;
}
.soc-rail-vlan svg { opacity: .92; }
.soc-rail-vlan:hover { border-radius: 16px; background: rgba(76,194,255,.16); color: #fff; }
/* VLAN button: network-tree icon + a readable "LAN" caption so nobody
   mistakes it for a share button. */
.soc-rail-vlan { flex-direction: column; gap: 0; }
.soc-rail-vlanwrap { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.soc-rail-vlantxt { font-size: 8px; font-weight: 800; letter-spacing: .14em; opacity: .95; margin-top: 2px; line-height: 1; }
/* Quick-jump buttons above the VLAN icon: Games + Files. Files has a
   hover (desktop) / hold (touch) flyout to Image / Music / Video / Note. */
.soc-rail-quick {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: #2b2d31;
    color: #9aa0a6;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
    transition: border-radius .18s ease, background .18s ease, color .18s ease, transform .12s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.soc-rail-quick svg { width: 22px; height: 22px; opacity: .92; flex: none; }
.soc-rail-quick:hover { border-radius: 16px; background: #3a3d42; color: var(--accent, #4cc2ff); }
.soc-rail-quick.on { border-radius: 16px; background: var(--accent, #4cc2ff); color: #0b1220; }
.soc-rail-quick.on:hover { background: var(--accent, #4cc2ff); color: #0b1220; }
.soc-rail-quick.on svg { opacity: 1; }
/* Chess icon is a white PNG (the rail is dark) — renders a touch bigger
   than the other rail icons. Slightly dimmed at rest, full white when
   hovered or active (on the blue background). */
.soc-rail-quick.soc-rail-games img { width: 27px; height: 27px; display: block; opacity: .92; }
.soc-rail-quick.soc-rail-games:hover img,
.soc-rail-quick.soc-rail-games.on img { opacity: 1; }
/* touch-action: none keeps quick-taps from scrolling the rail drawer */
.soc-rail-filesbtn { touch-action: none; }
/* Files flyout: fixed panel on <body> (the rail scrolls / transforms, both
   would clip an in-rail popover). Hidden + off-screen until opened. */
.soc-rail-filesfly {
    position: fixed;
    left: -9999px; top: 0;
    /* Must sit ABOVE #desktop-shell (z900) and mobile #socialPage (z300) —
       the flyout is a body-level sibling of the shell; below either it is
       invisible. Stays below app modals/sheets (z4000+). */
    z-index: 1200;
    min-width: 132px;
    background: #1f2127;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 14px 44px rgba(0,0,0,.55);
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(.95);
    transform-origin: left center;
    transition: opacity .14s ease, transform .14s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.soc-rail-filesfly.fly-open { opacity: 1; visibility: visible; pointer-events: auto; transform: scale(1); }
.soc-rail-flyitem {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #dbdee1;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background .12s ease, transform .12s ease, color .12s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.soc-rail-flyitem:hover,
.soc-rail-flyitem.targeted { background: rgba(76,194,255,.14); color: #fff; }
.soc-rail-flyitem.targeted { transform: scale(1.06); }
.soc-rail-flyic { display: inline-flex; flex: none; color: var(--accent, #4cc2ff); }

/* Virtual LAN modal pieces */
.soc-vlan-status {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px; margin-bottom: 14px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; font-size: 13px; color: rgba(230,234,238,.9);
}
.soc-vlan-dot {
    width: 10px; height: 10px; border-radius: 50%; flex: none;
    background: #80848e; box-shadow: 0 0 0 3px rgba(128,132,142,.18);
    transition: background .18s ease, box-shadow .18s ease;
}
.soc-vlan-dot.on { background: #23a55a; box-shadow: 0 0 0 3px rgba(35,165,90,.22); }
/* ON/OFF toggle switch (per-server VLAN) */
.soc-vlan-toggle {
    width: 46px; height: 25px; border-radius: 13px; flex: none;
    background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16);
    position: relative; cursor: pointer; padding: 0;
    transition: background .16s ease, border-color .16s ease;
}
.soc-vlan-toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 19px; height: 19px; border-radius: 50%;
    background: #cfd3da; transition: left .16s ease, background .16s ease;
}
.soc-vlan-toggle.on {
    background: rgba(35,165,90,.85); border-color: rgba(35,165,90,.9);
}
.soc-vlan-toggle.on::after { left: 23px; background: #fff; }
.soc-vlan-toggle:hover:not(:disabled) { border-color: rgba(255,255,255,.35); }
.soc-vlan-toggle:disabled { cursor: not-allowed; }
.soc-vlan-row-dim { opacity: .55; }
.soc-vlan-net { margin-left: auto; font-size: 11.5px; opacity: .6; font-family: ui-monospace, monospace; }
.soc-vlan-sec {
    font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: rgba(255,255,255,.5); padding: 2px 2px 8px;
}
.soc-vlan-list { display: flex; flex-direction: column; gap: 6px; max-height: 36vh; overflow-y: auto; padding-right: 2px; margin-bottom: 6px; }
.soc-vlan-srv {
    display: flex; align-items: center; gap: 11px;
    width: 100%; padding: 9px 11px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03);
    color: #eef1f4; cursor: pointer; text-align: left; font: inherit; font-size: 14px;
    transition: background .14s ease, border-color .14s ease;
}
.soc-vlan-srv:hover { background: rgba(76,194,255,.10); }
.soc-vlan-srv.on { border-color: var(--accent, #4cc2ff); background: rgba(76,194,255,.14); }
.soc-vlan-face {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: rgba(76,194,255,.16); color: var(--accent, #4cc2ff); font-weight: 700; font-size: 13px;
    overflow: hidden;
}
.soc-vlan-face img { width: 100%; height: 100%; object-fit: cover; }
.soc-vlan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.soc-vlan-name em { font-style: normal; font-size: 11.5px; opacity: .6; font-weight: 500; }
.soc-vlan-empty { padding: 16px 6px; font-size: 13px; opacity: .65; line-height: 1.5; }
.soc-vlan-note { font-size: 12.5px; opacity: .8; line-height: 1.45; margin: 8px 0 4px; color: #f0b232; }
/* Muted-server indicator (top-left corner of the rail icon) */
.soc-rail-mutebadge {
    position: absolute; left: -2px; top: -2px;
    min-width: 20px; height: 20px; padding: 0 3px;
    border-radius: 50%;
    background: rgba(22,22,22,.94);
    border: 1.5px solid #f23f43;
    font-size: 10px; line-height: 18px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
/* Voice-presence badge (bottom-right corner of the rail icon) — clean speaker indicator */
.soc-rail-voicebadge {
    position: absolute; right: -3px; bottom: -3px;
    width: 22px; height: 22px; padding: 0;
    border-radius: 50%;
    background: #1a1b1e;
    border: 2px solid #e8ecf3;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
/* v58: accent + glow ONLY when I am in this server's voice myself. */
.soc-rail-voicebadge.me {
    border-color: var(--accent, #4cc2ff);
    box-shadow: 0 0 6px rgba(76,194,255,.35);
}
/* Static badge — no animation (would restart on every 15s re-render). */
.soc-rail-voicebadge svg {
    width: 12px; height: 12px;
    fill: #e8ecf3;
}
.soc-rail-voicebadge.me svg { fill: var(--accent, #4cc2ff); }
/* v58: screen-share indicator — stacked directly above the speaker badge.
   Same color logic: white unless I am the one sharing in this server. */
.soc-rail-sharebadge {
    position: absolute; right: -3px; bottom: 21px;
    width: 22px; height: 22px; padding: 0;
    border-radius: 50%;
    background: #1a1b1e;
    border: 2px solid #e8ecf3;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.soc-rail-sharebadge svg { width: 11px; height: 11px; fill: #e8ecf3; }
.soc-rail-sharebadge.me { border-color: var(--accent, #4cc2ff); box-shadow: 0 0 6px rgba(76,194,255,.35); }
.soc-rail-sharebadge.me svg { fill: var(--accent, #4cc2ff); }
.soc-rail-icon.soc-mut { opacity: .85; }
/* DM unread (red, Discord-style) */
.soc-badge.unread { background: #e81123; color: #fff; }
.soc-dm.unread .soc-dm-name { color: #fff; font-weight: 600; }
/* Home icon: total unread DMs pill */
.soc-rail-hb { position:absolute; right:-6px; bottom:-6px; z-index:2; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:#e81123; color:#fff; font-size:10px; font-weight:700; display:none; align-items:center; justify-content:center; box-shadow:0 0 0 2.5px #1e1f22; pointer-events:none; transform:scale(.5); transition:transform .18s ease; }
.soc-rail-hb.show { display:inline-flex; transform:scale(1); }
/* Per-server unread corner count */
.soc-rail-uc { position:absolute; right:-7px; bottom:-7px; z-index:2; box-shadow:0 0 0 2.5px #1e1f22; }
/* DM senders with unread — avatars at the top of the rail (under Home) */
.soc-rail-dmlist { display:flex; flex-direction:column; align-items:center; gap:10px; width:48px; }
.soc-rail-dm { position:relative; flex:none; width:48px; height:48px; padding:0; border:none; background:transparent; cursor:pointer; }
.soc-rail-dm .soc-av { width:48px; height:48px; border-radius:50%; transition:border-radius .18s ease; }
.soc-rail-dm:hover .soc-av { border-radius:16px; }
/* Folder (stack) pill + animated open/close — Discord-style 2x2 grid head */
.soc-rail-folder { position:relative; flex:none; display:flex; flex-direction:column; align-items:center; width:48px; }
.soc-rail-fold-head { position:relative; flex:none; width:48px; height:48px; border-radius:24px; border:none; background:#2b2d31; color:#cfd2d5; cursor:pointer; padding:0; display:flex; align-items:center; justify-content:center; transition:border-radius .18s ease, background .18s ease, box-shadow .18s ease, width .18s ease, height .18s ease; }
.soc-rail-fold-head .fold-grid { display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; gap:2px; width:33px; height:33px; position:relative; z-index:1; }
.soc-rail-fold-head .fold-grid img { width:100%; height:100%; object-fit:cover; border-radius:3px; border:1px solid #1e1f22; background:#1e1f22; display:block; }
.soc-rail-fold-head .fold-init { display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:#cfd2d5; background:#3a3d42; border-radius:3px; border:1px solid #1e1f22; }
.soc-rail-fold-head .fold-chev { position:absolute; right:0; bottom:0; width:16px; height:16px; padding:3px; box-sizing:border-box; fill:none; stroke:#cfd2d5; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; transition:transform .2s ease; z-index:2; background:#1e1f22; border-radius:50%; box-shadow:0 0 0 1.5px #2b2d31; }
.soc-rail-folder.open .fold-chev { transform:rotate(180deg); }
/* OPEN state: head collapses to a tiny folder tab — the grid hides, a folder
   glyph shows, and only the real servers remain visible below (Discord-style) */
.soc-rail-fold-head .fold-ic { display:none; fill:currentColor; position:relative; z-index:1; }
.soc-rail-folder.open .soc-rail-fold-head { width:34px; height:26px; border-radius:13px; margin-bottom:6px; }
.soc-rail-folder.open .fold-grid { display:none; }
.soc-rail-folder.open .fold-ic { display:block; width:15px; height:15px; }
.soc-rail-folder.open .soc-rail-fold-head .fold-chev { width:14px; height:14px; padding:2px; }
/* folder unread badge → top-right (clears the bottom-right chevron) */
.soc-rail-fold-head .soc-rail-uc { top:-6px; right:-6px; bottom:auto; }
.soc-rail-fold-head:hover { border-radius:16px; background:#3a3d42; }
.soc-rail-fold-body { display:grid; grid-template-rows:0fr; transition:grid-template-rows .22s ease; }
.soc-rail-folder.open .soc-rail-fold-body { grid-template-rows:1fr; }
.soc-rail-fold-inner { overflow:hidden; min-height:0; }
.soc-rail-fold-box { display:flex; flex-direction:column; align-items:center; gap:10px; padding:12px 0; margin:6px 3px 2px; background:#26272b; border-radius:18px; }
/* Folder hover tooltip (lists the member servers) */
.soc-fold-tip { position:fixed; z-index:1000; background:#111214; border:1px solid rgba(255,255,255,.08); border-radius:8px; padding:10px 12px; max-width:260px; box-shadow:0 8px 30px rgba(0,0,0,.55); pointer-events:none; opacity:0; transition:opacity .12s ease; font-size:13px; line-height:1.5; color:#e6e8ea; }
.soc-fold-tip.show { opacity:1; }
/* Drop slots (visible while dragging) */
.soc-rail-dz { flex:none; height:0; width:40px; overflow:hidden; display:flex; align-items:center; justify-content:center; transition:height .13s ease; pointer-events:none; }
.soc-rail-dz::before { content:''; width:28px; height:3px; border-radius:2px; background:var(--accent,#4cc2ff); opacity:0; transition:opacity .13s ease; }
#socRail.dragging .soc-rail-dz { height:12px; pointer-events:auto; }
.soc-rail-dz.hot { height:14px; }
.soc-rail-dz.hot::before { opacity:1; }
/* Drag source / drop target highlights / land pop */
.soc-rail-icon.soc-drag-src, .soc-rail-fold-head.soc-drag-src { opacity:.35; transform:scale(.92); }
.soc-rail-icon.hot, .soc-rail-fold-head.hot { box-shadow:0 0 0 2.5px var(--accent,#4cc2ff), 0 0 14px rgba(76,194,255,.5); }
@keyframes socRailLand { 0% { transform:scale(.7); } 60% { transform:scale(1.12); } 100% { transform:scale(1); } }
.soc-rail-icon.soc-landed { animation:socRailLand .28s ease; }
/* Rail add popout menu */
#railAddPopout {
    animation: socCtxIn .12s ease; transform-origin: left top;
    background: #1e1f22;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 30px rgba(0,0,0,.55);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rail-pop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    border: none;
    background: none;
    color: #dbdee1;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background .12s ease;
}
.rail-pop-item:hover { background: rgba(76,194,255,.12); color: #fff; }
.rail-pop-item .hi { flex: none; color: var(--accent, #4cc2ff); }
@media (max-width: 768px) {
    .soc-rail-compass { width: 44px; height: 44px; }
    .soc-rail-vlan { width: 44px; height: 44px; }
}
.soc-rail-sep {
    flex: none;
    width: 34px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255,255,255,.12);
}
.soc-rail-home { color: #9aa0a6; }
.soc-rail-home:hover { color: #e6e8ea; background: #3a3d42; }
.soc-rail-home.on { color: #0b1220; }
.soc-rail-home .hi { width: 22px; height: 22px; }

/* ============ MOBILE: server rail is a slide-in drawer ============
   A persistent 58px strip pushed the whole app to the right, so on phones we
   make the rail an off-canvas drawer (opened via the header "servers" button).
   When closed, #soc-main is full-width and centered. Same DOM/handlers as
   desktop — only the layout differs. The channel & people panels are separate
   drawers layered above it. */
@media (max-width: 768px) {
    .soc-rail {
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: 96px;
        z-index: 70;
        background: #161616;
        border-right: 1px solid var(--win-border, rgba(255,255,255,.10));
        transform: translateX(-103%);
        transition: transform .18s ease;
        box-shadow: none;
        padding: 10px 0 16px;
    }
    #socialPage.soc-rail-open .soc-rail {
        transform: none;
        box-shadow: 12px 0 40px rgba(0,0,0,.55);
    }
    .soc-rail-x {
        position: absolute; top: 6px; right: 6px;
        width: 30px; height: 30px; border-radius: 8px; border: none;
        background: transparent; color: var(--win-text-2, #cfcfcf);
        font-size: 15px; cursor: pointer; line-height: 1;
    }
    .soc-rail-x:active { background: rgba(255,255,255,.10); }
    .soc-rail-icon, .soc-rail-add, .soc-rail-home, .soc-rail-compass, .soc-rail-dl, .soc-rail-vlan, .soc-rail-quick { width: 52px; height: 52px; }
    /* BETA badge + invite code live in the rail on mobile (under the download
       button) — sized to fit the 96px rail. Hidden on desktop via .soc-mob-only;
       the desktop header stack is hidden at the end of this file. */
    .soc-rail-meta {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
        padding: 2px 4px 0;
    }
    .soc-rail-meta .soc-rail-beta { margin-left: 0; flex: none; font-size: 9px; padding: 2px 8px; }
    .soc-rail-meta .soc-rail-inv {
        max-width: 88px;
        box-sizing: border-box;
        padding: 2px 6px;
        font-size: 9px;
        gap: 3px;
        justify-content: center;
    }
    .soc-rail-meta .soc-rail-inv b { font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
    .soc-rail-icon::before { left: -8px; width: 3px; height: 30px; }
    .soc-rail-sep { width: 40px; margin: 6px auto; }
    .soc-rail-hint { min-width: 34px; min-height: 34px; }
    /* Hide the stray servers-drawer close X (swipe / backdrop closes it) */
    .soc-rail-x { display: none !important; }
    /* Stacked 2-drawer view: channels sit to the right of the servers strip */
    #socialPage.soc-rail-open.soc-left-open .soc-left { left: 96px; width: min(54vw, 224px); }
    /* Voice/user bar expands OVER the servers rail when stacked open —
       mirrors the PC layout, where the user bar stretches under the rail.
       The drawer (z65) must paint above the rail (z70) + tap-catcher (z64);
       safe because the left/right drawers are mutually exclusive. */
    #socialPage.soc-rail-open.soc-left-open .soc-left { z-index: 75; }
    #socialPage.soc-rail-open.soc-left-open .soc-userpanel {
        margin-left: -96px;
        width: calc(100% + 96px);
        /* border-box: the panel has horizontal padding — without this it
           rendered ~20px wider than rail+drawer and overshot the drawer edge. */
        box-sizing: border-box;
    }
    /* Keep the rail's bottom controls (download / BETA / invite) reachable
       above the stretched bar — same trick as the PC padding-bottom. */
    #socialPage.soc-rail-open.soc-left-open .soc-rail {
        padding-bottom: calc(var(--soc-up-h, 120px) + 14px);
    }
    /* Rail-only (drawer closed) while in a voice channel / call: the compact
       mobile voice bar overlays the rail's bottom — reserve its live height
       (--soc-mv-h, set in renderMobVoice) so the last rail icons always
       scroll clear of the bar. */
    #socialPage.soc-rail-open:not(.soc-left-open).soc-invoice .soc-rail {
        padding-bottom: calc(var(--soc-mv-h, 56px) + 14px);
    }
    /* Rail open, drawer closed: the mobile voice bar is the visible bar —
       lift it above the rail + tap-catcher so it reads as expanded over the
       rail, and taps on it act on the bar instead of closing the rail. */
    #socialPage.soc-rail-open:not(.soc-left-open) .soc-mobvoice {
        position: relative;
        z-index: 75;
    }
    /* Channels-drawer control buttons: compact (they were 36px on mobile) */
    #socLeft .soc-sec .soc-mini,
    #socLeft .soc-sec-actions .soc-mini,
    #socLeft .soc-mini,
    #socLeft .soc-mini-edit,
    #socLeft .soc-cat-mv,
    #socLeft .soc-cat-col,
    #socLeft #socAddDm {
        width: 22px; height: 22px; min-width: 22px; min-height: 22px;
        font-size: 12px; line-height: 1;
    }
}
/* Edit mode: ▲ / ▼ move buttons. v57: shown at EVERY size while in edit
   mode — desktop gets a precise drag-free alternative (drag stays available
   for power users), touch keeps its primary reorder control. */
.soc-move { display: none; }
.soc-edit-mode .soc-move {
    display: inline-flex; align-items: center; gap: 2px; flex: none;
}
.soc-move .soc-mini {
    width: 24px; height: 24px; min-width: 24px; font-size: 10px; line-height: 1;
    color: var(--accent, #4cc2ff);
}
@media (max-width: 768px) {
    .soc-move .soc-mini { width: 28px; height: 28px; font-size: 11px; }
}

/* ── In-app screen-share picker (Electron desktop app) ───────── */
.soc-sp { display: flex; flex-direction: column; gap: 12px; }
.soc-sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.soc-sp-head h3 { margin: 0; font-size: 17px; font-weight: 600; color: #f2f3f5; }
.soc-sp-x {
    flex: none; width: 30px; height: 30px; border-radius: 8px; border: none;
    background: transparent; color: #949ba4; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease;
}
.soc-sp-x:hover { background: rgba(79,84,92,.5); color: #f2f3f5; }
.soc-sp-audio {
    display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px;
    background: #1e1f22; color: #dbdee1; font-size: 13.5px; cursor: pointer; user-select: none;
}
.soc-sp-audio input { width: 16px; height: 16px; accent-color: #5865F2; cursor: pointer; margin: 0; }
.soc-sp-sec {
    font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #949ba4; margin: 3px 0 -3px;
}
.soc-sp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.soc-sp-item {
    display: flex; flex-direction: column; padding: 0; border: 2px solid transparent;
    border-radius: 11px; background: #1e1f22; overflow: hidden; cursor: pointer; text-align: left;
    transition: border-color .15s ease, background .15s ease;
}
.soc-sp-item:hover { border-color: #5865F2; background: #2b2d31; }
.soc-sp-item img,
.soc-sp-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #111214; }
.soc-sp-ph { display: flex; align-items: center; justify-content: center; font-size: 28px; }
.soc-sp-name { padding: 7px 11px; font-size: 12.5px; color: #dbdee1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   v50 — Discord-style HOME: DM list on the left, Friends panel
   in the middle, Active Now / Members on the right.
   ============================================================ */

/* Left panel (Home): the “Friends” / “More” nav rows above the DM list. v51:
   the rows are real <button>s (keyboard focusable) — reset native button chrome. */
.soc-home-navrow { padding: 6px 10px 2px; display: flex; flex-direction: column; }
.soc-home-navitem {
    display: flex; align-items: center; gap: 8px;
    margin: 2px 6px; padding: 7px 10px;
    border: 0; border-radius: 7px;
    font: inherit; font-size: 13.5px; font-weight: 600;
    color: var(--win-text-2, #cfcfcf);
    background: rgba(255,255,255,.03);
    text-align: left; width: calc(100% - 12px);
}
.soc-home-navitem:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 1px; }
.soc-home-navitem .hi { color: var(--accent, #4cc2ff); }
.soc-home-navitem.on { background: rgba(76,194,255,.12); color: #fff; }
.soc-home-navitem { cursor: pointer; transition: background .12s ease-out, color .12s ease-out; }
.soc-home-navitem:hover { background: rgba(76,194,255,.2); color: #fff; }

/* Middle (Home view): Discord-style Friends page — full width */
.soc-fpage { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.soc-fbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.02);
}
.soc-fbar-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: #fff; }
.soc-fbar-title .hi { color: var(--accent, #4cc2ff); }
.soc-fbar-tabs { display: flex; gap: 4px; flex: 1; min-width: 140px; justify-content: center; flex-wrap: wrap; }
.soc-ftab {
    border: none; background: transparent; cursor: pointer;
    color: var(--win-text-2, #cfcfcf); font-size: 12.5px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px;
    display: inline-flex; align-items: center; gap: 5px;
}
.soc-ftab:hover { color: #fff; background: rgba(255,255,255,.06); }
.soc-ftab.on { color: #fff; background: rgba(76,194,255,.14); }
.soc-ftab-n { font-size: 11px; opacity: .65; }
.soc-fadd { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.soc-fadd svg { flex: none; }
/* Mobile: fit Friends title + Online/All/Pending tabs + Add on ONE line —
   tighter paddings, and the Add Friend button becomes icon-only. */
@media (max-width: 768px) {
    .soc-fbar { padding: 8px 10px; gap: 8px; }
    .soc-fbar-title { font-size: 13px; gap: 6px; }
    .soc-fbar-tabs { min-width: 0; gap: 2px; flex-wrap: nowrap; }
    .soc-ftab { padding: 6px 8px; font-size: 11.5px; gap: 4px; white-space: nowrap; }
    .soc-ftab-n { font-size: 10.5px; }
    .soc-fadd span { display: none; }
}
/* Add-Friend inline row (revealed by the toolbar button) */
.soc-faddrow { display: flex; gap: 8px; padding: 10px 14px 0; }
.soc-faddrow.hidden-row { display: none; }
.soc-faddrow input {
    flex: 1; min-width: 0;
    background: rgba(0,0,0,.28); color: #fff;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    border-radius: 8px; padding: 9px 12px; font-size: 13px; outline: none;
}
.soc-faddrow input:focus { border-color: var(--accent, #4cc2ff); }
/* Full-width search (Discord-style) */
.soc-fsearchwrap { position: relative; margin: 10px 14px 2px; }
.soc-fsearch-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--win-text-3, #8b93a5); pointer-events: none; }
.soc-fsearchwrap input {
    width: 100%; box-sizing: border-box;
    background: rgba(0,0,0,.28); color: #fff;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    border-radius: 8px; padding: 8px 12px 8px 34px; font-size: 13px; outline: none;
}
.soc-fsearchwrap input:focus { border-color: var(--accent, #4cc2ff); }
/* List: scrolls under the fixed toolbar; rows a touch larger than right-panel rows */
.soc-flist { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px 16px; }
.soc-flist .soc-person { padding: 7px 10px; gap: 10px; margin: 1px 0; }
.soc-flist .soc-person .soc-av { width: 40px; height: 40px; }
.soc-flist .soc-p-name { font-size: 13.5px; }
.soc-flist .soc-p-sub { font-size: 11.5px; }
/* Row actions: appear on hover (mouse) — always visible on touch devices */
.soc-flist .soc-p-actions { opacity: 0; transition: opacity .12s ease-out; }
.soc-flist .soc-person:hover .soc-p-actions,
.soc-flist .soc-person:focus-within .soc-p-actions { opacity: 1; }
@media (hover: none) { .soc-flist .soc-p-actions { opacity: 1; } }
/* Accept / Decline / Unblock pill buttons (override the global mini-btn skin) */
.soc-flist .soc-mini-btn { font-weight: 600; }
.soc-req-acc { background: rgba(35,165,90,.22) !important; color: #7ee2a8 !important; border-color: rgba(35,165,90,.5) !important; box-shadow: none !important; }
.soc-req-acc:hover { background: rgba(35,165,90,.42) !important; color: #a5f0c5 !important; }
.soc-req-dec { background: rgba(242,63,67,.18) !important; color: #ff9ba0 !important; border-color: rgba(242,63,67,.45) !important; box-shadow: none !important; }
.soc-req-dec:hover { background: rgba(242,63,67,.38) !important; color: #ffc2c5 !important; }
.soc-req-unb { background: rgba(76,194,255,.16) !important; color: var(--accent, #4cc2ff) !important; border-color: rgba(76,194,255,.45) !important; box-shadow: none !important; }
.soc-req-unb:hover { background: rgba(76,194,255,.32) !important; color: #bfe6ff !important; }

/* “You” row in the Active Now panel (Home right panel) */
.soc-person.soc-you { background: rgba(76,194,255,.07); margin-bottom: 2px; }

/* Role tags on member rows (server right panel) */
.soc-role-tag {
    font-size: 9.5px; padding: 1px 6px; border-radius: 8px;
    background: rgba(255,255,255,.08); color: var(--win-text-2, #cfcfcf);
    text-transform: capitalize;
}
.soc-role-owner { background: rgba(255,209,102,.16); color: #ffd166; }
.soc-role-admin { background: rgba(255,92,108,.16); color: #ff8a95; }
.soc-role-mod { background: rgba(76,194,255,.16); color: var(--accent, #4cc2ff); }

/* Right-panel title (replaces the old Online/Friends tabs in the new modes) */
.soc-right-title {
    flex: 1; padding: 11px 14px 9px;
    font-size: 11px; font-weight: 700; letter-spacing: .6px;
    color: var(--win-text-2, #cfcfcf);
}

/* ===== Accessibility: respect "Reduce motion" (OS / browser setting) =====
   Purely additive. For users who turn off animation, collapse decorative
   motion to ~instant while keeping every element visible and state changes
   (color/opacity) intact. No logic or layout changes. */
@media (prefers-reduced-motion: reduce) {
    #socialPage *,
    #socialPage *::before,
    #socialPage *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Server Settings: member management (role change + kick) ===== */
/* v57: 5 columns — the ban button used to be a 5th grid child with no track,
   so it wrapped to its own row and rendered as a full-width native button
   (the "ugly white box with a red ⊘"). It now sits in its own 30px track. */
.soc-member-row {
    /* v59: the 138px role cell grew to 160px for the multi-role extra-roles button */
    display: grid; grid-template-columns: minmax(0,1fr) 96px 160px 30px 30px;
    align-items: center; gap: 9px;
    font-size: 14px; padding: 10px 8px; border-radius: 8px;
    transition: background .12s ease;
}
.soc-member-row:hover { background: rgba(255, 255, 255, .045); }
.soc-member-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.soc-you-tag { opacity: .5; font-size: 11px; font-weight: 400; }
.soc-member-row .soc-role-tag { justify-self: start; }
.soc-spacer { display: block; }
.soc-member-role {
    width: 100%; padding: 4px 8px; border-radius: 7px;
    background: rgba(255, 255, 255, .06); color: var(--win-text, #fff);
    border: 1px solid var(--win-border, rgba(255, 255, 255, .12));
    font-size: 12px; cursor: pointer; text-transform: capitalize;
    font-family: inherit;
    transition: border-color .12s ease, background .12s ease;
    /* v59: the native dropdown LIST used to render white with unreadable text on
       Windows — color-scheme dark + option colors fix the popup, and the custom
       chevron replaces the OS arrow so the closed control matches the app. */
    color-scheme: dark;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23949ba4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 10px;
    padding-right: 24px;
}
.soc-member-role option { background: #1a1b1e; color: #e8ecf3; }
.soc-member-role:hover { background: rgba(255, 255, 255, .1); }
.soc-member-role:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 1px; }
.soc-member-role:disabled { opacity: .6; cursor: default; }
.soc-member-kick {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px; background: transparent;
    color: var(--win-text-2, #cfcfcf); border: 1px solid transparent; cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.soc-member-kick:hover { background: rgba(232, 17, 35, .14); color: #ff8a95; border-color: rgba(232, 17, 35, .4); }
.soc-member-kick:active { transform: translateY(1px); }
.soc-member-kick:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 1px; }
.soc-member-kick:disabled { opacity: .5; cursor: default; }
.soc-member-kick:disabled:hover { background: transparent; color: var(--win-text-2, #cfcfcf); border-color: transparent; }
/* v57: ban button — same custom icon-button language as kick (it used to be
   an unstyled native button). Rests quiet, turns red on hover. */
.soc-member-ban {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px; background: transparent;
    color: var(--win-text-2, #cfcfcf); border: 1px solid transparent; cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.soc-member-ban:hover { background: rgba(232, 17, 35, .14); color: #ff8a95; border-color: rgba(232, 17, 35, .4); }
.soc-member-ban:active { transform: translateY(1px); }
.soc-member-ban:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 1px; }
.soc-member-ban:disabled { opacity: .5; cursor: default; }
.soc-member-ban:disabled:hover { background: transparent; color: var(--win-text-2, #cfcfcf); border-color: transparent; }

/* v59: multi-role cell — primary select + small extra-roles button side by side */
.soc-member-rolecell { display: flex; gap: 5px; align-items: center; min-width: 0; flex: 1; }
.soc-member-rolecell .soc-member-role { flex: 1; min-width: 0; }
.soc-member-extra {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 7px; padding: 0;
    background: rgba(255, 255, 255, .06); color: var(--win-text-2, #cfcfcf);
    border: 1px solid var(--win-border, rgba(255, 255, 255, .12));
    cursor: pointer; font-size: 11px; font-weight: 700; font-family: inherit;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.soc-member-extra:hover { background: rgba(255, 255, 255, .1); color: var(--win-text, #fff); border-color: rgba(255, 255, 255, .3); }
.soc-member-extra:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: 1px; }
.soc-member-extra-n { font-size: 10.5px; line-height: 1; }

/* v59: multi-role popover — every role one member holds, with remove buttons,
   plus an "add a role" row. Appended to <body> so it can overlay the Settings
   Shell (z 99990) and its modals (z 99995), under the desktop titlebar (99999). */
.soc-rolepop {
    position: fixed; z-index: 99997; width: 264px;
    background: var(--win-bg-2, #26272b); border: 1px solid var(--win-border-2, rgba(255,255,255,.16));
    border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.55);
    padding: 10px; font-size: 13px; color: var(--win-text, #fff);
    animation: socRolepopIn .13s ease-out;
}
@keyframes socRolepopIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.soc-rolepop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.soc-rolepop-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; min-width: 0; }
.soc-rolepop-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-rolepop-title .hi { flex: none; opacity: .6; }
.soc-rolepop-x {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border: 0; background: transparent; padding: 0;
    color: var(--win-text-2, #cfcfcf); border-radius: 6px; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.soc-rolepop-x:hover { background: rgba(255,255,255,.08); color: var(--win-text, #fff); }
.soc-rolepop-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.soc-rolepop-chip {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
    padding: 4px 5px 4px 8px; border-radius: 7px; font-size: 12px; font-weight: 500;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
    color: var(--win-text, #fff);
}
.soc-rolepop-chip .hi { flex: none; opacity: .7; }
.soc-rolepop-chip.is-primary { background: rgba(76,194,255,.10); border-color: rgba(76,194,255,.35); }
.soc-rolepop-chipname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-rolepop-primtag { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .55; font-weight: 600; }
.soc-rolepop-xrm {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border: 0; background: transparent; padding: 0;
    color: var(--win-text-2, #cfcfcf); border-radius: 5px; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.soc-rolepop-xrm:hover { background: rgba(232,17,35,.25); color: #ff8a95; }
.soc-rolepop-xrm:disabled { opacity: .5; cursor: default; }
.soc-rolepop-xrm:disabled:hover { background: transparent; color: var(--win-text-2, #cfcfcf); }
.soc-rolepop-add { display: flex; gap: 6px; align-items: center; }
.soc-rolepop-sel {
    flex: 1; min-width: 0; padding: 6px 8px; border-radius: 7px;
    background: rgba(255,255,255,.06); color: var(--win-text, #fff);
    border: 1px solid var(--win-border, rgba(255,255,255,.12));
    font-size: 12px; font-family: inherit; cursor: pointer;
    color-scheme: dark;
}
.soc-rolepop-sel option { background: #1a1b1e; color: #e8ecf3; }
.soc-rolepop-addbtn {
    flex: none; display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 10px; border-radius: 7px; border: 0;
    background: var(--accent, #4cc2ff); color: #0b1220;
    font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer;
    transition: filter .12s ease;
}
.soc-rolepop-addbtn:hover { filter: brightness(1.08); }
.soc-rolepop-addbtn:disabled { opacity: .6; cursor: default; }
.soc-rolepop-note { font-size: 12px; opacity: .55; }

/* ============================================================
   V51 — Premium surfaces (context menus, modals, popovers)
   Brings the older flat menu/modal/popover surfaces up to the
   same "lit, layered" standard the buttons already use.
   Pure CSS + purely additive (appended last, so it wins).
   - Tokens declared at :root so they reach body-level menus
     (the right-click menu is appended to <body>).
   - Motion is transform + opacity only (cheap; auto-disabled by
     the prefers-reduced-motion rule above).
   ============================================================ */
:root {
    --ig-ease: cubic-bezier(.2,.8,.2,1);
    --ig-toplight: inset 0 1px 0 rgba(255,255,255,.07);
    --ig-line: rgba(255,255,255,.12);
    --ig-acc: #4cc2ff;
    --ig-surface: linear-gradient(180deg, #31343a 0%, #26282d 100%);
    --ig-elev-3: 0 4px 12px rgba(0,0,0,.45), 0 28px 64px rgba(0,0,0,.55), var(--ig-toplight);
    --ig-elev-2: 0 2px 6px rgba(0,0,0,.4), 0 16px 34px rgba(0,0,0,.5), var(--ig-toplight);
}
@keyframes igPop { from { opacity: 0; transform: scale(.965) translateY(-2px); } to { opacity: 1; transform: none; } }
@keyframes igRise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes igFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Context menu (right-click / ⋯) ---- */
.soc-cmenu {
    min-width: 200px;
    background: var(--ig-surface);
    border: 1px solid var(--ig-line);
    border-radius: 12px;
    box-shadow: var(--ig-elev-3);
    padding: 6px;
    animation: igPop .13s var(--ig-ease);
    transform-origin: top left;
}
.soc-cmenu-item { padding: 9px 11px; border-radius: 9px; font-size: 13.5px; transition: background .12s var(--ig-ease), transform .08s var(--ig-ease); }
.soc-cmenu-item span { transition: color .12s var(--ig-ease); }
.soc-cmenu-item:hover { background: linear-gradient(180deg, rgba(76,194,255,.18), rgba(76,194,255,.08)); }
.soc-cmenu-item:active { transform: scale(.985); }
.soc-cmenu-danger:hover { background: linear-gradient(180deg, rgba(242,63,67,.22), rgba(242,63,67,.12)); box-shadow: 0 0 16px rgba(242,63,67,.28); }
.soc-cmenu-sep { height: 1px; margin: 6px 8px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent); }

/* ---- Modal (Server settings, invites, create, …) ---- */
.soc-modalback {
    background: radial-gradient(130% 130% at 50% 0%, rgba(12,14,18,.5) 0%, rgba(0,0,0,.74) 100%);
    animation: igFade .14s var(--ig-ease);
}
.soc-modal {
    background: var(--ig-surface);
    border: 1px solid var(--ig-line);
    border-radius: 14px;
    box-shadow: var(--ig-elev-3);
    animation: igRise .16s var(--ig-ease);
}
.soc-modal h3 { font-size: 15.5px; letter-spacing: .2px; font-weight: 650; }

/* ---- Popovers (avatar menu, camera picker, …) ---- */
.soc-avmenu, .soc-campop {
    background: var(--ig-surface);
    border: 1px solid var(--ig-line);
    box-shadow: var(--ig-elev-3);
    animation: igPop .12s var(--ig-ease);
}

/* ===== Themed inputs inside all modals (fixes white/default controls) ===== */
.soc-modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.soc-modal textarea {
    background: rgba(255, 255, 255, .05);
    color: #eef2f7;
    border: 1px solid var(--ig-line, rgba(255, 255, 255, .15));
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13.5px;
    font-family: inherit;
    box-sizing: border-box;
}
.soc-modal input::placeholder,
.soc-modal textarea::placeholder { color: #8a94a6; }
.soc-modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.soc-modal textarea:focus {
    border-color: #4cc2ff;
    box-shadow: 0 0 0 3px rgba(76, 194, 255, .22);
    outline: none;
}
.soc-modal select {
    background: rgba(255, 255, 255, .05);
    color: #eef2f7;
    border: 1px solid var(--ig-line, rgba(255, 255, 255, .15));
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 13px;
    font-family: inherit;
}
.soc-modal select option { background: #26282d; color: #eef2f7; }

/* Section actions (multiple buttons in a header) */
.soc-sec-actions { margin-left: auto; display: flex; gap: 4px; }
.soc-sec-actions .soc-mini { margin-left: 0; }
/* ---- Categories (Discord-style groups in the channel sidebar) ---- */
.soc-cat { margin: 2px 0; }
.soc-cat-name { text-transform: uppercase; }

/* ============ PERMISSIONS MATRIX ============ */
.soc-perm-matrix { overflow-x: auto; margin-bottom: 8px; }
.soc-perm-matrix table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.soc-perm-matrix th { padding: 8px 10px; text-align: center; font-weight: 600; color: #949ba4; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.soc-perm-matrix th:first-child { text-align: left; }
.soc-perm-matrix .perm-col { min-width: 72px; }
.perm-group-row td { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent, #4cc2ff); border-bottom: 1px solid rgba(255,255,255,.05); }
.perm-label { padding: 6px 10px; color: #dbdee1; font-size: 12.5px; }
.perm-cell { padding: 3px 6px; text-align: center; }
.perm-cell .perm-b {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 5px; border: none;
    background: none; color: #6b6f76; font-size: 13px; cursor: pointer;
    transition: background .1s ease, color .1s ease;
}
.perm-cell .perm-b:hover { background: rgba(255,255,255,.08); color: #fff; }
.perm-cell .perm-b.allow.on { background: rgba(35,165,90,.2); color: #23a55a; }
.perm-cell .perm-b.deny.on { background: rgba(242,63,67,.2); color: #f23f43; }
.perm-cell .perm-b.unset.on { background: rgba(255,255,255,.06); color: #6b6f76; }
.soc-perm-hint { font-size: 11.5px; color: #949ba4; opacity: .7; margin-top: 6px; padding: 0 2px; }

/* ============ SERVER RAIL: stronger active indicator ============ */
.soc-rail-icon.on::before {
    width: 4px;
    height: 34px;
    background: #fff;
    box-shadow: 0 0 6px rgba(255,255,255,.6);
}
/* Server name label (top of channel list) */
.soc-sec-top {
    padding: 10px 12px 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: #f2f3f5;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-mini-edit { margin-left: auto; font-size: 14px; width: 26px; height: 26px; }

/* ============ EDIT MODE ============ */
.soc-edit-mode .soc-chan[data-id] {
    cursor: grab;
    outline: 1px dashed rgba(76,194,255,.35);
    outline-offset: -1px;
    border-radius: 6px;
}
.soc-edit-mode .soc-chan[data-id]:active { cursor: grabbing; opacity: .7; }
.soc-edit-mode .soc-chan[data-id]:hover {
    background: rgba(76,194,255,.08) !important;
    outline-color: rgba(76,194,255,.6);
}
/* Categories are movable in edit mode too — highlight the header as the handle. */
.soc-edit-mode .soc-cat[data-cat] .soc-cat-head {
    cursor: grab;
    outline: 1px dashed rgba(76,194,255,.35);
    outline-offset: -1px;
    border-radius: 6px;
}
.soc-edit-mode .soc-cat[data-cat]:active .soc-cat-head { cursor: grabbing; opacity: .8; }
/* v55: Drop targets while editing — clear cyan glow + border shows where item lands */
.soc-edit-mode .soc-droppable, .soc-edit-mode .soc-cat[data-cat] {
    transition: background .15s ease, box-shadow .15s ease, border-radius .15s ease;
}
.soc-dropzone-over {
    background: rgba(76,194,255,.12) !important;
    box-shadow: inset 0 0 0 2px rgba(76,194,255,.7), 0 0 12px rgba(76,194,255,.2) !important;
    border-radius: 8px !important;
    outline: none;
}
.soc-edit-mode .soc-droppable.soc-dropzone-over, .soc-edit-mode .soc-cat.soc-dropzone-over {
    background: rgba(76,194,255,.12) !important;
    box-shadow: inset 0 0 0 2px rgba(76,194,255,.7), 0 0 12px rgba(76,194,255,.2) !important;
    border-radius: 8px !important;
}
/* item 11g: sidebar voice-channel row highlighted while a voice user is
   dragged over it (drop = move the user into that channel) */
.soc-chan.soc-chan-vmove-ok {
    background: rgba(76,194,255,.14) !important;
    box-shadow: inset 0 0 0 2px rgba(76,194,255,.75), 0 0 12px rgba(76,194,255,.25) !important;
    border-radius: 8px !important;
}
/* item 11g: the voice card being dragged (move-user) gets a ghosted look */
.soc-vc-card.soc-vc-dragging {
    opacity: .55;
    cursor: grabbing;
}
/* Category drag source gets a slight lift effect while dragging */
.soc-edit-mode .soc-cat[data-cat]:active {
    opacity: .85;
    cursor: grabbing;
}
/* An empty category still shows a droppable slot so you can drag a channel into it. */
.soc-edit-mode .soc-cat-list:empty { min-height: 20px; }
.soc-edit-mode .soc-cat-list:empty.soc-dropzone-over { min-height: 28px; }
/* item 11m: precise landing indicators — the cyan line shows EXACTLY where the
   dragged item will land (above / below the target); red = that spot is invalid. */
.soc-cat.soc-drop-above {
    box-shadow: inset 0 3px 0 0 rgba(76,194,255,.95) !important;
    background: rgba(76,194,255,.07) !important;
    border-radius: 8px !important;
}
.soc-cat.soc-drop-below {
    box-shadow: inset 0 -3px 0 0 rgba(76,194,255,.95) !important;
    background: rgba(76,194,255,.07) !important;
    border-radius: 8px !important;
}
.soc-chan.soc-ins-above {
    box-shadow: inset 0 3px 0 0 rgba(76,194,255,.95) !important;
    background: rgba(76,194,255,.1) !important;
    border-radius: 6px;
}
.soc-chan.soc-ins-below {
    box-shadow: inset 0 -3px 0 0 rgba(76,194,255,.95) !important;
    background: rgba(76,194,255,.1) !important;
    border-radius: 6px;
}
/* item 11m: ⚙ button stays clearly lit while edit mode is active */
#socEditMode.active {
    background: rgba(76,194,255,.22) !important;
    color: #4cc2ff !important;
    box-shadow: inset 0 0 0 1px rgba(76,194,255,.7);
}

/* ============ USER CONTEXT MENU (right-click, Discord-style) ============ */
.soc-ctx-menu {
    position: fixed;
    background: linear-gradient(180deg, #24262b, #1b1c1f);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    padding: 6px;
    min-width: 190px;
    max-width: 260px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 44px rgba(0,0,0,.62), 0 4px 14px rgba(0,0,0,.5);
    z-index: 99999;
    /* This menu is appended to <body>, outside #socialPage, so it must state its
       font explicitly — otherwise it falls back to a browser-default typeface. */
    font-family: var(--desk-font, 'Segoe UI Variable Text','Segoe UI', system-ui, sans-serif);
    animation: socCtxIn .12s cubic-bezier(.2,.8,.3,1);
}
/* Top accent hairline — a subtle “lit” edge that ties every menu to the app accent. */
.soc-ctx-menu::before {
    content: '';
    position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(76,194,255,.42), transparent);
    border-radius: 2px;
    pointer-events: none;
}

/* ---- Submenu that expands to the right (Discord-style “Roles” ▸) ---- */
.soc-ctx-item.has-sub { display: flex; align-items: center; }
.soc-ctx-item.has-sub > span:first-child { flex: 1 1 auto; }
.soc-ctx-subchev { margin-left: auto; flex: none; opacity: .6; font-size: 16px; line-height: 1; }
.soc-ctx-submenu { min-width: 150px; max-width: 220px; z-index: 100000; }
.soc-ctx-submenu .soc-ctx-item { display: flex; align-items: center; }
.soc-ctx-submenu .soc-ctx-item > span:first-child { flex: 1 1 auto; }
.soc-ctx-item.role-on { color: var(--accent, #4cc2ff); }
.soc-ctx-check { margin-left: auto; flex: none; color: var(--accent, #4cc2ff); font-size: 13px; }
/* Stateful checkable rows (Mute (you) / Deafen (you)) — ✓ sits on the right. */
.soc-ctx-item.checkable { display: flex; align-items: center; }
.soc-ctx-item.checkable > span:first-child { flex: 1 1 auto; }
/* Multi-role toggle checkbox (Discord-style square). */
.soc-role-chk {
    flex: none; margin-left: auto;
    width: 16px; height: 16px; border-radius: 4px;
    border: 1.5px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.04);
    box-sizing: border-box; position: relative;
    transition: background .1s ease, border-color .1s ease, box-shadow .1s ease;
}
.soc-ctx-item:hover .soc-role-chk { border-color: rgba(255,255,255,.42); }
.soc-role-chk.on {
    background: var(--accent, #4cc2ff);
    border-color: var(--accent, #4cc2ff);
    box-shadow: 0 0 10px rgba(76,194,255,.4);
}
.soc-role-chk.on::after {
    content: ''; position: absolute;
    left: 4px; top: 2.5px;
    width: 5px; height: 9px;
    border: solid #08202e; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
/* Small helper line under the submenu title. */
.soc-ctx-hint { padding: 0 12px 6px; font-size: 11px; line-height: 1.35; color: #dbdee1; opacity: .55; }
@keyframes socCtxIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.soc-ctx-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 7px;
    border: none;
    background: none;
    color: #dbdee1;
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
    transition: background .1s ease, color .1s ease;
}
.soc-ctx-item:hover { background: linear-gradient(90deg, rgba(76,194,255,.2), rgba(76,194,255,.06)); color: #fff; }
.soc-ctx-item:active { background: rgba(76,194,255,.22); }
.soc-ctx-item.danger { color: #f23f43; }
.soc-ctx-item.danger:hover { background: rgba(242,63,67,.14); color: #ff5c5c; }
.soc-ctx-item.warn { color: #f0b232; }
.soc-ctx-item.warn:hover { background: rgba(240,178,50,.14); color: #ffcd6b; }
.soc-ctx-item.disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.soc-ctx-sep { height: 1px; margin: 5px 8px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent); }
.soc-ctx-title {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #949ba4;
    text-transform: uppercase;
    letter-spacing: .4px;
    line-height: 1.35;
}
/* item 11f: volume-slider row inside the voice-user context menu
   (same accent styling as the ⋯ options menu slider). */
.soc-ctx-volrow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 9px;
    color: #dbdee1;
    font-size: 13px;
}
.soc-ctx-volico { flex: none; font-size: 14px; opacity: .9; }
.soc-ctx-volrange {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: var(--accent, #4cc2ff);
    height: 18px;
    cursor: pointer;
}
.soc-ctx-volval {
    flex: none;
    min-width: 34px;
    text-align: right;
    font-size: 11.5px;
    color: #949ba4;
    font-variant-numeric: tabular-nums;
}

/* ============ MOBILE POLISH (safe areas, touch targets, no h-scroll) ============
   Per UI/UX guidance: comfortable 44px-ish touch targets, 8px+ spacing, respect
   device safe areas (notch / home indicator), and never allow horizontal scroll.
   Scoped to phones so desktop is untouched. */
@media (max-width: 768px) {
    /* Never let a wide card / code block push the whole app sideways, and
       stop the iOS rubber-band bounce from making the page feel wider than
       the screen. */
    html, body { overflow-x: hidden; overscroll-behavior: none; }
    #socialPage { max-width: 100vw; }
    /* Respect the top safe area (notch) on the header row. */
    .soc-header { padding-top: calc(6px + env(safe-area-inset-top, 0px)); }
    /* Respect the bottom safe area (home indicator) on the mobile voice bar and
       the user panel so controls sit fully above the gesture area. */
    .soc-mobvoice { padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
    .soc-userpanel { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
    /* Bump the common tap rows to a comfortable, consistent touch height. */
    .soc-chan { min-height: 38px; }
    .soc-person { min-height: 40px; }
    .soc-btn { min-height: 38px; }
    /* Keep long labels from overflowing their rows. */
    .soc-chan-name, .soc-person-name { min-width: 0; }
    /* Let long-press fire our context menu cleanly instead of the iOS
       text-selection callout stealing the gesture. */
    .soc-person, .soc-chan { -webkit-touch-callout: none; }
    /* Messages: suppress the iOS native text-selection callout on long-press —
       our long-press opens the message menu (React/Reply/Forward/Pin/Copy/…),
       and the system "Find Selection" popup used to fight it and highlight
       the text. user-select:none (inherited by the whole message row) kills
       the highlight + callout; "Copy text" in our menu still copies it. */
    .soc-msg { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
    /* iOS Safari AUTO-ZOOMS when a focused text field's font is < 16px.
       Bump every focusable text field to 16px on phones so tapping the
       composer (or any input) never triggers the zoom-in that breaks the
       layout. (Composer still fits: 16px text in the existing 20px line.) */
    #socialPage textarea,
    #socialPage input[type="text"],
    #socialPage input[type="email"],
    #socialPage input[type="password"],
    #socialPage input[type="search"],
    #socialPage input[type="number"],
    #socialPage .soc-input { font-size: 16px; }
}

/* Mobile touch/UX pass — comfortable targets for menus & modal footers. */
@media (max-width: 768px) {
    .soc-ctx-item { min-height: 44px; padding: 11px 13px; }
    .soc-ctx-menu { max-width: calc(100vw - 16px); }
    .soc-modal-btns { flex-wrap: wrap; gap: 8px; }
    .soc-modal-btns .soc-btn { min-height: 44px; }
    .soc-empty, .soc-loading { padding: 20px 14px; }
}

/* ============================================================
   DESKTOP APP — window controls float top-right (see titlebar.css).
   No reserved title strip anymore, so the app's own top bars become the
   drag region for the frameless Electron window. Only interactive
   controls inside them (buttons) stay clickable.
   ============================================================ */
/* Only the center header is a drag zone — it does NOT sit under the top-right
   window buttons, so it can never steal a click from them. */
.ig-app .soc-header {
    -webkit-app-region: drag;
}
.ig-app .soc-header button {
    -webkit-app-region: no-drag;
}

/* ============================================================
   MEMBERS PANEL — Discord-style rank groups.
   People are grouped under an uppercase, count-labelled header
   (Owner — 1, Admin — 2, …) instead of inline role badges, so the
   hierarchy reads top-down like Discord.
   ============================================================ */
/* Collapsible rank groups in the MEMBERS panel — click a header to fold it. */
#socRList .soc-rank-head {
    display: flex; align-items: center; gap: 6px;
    width: 100%; box-sizing: border-box;
    margin: 10px 0 2px; padding: 4px 6px;
    background: none; border: none; cursor: pointer;
    font-family: inherit; font-size: 10.5px; font-weight: 700;
    letter-spacing: .6px; text-transform: uppercase;
    border-radius: 6px;
}
#socRList .soc-rank-head:first-child { margin-top: 0; }
#socRList .soc-rank-head:hover { background: rgba(255,255,255,.06); }
#socRList .soc-rank-head:focus-visible { outline: 2px solid var(--accent, #4cc2ff); outline-offset: -2px; }
#socRList .soc-rank-chev { display: inline-flex; align-items: center; justify-content: center; opacity: .8; flex: none; }
#socRList .soc-rank-name { flex: 1; text-align: left; }
#socRList .soc-rank-cnt {
    flex: none; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums;
    letter-spacing: .2px; padding: 1px 7px; border-radius: 999px;
    background: rgba(255,255,255,.08); color: var(--win-text-2, #cfcfcf);
}
#socRList .soc-rank-body[hidden] { display: none; }
#socRList .soc-rank-head.soc-rank-owner { color: #ffd166; }
#socRList .soc-rank-head.soc-rank-admin { color: #ff8a95; }
#socRList .soc-rank-head.soc-rank-mod    { color: var(--accent, #4cc2ff); }
#socRList .soc-rank-head.soc-rank-member { color: var(--win-text-2, #cfcfcf); }

/* ============================================================
   UI POLISH PASS — scrollbars, transitions, empty states,
   toast progress, profile popout, channel header
   ============================================================ */

/* --- 1. Custom thin themed scrollbars --- */
#socialPage ::-webkit-scrollbar { width: 6px; height: 6px; }
#socialPage ::-webkit-scrollbar-track { background: transparent; }
#socialPage ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
#socialPage ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
#socialPage * { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }

/* --- 2. Consistent hover/focus transitions --- */
#socialPage .soc-btn,
#socialPage .soc-mini,
#socialPage .soc-chan,
#socialPage .soc-person,
#socialPage .soc-rail-icon,
#socialPage .soc-iconbtn,
#socialPage .soc-tab,
#socialPage .soc-cmenu-item,
#socialPage .soc-pick-row,
#socialPage .soc-sm-btn,
#socialPage .soc-mtb-btn { transition: background .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease; }

/* --- 3. Toast polish: progress bar + smoother animation --- */
.soc-toast { position: relative; overflow: hidden; }
.soc-toast::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    background: var(--accent, #4cc2ff);
    border-radius: 0 0 9px 9px;
    animation: socToastProg 5s linear forwards;
}
.soc-toast.err::after { background: #ff8f9d; }
.soc-toast.out::after { animation: none; }
@keyframes socToastProg { from { width: 100%; } to { width: 0%; } }
/* Dismiss button */
.soc-toast-x {
    position: absolute; top: 6px; right: 8px;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,.4); font-size: 13px; line-height: 1;
    border-radius: 4px; padding: 0;
}
.soc-toast-x:hover { color: #fff; background: rgba(255,255,255,.08); }

/* --- 4. Empty states: icon + message + optional CTA --- */
.soc-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 24px 16px; text-align: center;
    color: var(--win-text-2, #cfcfcf); font-size: 12.5px;
}
.soc-empty > span:not(.soc-empty-icon):not(.soc-empty-title) { opacity: .7; font-size: 12px; }
.soc-empty-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(76,194,255,.08);
    color: var(--accent, #4cc2ff);
    font-size: 22px;
}
.soc-empty-icon svg { width: 26px; height: 26px; fill: var(--accent, #4cc2ff); }
.soc-empty-title { font-size: 14px; font-weight: 600; color: var(--win-text, #fff); opacity: 1; }
.soc-empty-cta {
    margin-top: 4px; padding: 6px 14px;
    border-radius: 6px; border: 1px solid rgba(76,194,255,.3);
    background: rgba(76,194,255,.1); color: var(--accent, #4cc2ff);
    font-size: 12px; font-weight: 600; cursor: pointer;
}
.soc-empty-cta:hover { background: rgba(76,194,255,.2); border-color: var(--accent, #4cc2ff); }

/* Loading state — animated ring + label (replaces plain “Loading…” text). */
.soc-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 26px 16px;
    color: var(--win-text-2, #cfcfcf); font-size: 12.5px;
}
.soc-spin {
    width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid rgba(76,194,255,.18); border-top-color: var(--accent, #4cc2ff);
    animation: socSpin .7s linear infinite;
}
@keyframes socSpin { to { transform: rotate(360deg); } }

/* --- 5. Profile popout (Discord-style card) --- */
.soc-popout {
    position: fixed;
    z-index: 99998;
    width: 320px;
    border-radius: 12px;
    background: #2b2d31;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
    overflow: hidden;
    animation: socPopIn .16s ease;
    pointer-events: auto;
}
@keyframes socPopIn { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.soc-popout-banner {
    height: 64px;
    background: linear-gradient(135deg, #41608a, #5b4a7a);
    position: relative;
}
.soc-popout-banner-clip {
    position: absolute; inset: 0;
    overflow: hidden;
}
.soc-popout-banner-bg {
    position: absolute; top: -14px; left: -14px;
    width: calc(100% + 28px); height: calc(100% + 28px);
    object-fit: cover;
    filter: blur(12px) saturate(1.15);
    opacity: .85; pointer-events: none;
}
.soc-popout-avatar-wrap {
    position: absolute; bottom: -28px; left: 16px;
    z-index: 2;
    width: 56px; height: 56px;
}
.soc-popout-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 4px solid #2b2d31;
    overflow: hidden;
    background: #3a4a5f;
    display: flex; align-items: center; justify-content: center;
}
.soc-popout-avatar img { width: 100%; height: 100%; object-fit: cover; }
.soc-popout-avatar .soc-av { width: 100%; height: 100%; border-radius: 0; border: none; box-shadow: none; }
.soc-popout-avatar-wrap .soc-dot {
    position: absolute; right: -3px; bottom: -3px;
    width: 15px; height: 15px; border: 4px solid #2b2d31;
}
.soc-popout-body {
    padding: 34px 16px 14px;
}
.soc-popout-name {
    font-size: 17px; font-weight: 700; color: #f2f3f5;
    display: flex; align-items: center; gap: 6px;
}
.soc-popout-username {
    font-size: 13px; color: var(--win-text-2, #cfcfcf); margin-top: 1px;
}
.soc-popout-status {
    display: flex; align-items: center; gap: 6px; margin-top: 10px;
    font-size: 12.5px; color: var(--win-text-2, #cfcfcf);
}
.soc-popout-status-dot {
    width: 9px; height: 9px; border-radius: 50%; flex: none;
}
.soc-popout-status-dot.online { background: #22c55e; }
.soc-popout-status-dot.idle { background: #f59e0b; }
.soc-popout-status-dot.dnd { background: #e81123; }
.soc-popout-status-dot.offline { background: #555; }
.soc-popout-sec {
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.soc-popout-sec-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--win-text-2, #cfcfcf); opacity: .7;
    margin-bottom: 4px;
}
.soc-popout-sec-text {
    font-size: 13px; color: var(--win-text, #fff); line-height: 1.4;
}
.soc-popout-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.soc-popout-role {
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    background: rgba(76,194,255,.12); color: var(--accent, #4cc2ff);
}
.soc-popout-foot {
    padding: 10px 16px 14px;
    display: flex; gap: 8px;
}
.soc-popout-foot .soc-btn {
    flex: 1; padding: 7px 12px; font-size: 12.5px; text-align: center;
}

/* Roles panel: back-to-server-settings link */
.soc-roles-back {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: none; cursor: pointer;
    color: var(--accent, #4cc2ff); font-size: 12.5px; font-weight: 600;
    padding: 2px 0; margin-bottom: 8px; letter-spacing: .2px;
}
.soc-roles-back:hover { color: #86d6ff; }
.soc-roles-back:active { opacity: .8; }

/* Profile popout: personal note (only visible to you) */
.soc-popout-notesection .soc-popout-sec-label {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.soc-note-edit {
    width: 22px; height: 22px; border: none; border-radius: 6px; cursor: pointer;
    background: rgba(255,255,255,.06); color: var(--win-text-2, #cfcfcf); font-size: 12px; line-height: 1;
}
.soc-note-edit:hover { background: rgba(76,194,255,.2); color: #fff; }
.soc-popout-note { font-size: 13px; line-height: 1.4; color: var(--win-text, #fff); word-break: break-word; cursor: text; min-height: 18px; }
.soc-note-empty { opacity: .55; font-style: italic; }
.soc-popout-note-edit { margin-top: 8px; }
.soc-note-input {
    width: 100%; box-sizing: border-box;
    background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); border-radius: 7px;
    color: #fff; font-size: 12.5px; padding: 8px 10px;
}
.soc-note-input:focus { outline: none; border-color: var(--accent, #4cc2ff); }
.soc-note-btns { display: flex; gap: 6px; margin-top: 8px; }
.soc-note-btns .soc-btn { flex: 1; min-height: 32px; font-size: 12px; }

/* Profile popout: quick-message row (Enter or ➤ opens the DM, prefilled). */
.soc-popout-msgrow { display: flex; gap: 8px; align-items: center; }
.soc-popout-msgin {
    flex: 1 1 auto; min-width: 0;
    background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); border-radius: 7px;
    color: #fff; font-size: 12.5px; padding: 8px 10px;
    font-family: inherit;
}
.soc-popout-msgin::placeholder { color: rgba(255,255,255,.35); }
.soc-popout-msgin:focus { outline: none; border-color: var(--accent, #4cc2ff); }
.soc-pop-msgsend { flex: none; width: 34px; min-height: 34px; padding: 0; justify-content: center; font-size: 13px; }
/* The MESSAGE row sits OUTSIDE .soc-popout-body (which carries the 16px
   horizontal padding), so it needs its own — aligns it with the NOTE
   section instead of touching the box edges. */
.soc-popout-msgsec { padding-left: 16px; padding-right: 16px; }

/* --- 6. Channel header: topic + cleaner alignment --- */
.soc-chan-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    min-height: 48px;
}
.soc-chan-head-icon {
    flex: none; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    color: var(--win-text-2, #cfcfcf);
}
.soc-chan-head-icon svg { width: 18px; height: 18px; fill: currentColor; }
.soc-chan-head-name {
    font-size: 15px; font-weight: 600; color: var(--win-text, #fff);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.soc-chan-head-topic {
    font-size: 12px; color: var(--win-text-2, #cfcfcf); opacity: .7;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 1px;
}
.soc-chan-head-actions {
    margin-left: auto; display: flex; gap: 4px; flex: none;
}
.soc-chan-head-actions .soc-iconbtn { width: 30px; height: 30px; }

/* --- 7. Member status dot wrapper (positions the base .soc-dot) --- */
.soc-av-wrap {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
}
/* The base .soc-dot already has the right size/position; just ensure
   the border color matches the local background for each context. */
.soc-av-wrap .soc-dot { border-color: #1e1f22; }
.soc-person.off .soc-av-wrap .soc-dot { background: #555; }

/* --- 8. Mobile: ensure 44px touch targets + safe areas --- */
@media (max-width: 768px) {
    .soc-person { min-height: 44px; }
    .soc-btn { min-height: 44px; }
    .soc-mini { min-height: 36px; min-width: 36px; }
    .soc-rail-icon { width: 52px; height: 52px; }
    .soc-empty { padding: 24px 12px; }
    .soc-popout { width: calc(100vw - 24px); max-width: 320px; }
    .soc-toasts { top: 8px; left: 8px; right: 8px; }
    .soc-toast { width: auto; }
}

/* ============================================================
   USER SETTINGS MODAL — POLISH PASS
   Structured sections, better hierarchy, themed inputs,
   consistent spacing, professional feel
   ============================================================ */

/* Modal shell: wider, more structured */
.soc-modal.soc-set-modal {
    width: min(480px, calc(100% - 32px));
    border-radius: 14px;
    background: #1e1f22;
    border: 1px solid rgba(255,255,255,.08);
}
.soc-modal.soc-set-modal h3 {
    font-size: 16px;
    font-weight: 700;
    padding: 16px 20px 8px;
    color: #f2f3f5;
    letter-spacing: .2px;
}

/* Sections: card-like with clear separation */
.soc-modal.soc-set-modal > .soc-set-sec {
    padding: 14px 20px;
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.soc-modal.soc-set-modal > .soc-set-sec:last-of-type {
    border-bottom: none;
}

/* Section labels: more prominent */
.soc-f-label {
    display: block;
    margin: 12px 0 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
}
.soc-f-label:first-child {
    margin-top: 0;
}

/* Inputs: taller, better contrast, glow on focus */
.soc-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    color: #f2f3f5;
    font-family: inherit;
    font-size: 13.5px;
    padding: 9px 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.soc-input:focus {
    outline: none;
    border-color: var(--accent, #4cc2ff);
    box-shadow: 0 0 0 3px rgba(76,194,255,.12);
}
.soc-input option { background: #2b2d31; color: #fff; }

/* Range sliders: custom themed */
.soc-set-modal input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,.1);
    outline: none;
    cursor: pointer;
}
.soc-set-modal input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent, #4cc2ff);
    border: 2px solid #1e1f22;
    box-shadow: 0 0 4px rgba(76,194,255,.4);
    cursor: pointer;
    transition: transform .1s ease;
}
.soc-set-modal input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.soc-set-modal input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent, #4cc2ff);
    border: 2px solid #1e1f22;
    box-shadow: 0 0 4px rgba(76,194,255,.4);
    cursor: pointer;
}

/* Radio + checkbox: consistent, slightly larger */
.soc-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13.5px;
    cursor: pointer;
    color: #dbdee1;
}
.soc-radio input[type="radio"],
.soc-radio input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent, #4cc2ff);
    cursor: pointer;
    flex: none;
}

/* Hints: subtler, smaller */
.soc-f-hint {
    margin-top: 8px;
    font-size: 11.5px;
    color: rgba(255,255,255,.45);
    line-height: 1.5;
}

/* Key row: cleaner alignment */
.soc-keyrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13.5px;
    color: #dbdee1;
}
.soc-keybtn {
    min-width: 72px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    color: #f2f3f5;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.soc-keybtn:hover {
    background: rgba(76,194,255,.1);
    border-color: var(--accent, #4cc2ff);
}

/* Sound rows: card-like, better spacing */
.soc-snd-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background .12s ease;
}
.soc-snd-row:hover {
    background: rgba(255,255,255,.03);
}
.soc-snd-row + .soc-snd-row {
    border-top: none;
}
.soc-snd-on {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #dbdee1;
}
.soc-snd-on input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent, #4cc2ff);
    cursor: pointer;
    flex: none;
}
.soc-snd-row input[type="range"] {
    flex: 0 1 100px;
    min-width: 60px;
    width: 100px;
}
.soc-snd-play {
    flex: 0 0 auto;
    min-width: 32px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    color: #dbdee1;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.soc-snd-play:hover {
    background: rgba(76,194,255,.12);
    color: var(--accent, #4cc2ff);
}

/* Buttons in settings: consistent */
.soc-set-modal .soc-btn {
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
}
.soc-set-modal .soc-btn-ok {
    background: var(--accent, #4cc2ff);
    color: #0b1220;
    border: none;
}
.soc-set-modal .soc-btn-ok:hover {
    background: #2ba6f0;
    box-shadow: 0 2px 12px rgba(76,194,255,.3);
}
.soc-set-modal .soc-mini-btn {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Sticky Done button: cleaner */
.soc-modal.soc-set-modal .soc-modal-btns {
    position: sticky;
    bottom: 0;
    margin-top: 0;
    padding: 12px 20px;
    background: #1e1f22;
    border-top: 1px solid rgba(255,255,255,.06);
    border-radius: 0 0 14px 14px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Sign-out icon button (far left of the sticky Done bar) */
.soc-signout-btn {
    flex: none;
    width: 40px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #ff95a1;
    background: rgba(232,17,35,.10);
    border: 1px solid rgba(232,17,35,.42);
    transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.soc-signout-btn:hover {
    background: #e81123;
    border-color: #e81123;
    color: #fff;
    box-shadow: 0 2px 12px rgba(232,17,35,.4);
}
.soc-signout-btn:active { transform: translateY(1px); }
.soc-signout-btn .hi { width: 19px; height: 19px; }

/* ---- Sign-out confirm: a small card that stands above the settings modal ---- */
.soc-confirm-wrap {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0,0,0,.66);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .16s ease;
}
.soc-confirm-wrap.show { opacity: 1; }
.soc-confirm-card {
    width: 100%;
    max-width: 360px;
    background: #2b2d31;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 26px 22px 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,.55);
    transform: translateY(10px) scale(.98);
    transition: transform .16s ease;
    text-align: center;
}
.soc-confirm-wrap.show .soc-confirm-card { transform: none; }
.soc-confirm-ic {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    color: #ff95a1;
    background: rgba(232,17,35,.12);
    border: 1px solid rgba(232,17,35,.38);
}
.soc-confirm-ic .hi { width: 28px; height: 28px; }
.soc-confirm-title { font-size: 18px; font-weight: 700; color: #f2f3f5; margin-bottom: 8px; }
.soc-confirm-body { font-size: 13.5px; line-height: 1.55; color: #b6bcc4; margin-bottom: 22px; }
.soc-confirm-btns { display: flex; gap: 10px; }
.soc-confirm-btns .soc-btn { flex: 1; padding: 11px 14px; font-size: 14px; font-weight: 600; }
.soc-confirm-btns .soc-btn-danger { background: #e81123; border-color: #e81123; color: #fff; }
.soc-confirm-btns .soc-btn-danger:hover { background: #ff2d40; border-color: #ff2d40; box-shadow: 0 2px 14px rgba(232,17,35,.45); }
/* item 11i: optional reason field inside the confirm dialog (ban) */
.soc-confirm-reason {
    display: block;
    margin: 0 0 18px;
    text-align: left;
    font-size: 12.5px;
    color: #b6bcc4;
}
.soc-confirm-reason-opt { opacity: .6; font-size: 11.5px; }
.soc-confirm-reason-in {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 9px 11px;
    font-size: 13.5px;
    color: #f2f3f5;
    background: #1e1f22;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 8px;
    outline: none;
}
.soc-confirm-reason-in:focus { border-color: #4cc2ff; }

/* item 11i: Bans & moderation log (Server Settings) */
.soc-modlog-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px;
    font-size: 13px;
}
.soc-modlog-row .soc-av-wrap { flex: none; }
.soc-modlog-who { font-weight: 600; color: #f2f3f5; flex: none; }
.soc-modlog-meta {
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    color: #949ba4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-modlog-line {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 4px;
    font-size: 12px;
}
.soc-modlog-act {
    flex: none;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    color: #b6bcc4;
}
.soc-modlog-act-ban { background: rgba(232,17,35,.15); color: #ff6b77; }
.soc-modlog-act-kick { background: rgba(255,169,64,.14); color: #ffa940; }
.soc-modlog-act-unban { background: rgba(35,165,90,.15); color: #43b581; }
.soc-modlog-act-voice_move, .soc-modlog-act-voice_disconnect { background: rgba(76,194,255,.12); color: #4cc2ff; }
.soc-modlog-sep {
    height: 1px;
    margin: 6px 0;
    background: var(--win-border, rgba(255,255,255,.08));
}
.soc-modlog-empty { padding: 8px 4px; font-size: 12px; color: #80848e; }

/* Avatar hero: slightly larger, more impactful */
.soc-avhero-avatar {
    width: 130px;
    height: 130px;
}
.soc-avhero-img {
    border-radius: 18px;
}

/* Monitor button: more prominent */
.soc-monbtn {
    margin-top: 8px;
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 7px;
    background: rgba(76,194,255,.08);
    border: 1px solid rgba(76,194,255,.2);
    color: var(--accent, #4cc2ff);
}
.soc-monbtn:hover {
    background: rgba(76,194,255,.15);
    border-color: var(--accent, #4cc2ff);
}

/* Meter: slightly taller, more visible */
.soc-meter {
    height: 10px;
    margin-top: 8px;
    border-radius: 5px;
    background: rgba(255,255,255,.06);
}

/* Admin warning/ok boxes: more prominent */
#socAdminWarn, #socAdminOk {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    line-height: 1.5;
}

/* Desktop app button: CTA style */
#socDesktopBtn {
    margin-top: 10px;
    padding: 9px 16px;
    background: rgba(76,194,255,.1);
    border: 1px solid rgba(76,194,255,.25);
    color: var(--accent, #4cc2ff);
    font-weight: 600;
    border-radius: 7px;
}
#socDesktopBtn:hover {
    background: rgba(76,194,255,.18);
    border-color: var(--accent, #4cc2ff);
}

/* Mobile: tighter but still comfortable */
@media (max-width: 768px) {
    .soc-modal.soc-set-modal { width: calc(100% - 16px); border-radius: 12px; }
    .soc-modal.soc-set-modal > .soc-set-sec { padding: 12px 16px; }
    .soc-modal.soc-set-modal .soc-modal-btns { padding: 10px 16px; }
    .soc-snd-row { flex-wrap: wrap; gap: 6px; }
    .soc-snd-on { flex-basis: 100%; }
    .soc-snd-row input[type="range"] { flex: 1 1 auto; width: auto; }
}

/* ============================================================
   CUSTOM ROLES — Discord-style roles panel, role editor,
   colored rank headers + colored usernames.
   ============================================================ */

/* Colored dot in the rank headers (members panel) */
#socRList .soc-rank-dot {
    flex: none; width: 9px; height: 9px; border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,0,0,.25);
}

/* --- Roles panel (server settings → Manage roles) --- */
.soc-roles-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 12px; flex-wrap: wrap;
}
/* v61: explicit color (was opacity-only — inherited a dark base color when
   the modal was re-parented to <body>, making it nearly unreadable). */
.soc-roles-head-t { font-size: 12px; color: #a9b1bd; }
.soc-roles-list {
    display: flex; flex-direction: column; gap: 4px;
    max-height: 420px; overflow: auto;
    border: 1px solid var(--win-border, rgba(255,255,255,.08));
    border-radius: 8px; padding: 6px;
}
.soc-role-row {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: 8px;
    transition: background .12s ease;
}
.soc-role-row:hover { background: rgba(255,255,255,.05); }
.soc-role-row.locked { background: rgba(255,255,255,.025); }
.soc-role-dot {
    flex: none; width: 12px; height: 12px; border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,0,0,.25);
}
.soc-role-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e8ecf1; }
.soc-role-lock { flex: none; opacity: .8; color: #cfd6df; display: inline-flex; }
/* v61: explicit readable color (was opacity .6 on an inherited dark base). */
.soc-role-cnt {
    flex: none; font-size: 11px; color: #a5aeba; font-variant-numeric: tabular-nums;
    padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.07);
}
.soc-role-act { flex: none; display: inline-flex; gap: 4px; }

/* --- Role editor --- */
.soc-swatch {
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    border: 2px solid rgba(0,0,0,.35);
    transition: transform .12s ease, border-color .12s ease;
    padding: 0;
}
.soc-swatch:hover { transform: scale(1.12); border-color: rgba(255,255,255,.55); }
.soc-swatch-custom {
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
    border: 2px solid rgba(255,255,255,.35);
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform .12s ease;
}
.soc-swatch-custom:hover { transform: scale(1.12); }
.soc-swatch-custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; }
.soc-perm-group {
    font-size: 10.5px; font-weight: 700; letter-spacing: .6px;
    opacity: .55; margin: 8px 0 4px;
}
.soc-perm-group:first-child { margin-top: 0; }
.soc-perm-row {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 6px; border-radius: 6px; cursor: pointer;
    font-size: 13px;
    transition: background .1s ease;
}
.soc-perm-row:hover { background: rgba(255,255,255,.05); }
.soc-perm-row input { margin: 0; accent-color: var(--accent, #4cc2ff); width: 15px; height: 15px; cursor: pointer; }
.soc-role-locked-note {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; border-radius: 8px;
    background: rgba(76,194,255,.08);
    border: 1px solid rgba(76,194,255,.22);
    font-size: 12px; opacity: .85; line-height: 1.45;
}

/* Role dots inside context-menu role rows */
.soc-ctx-menu .soc-role-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none;
}

/* ================= IN-APP APPS (Home → middle section) ================= */
/* Left-panel app list (collapsed under "More" by default) — v51: rows share the
   same .soc-home-navitem style as Friends, so the list reads as one continuous
   set of items. Container padding aligns the rows with Friends/More above. */
.soc-appnav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 4px; }
.soc-appnav[hidden] { display: none; }
.soc-appnav .soc-home-navitem svg { flex: none; opacity: .9; }
.soc-appnav .soc-home-navitem span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "More" row: chevron flips when expanded (sub-150ms, per design rules) */
.soc-more-ic { display: inline-flex; color: var(--accent, #4cc2ff); }
.soc-home-navitem .more-chev { margin-left: auto; display: inline-flex; opacity: .55; transition: transform .15s ease; }
.soc-home-navitem.open .more-chev { transform: rotate(180deg); opacity: .95; }

/* App host overlay (covers the DM/chat area of .soc-main) */
.soc-apphost {
    position: absolute; inset: 0; z-index: 20;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, rgba(255,255,255,.02) 0%, rgba(0,0,0,.04) 100%), #1b1d21;
}
.soc-apphost[hidden] { display: none; }
.soc-appbar {
    flex: none; display: flex; align-items: center; gap: 12px;
    height: 48px; padding: 0 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.16);
}
.soc-appback {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 11px 6px 9px; border: 0; border-radius: 7px;
    background: rgba(255,255,255,.06); color: rgba(230,234,238,.9);
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .14s ease, color .14s ease;
}
.soc-appback:hover { background: var(--accent, #4cc2ff); color: #08202e; }
/* Desktop app: the app bar IS the top bar on in-app pages (Files/Notes/
   Images/Music/Video/Live/Games) — it replaces the header, so it becomes the
   window drag region exactly like .soc-header. The frameless window otherwise
   can't be moved on those pages. Interactive children (back button, invite
   chip, any button) stay clickable; the floating window controls sit in a
   higher z-index no-drag overlay (titlebar.css) and are unaffected. */
.ig-app .soc-appbar { -webkit-app-region: drag; }
.ig-app .soc-appbar button,
.ig-app .soc-appbar .soc-up-inv,
.ig-app .soc-appback { -webkit-app-region: no-drag; }
.soc-apptitle { font-size: 15px; font-weight: 600; color: #eef1f4; letter-spacing: .2px; }
.soc-betabadge {
    margin-left: auto; flex: 0 0 auto; align-self: center;
    font: 600 10px/1 system-ui, -apple-system, sans-serif; letter-spacing: .08em;
    color: #8b98a5; background: rgba(127,127,127,.12); border: 1px solid rgba(160,160,160,.22);
    padding: 3px 9px; border-radius: 999px; user-select: none; opacity: .75; transition: opacity .15s;
}
.soc-betabadge:hover { opacity: 1; }
/* Invite chip in the top app bar: pushed right, sitting just left of the
   BETA badge (badge keeps its normal look; we only drop its own auto-margin
   inside the appbar so the chip owns the right-alignment). */
.soc-appbar .soc-up-inv { margin-left: auto; margin-right: 8px; }
.soc-appbar .soc-betabadge { margin-left: 0; }
/* Beta stack (temporary, beta-test period): BETA on top, invite code under it,
   centered in the header. Sized to fit the 46px header WITHOUT growing it
   (15px + 2px gap + 15px = 32px ≤ 34px content height). Absolutely positioned,
   so it never pushes or shifts any existing header element. */
.soc-beta-stack {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    z-index: 3; pointer-events: none; /* gaps stay click-transparent */
}
.soc-beta-stack > * { pointer-events: auto; }
.soc-beta-stack .soc-betabadge {
    margin-left: 0; flex: none;
    font-size: 9px; line-height: 1.1; padding: 2px 7px;
}
.soc-up-inv.soc-inv-hdr {
    padding: 1px 8px; border-radius: 999px; font-size: 9px; line-height: 1.2;
    gap: 3px; white-space: nowrap;
}
.soc-up-inv.soc-inv-hdr b { font-size: 9px; font-weight: 600; }
/* Desktop app: the header is a window-drag region — keep the chip clickable. */
.ig-app .soc-up-inv.soc-inv-hdr { -webkit-app-region: no-drag; cursor: pointer; }
/* Invite-code chip — compact on purpose: it must not push the buttons around. */
.soc-up-inv {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 7px; border-radius: 6px;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
    font-size: 11px; line-height: 1; color: #aeb9c4; cursor: pointer; user-select: none;
    white-space: nowrap; transition: background .14s ease;
}
.soc-up-inv:hover { background: rgba(255,255,255,.10); }
.soc-up-inv b { color: #e8edf2; font-weight: 600; letter-spacing: .05em; font-size: 11px; }

/* Settings window — upload space block (top, under the hero) */
.soc-storage-sec { border-top: 1px solid rgba(255,255,255,.07); }
.soc-storage { display: flex; align-items: flex-start; gap: 12px; padding: 10px 2px; }
.soc-storage-ic {
    flex: none; width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(76,194,255,.10); border: 1px solid rgba(76,194,255,.22); color: #4cc2ff;
}
.soc-storage-body { flex: 1; min-width: 0; }
.soc-storage-main { font-size: 13.5px; font-weight: 600; color: #e8edf2; }
.soc-storage-barwrap { margin-top: 8px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.10); overflow: hidden; }
.soc-storage-bar { height: 100%; width: 0; border-radius: 5px; background: #4cc2ff; transition: width .35s ease; }
.soc-storage-cats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.soc-storage-cat { font-size: 12px; color: #aab6c2; display: inline-flex; align-items: center; gap: 5px; }
.soc-storage-cat b { color: #e8edf2; font-weight: 600; }
/* Category label = custom text-button that opens that app section. */
.soc-storage-catbtn {
    appearance: none;
    cursor: pointer;
    padding: 1px 6px;
    margin: 0;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 6px;
    color: #c4cdd6;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.soc-storage-catbtn:hover {
    background: rgba(76,194,255,.13);
    border-color: rgba(76,194,255,.45);
    color: #fff;
}
.soc-storage-catbtn:active { background: rgba(76,194,255,.22); }

/* Disabled apps in the left-panel app list (AI Chat / Certificates / Shop) */
.soc-home-navitem.soc-appnav-disabled { opacity: .42; cursor: not-allowed; }
.soc-home-navitem.soc-appnav-disabled:hover { background: transparent; }
.soc-appbody { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; background: #191b1f; }
/* v52: design tokens for the inline apps — remap their indigo/navy palette to
   the steel-blue theme. Every module uses var(--token, fallback); defining these
   on the host cascades into Music / Video / Images / AI-Chat and re-themes
   buttons, active states, sliders, focus rings and surfaces in one place. */
.soc-appbody {
    --primary-color: #4cc2ff;
    --primary-light: #86d4ff;
    --bg-primary: #191b1f;
    --bg-secondary: #1f2126;
    --bg-tertiary: #23262b;
    --border-color: rgba(255,255,255,.09);
    --text-primary: #eef1f4;
    --text-secondary: #c3c8ce;
    --text-muted: #8b93a5;
    --danger-color: #ff6b73;
    --shadow-md: 0 6px 18px rgba(0,0,0,.35);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.45);
    --shadow-xl: 0 16px 44px rgba(0,0,0,.55);
    --transition-normal: 180ms;
    --chat-primary: #4cc2ff;
    --chat-success: #23a55a;
    --chat-warning: #f0b232;
    --chat-danger: #ff6b73;
    --chat-bg-primary: #191b1f;
    --chat-bg-secondary: #1f2126;
    --chat-bg-tertiary: #23262b;
    --chat-border-color: rgba(255,255,255,.09);
    --chat-text-primary: #eef1f4;
    --chat-text-secondary: #c3c8ce;
    --chat-text-muted: #8b93a5;
    --chat-shadow: 0 6px 18px rgba(0,0,0,.35);
    --chat-shadow-lg: 0 10px 30px rgba(0,0,0,.45);
    color-scheme: dark;
}
.soc-appmount { height: 100%; }
/* Module containers sit inside #tab-* wrappers, so use descendant selectors
   (the old direct-child rules never matched and the modules could collapse) */
.soc-appmount .files-container, .soc-appmount .music-container,
.soc-appmount .image-viewer-container, .soc-appmount .video-viewer-container,
.soc-appmount .live-container { min-height: 100%; }
/* One header per app: the app bar is the single header inside the inline
   host, so hide the modules' own duplicated page titles (Video Library,
   Image Gallery) — their toolbars stay visible below it. */
.soc-appbody h1.page-title { display: none; }

/* Filter selects (Video / Image) — themed to sit with the search field. */
.soc-appbody .vid-filter, .soc-appbody .img-filter {
    height: 34px; padding: 0 28px 0 11px; border-radius: 9px;
    background-color: #23262b; color: #dfe3e8; border: 1px solid #30353d;
    font-size: 13px; font-family: inherit; cursor: pointer; max-width: 190px;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa4b2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9.5 12 15.5 18 9.5'/></svg>");
    background-repeat: no-repeat; background-position: right 9px center;
    transition: border-color .15s ease, background-color .15s ease;
}
.soc-appbody .vid-filter:hover, .soc-appbody .img-filter:hover { border-color: #3c424b; background-color: #282c33; }
.soc-appbody .vid-filter:focus, .soc-appbody .img-filter:focus { outline: none; border-color: var(--accent, #4cc2ff); }
.soc-appbody .vid-filter option, .soc-appbody .img-filter option { background: #1b1d21; color: #dfe3e8; }
.soc-appbody .video-viewer-toolbar, .soc-appbody .image-viewer-toolbar { flex-wrap: wrap; gap: 10px; }
.soc-appbody .video-search, .soc-appbody .image-search, .soc-appbody .music-search { flex: 1 1 220px; min-width: 0; max-width: 360px; }

/* Music tracks toolbar (Play all / Play selected / Select all / filters) — the
   desktop.css versions are scoped to .win-mount, so the inline app needs its
   own to avoid raw, unstyled default buttons and dropdowns. */
.soc-appbody .music-tracks-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; padding: 8px 10px;
}
.soc-appbody .music-tracks-bar.inline { background: transparent; border: none; padding: 0 0 12px; }
.soc-appbody .mtb-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05);
    color: #c3c8ce; border-radius: 8px; padding: 7px 13px;
    font-size: 12.5px; font-weight: 500; font-family: inherit; cursor: pointer;
    transition: background .13s ease, border-color .13s ease, color .13s ease;
}
.soc-appbody .mtb-btn:hover { background: rgba(255,255,255,.10); color: #eef1f4; border-color: rgba(255,255,255,.16); }
.soc-appbody .mtb-btn.primary { background: var(--accent, #4cc2ff); border-color: transparent; color: #06222f; font-weight: 600; }
.soc-appbody .mtb-btn.primary:hover { background: #6fd0ff; color: #06222f; }
.soc-appbody .mtb-check {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; color: #c3c8ce; cursor: pointer; user-select: none;
    padding: 6px 9px; border-radius: 8px; transition: background .13s ease;
}
.soc-appbody .mtb-check:hover { background: rgba(255,255,255,.06); }
.soc-appbody .mtb-check input { accent-color: var(--accent, #4cc2ff); width: 15px; height: 15px; cursor: pointer; }
.soc-appbody .mtb-select {
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10);
    color: #c3c8ce; border-radius: 8px; padding: 7px 28px 7px 11px;
    font-size: 12.5px; font-family: inherit; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa4b2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9.5 12 15.5 18 9.5'/></svg>");
    background-repeat: no-repeat; background-position: right 9px center;
    transition: border-color .13s ease, background-color .13s ease;
}
.soc-appbody .mtb-select:hover { border-color: rgba(255,255,255,.16); background-color: rgba(255,255,255,.09); }
.soc-appbody .mtb-select:focus { border-color: var(--accent, #4cc2ff); outline: none; }
.soc-appbody .mtb-select option { background: #23262b; color: #eef1f4; }
.soc-appbody .music-track-check input { accent-color: var(--accent, #4cc2ff); width: 15px; height: 15px; cursor: pointer; }
.soc-appbody .music-track-row.selected { background: rgba(76,194,255,0.08); }
/* v56: reserve space at the bottom so content isn't hidden behind the player */
.soc-appbody:has(.music-bottom-player-container.active) {
    padding-bottom: 72px;
}

/* v53: Contain the music bottom player bar within the inline app body so it
   does NOT bleed over the members / Active-Now panel (.soc-right). */
/* v56: Absolute bottom — .soc-appbody is position:relative, so the player
   (deep in the DOM inside #tab-music) pins to the bottom of the visible area.
   Content above scrolls freely; the player always stays at the bottom. */
.soc-appbody .music-bottom-player-container {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100%;
    box-sizing: border-box;
    z-index: 95;
    overflow-x: hidden;
    overflow-y: visible;
    border-top: 1px solid rgba(255,255,255,.06);
    background: #1b1d21;
    border-radius: 12px 12px 0 0;
    margin: 0;
    padding-bottom: 0;
}

/* Chess: its board sizes itself with container-query units, which need a
   bounded flex chain. Make the mount a flex column only while the chess
   view is present so the board gets a real height and fills the section. */
.soc-appbody:has(.chess-view) { overflow: hidden; }
.soc-appbody:has(.chess-view) > .soc-appmount { display: flex; flex-direction: column; min-height: 0; }
.soc-appbody:has(.chess-view) .chess-view { flex: 1 1 auto; min-height: 0; }
/* The app bar already provides Back + the app title — hide the module's
   redundant back button inside the inline host. */
.soc-appbody .chess-page-header .chess-back-btn { display: none; }

/* Games hub (Multiplayer + Single player sections) */
.soc-games-hub { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 26px; padding: 28px 24px 40px; }
.soc-games-sec-h { font-size: 13px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #8b93a5; margin-bottom: 12px; }
.soc-games-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 780px; }
.soc-games-tile {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    width: auto; padding: 28px 20px; border-radius: 14px; cursor: pointer;
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.08); color: #eef1f4; font: inherit;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.soc-games-tile:hover { transform: translateY(-3px); border-color: rgba(76,194,255,.5); background: linear-gradient(180deg, rgba(76,194,255,.12), rgba(76,194,255,.04)); }
.soc-games-ic { display: inline-flex; color: var(--accent, #4cc2ff); }
.soc-games-lb { font-size: 15px; font-weight: 600; }
.soc-games-badge { position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(76,194,255,.12); border: 1px solid rgba(76,194,255,.4); color: #4cc2ff; }
@media (max-width: 640px) {
    .soc-games-grid { grid-template-columns: 1fr 1fr; }
}

/* Error / coming-soon states */
.soc-apperr, .soc-appsoon { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; color: rgba(230,234,238,.8); }
.soc-apperr-ic, .soc-appsoon-ic { font-size: 40px; }
.soc-apperr-t, .soc-appsoon-t { font-size: 16px; font-weight: 600; color: #eef1f4; }
.soc-appsoon p { font-size: 13px; opacity: .7; max-width: 340px; }

/* Modal apps (AI-Chat, Reaction) reparented inline → sit flush in the host */
.soc-appbody .soc-inline-modal {
    position: static !important; max-width: none !important; width: 100% !important;
    max-height: none !important; height: 100% !important; border-radius: 0 !important;
    margin: 0 !important; box-shadow: none !important;
    /* The .modal base (dashboard.css) centers with transform:translate(-50%,-50%).
       Once reparented into normal flow that transform would shove the whole app
       ~half a panel up-and-left and it reads as "blank". Kill it, and make sure
       the app renders as a filled column even if its own display rule is absent. */
    transform: none !important; display: flex !important; flex-direction: column !important;
}
.soc-appbody .soc-inline-modal .modal-body { overflow: hidden auto; }

/* ============ v52: Now-Playing dock (bottom of the members panel) ============
   Persistent mini player for Music + Video. Sits at the end of the .soc-right
   flex column, so .soc-rlist scrolls ABOVE it — nothing overlaps, its space is
   reserved. Hidden until a track/video is live and you've left that app open. */
.soc-dock {
    flex: none;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.05));
    border-top: 1px solid var(--win-border, rgba(255,255,255,.08));
}
.soc-dock[hidden] { display: none; }
.soc-dock-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 8px 9px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 11px;
    animation: socDockIn .22s ease;
}
.soc-dock-row[hidden] { display: none; }
@keyframes socDockIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.soc-dock-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.soc-dock-cover {
    flex: none; width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(76,194,255,.30), rgba(76,194,255,.10));
    color: var(--accent, #4cc2ff);
    border: 1px solid rgba(76,194,255,.28);
    overflow: hidden;
}
.soc-dock-cover .hi { width: 18px; height: 18px; }
.soc-dock-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.soc-dock-title { font-size: 12px; font-weight: 600; color: #eef1f4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-dock-sub { font-size: 10px; color: rgba(230,234,238,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-dock-btn {
    flex: none; width: 26px; height: 26px; padding: 0; border-radius: 7px;
    border: none; background: transparent; color: rgba(230,234,238,.82);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.soc-dock-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.soc-dock-btn .hi { width: 15px; height: 15px; }
.soc-dock-play { color: #fff !important; background: rgba(76,194,255,.14) !important; }
.soc-dock-play:hover { background: rgba(76,194,255,.26) !important; }
.soc-dock-x:hover { background: rgba(232,17,35,.14) !important; color: #ff8a95 !important; }
.soc-dock-subrow { display: flex; align-items: center; gap: 6px; }
.soc-dock-subrow .soc-dock-btn { width: 24px; height: 24px; }
.soc-dock-subrow .soc-dock-btn .hi { width: 14px; height: 14px; }
/* Position slider, themed */
.soc-dock-prog {
    -webkit-appearance: none; appearance: none;
    flex: 1; min-width: 0; height: 4px; border-radius: 3px;
    background: rgba(255,255,255,.16); cursor: pointer; outline: none;
}
.soc-dock-prog::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--accent, #4cc2ff); border: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,.35);
    transition: transform .1s ease;
}
.soc-dock-prog::-webkit-slider-thumb:hover { transform: scale(1.2); }
.soc-dock-prog::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--accent, #4cc2ff); border: none; }
.soc-dock-prog::-moz-range-track { height: 4px; border-radius: 3px; background: rgba(255,255,255,.16); }
/* Persistent holder for the live <video> element — kept in the DOM (tiny, hidden)
   so it reliably keeps playing after the app body is wiped. */
.soc-dock-videohold { position: absolute; width: 2px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; }

/* v54: Dock — refined design (bolder title, subtle volume, full-width video) */
.soc-dock-vol { flex: none; width: 64px; display: flex; align-items: center; opacity: .55; transition: opacity .15s; }
.soc-dock-vol:hover { opacity: 1; }
.soc-dock-volslider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 3px; border-radius: 2px;
    background: rgba(255,255,255,.13); outline: none; cursor: pointer;
    transition: background .15s;
}
.soc-dock-volslider:hover { background: rgba(255,255,255,.24); }
.soc-dock-volslider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent, #4cc2ff); border: none; cursor: pointer;
    opacity: 0; transition: opacity .15s;
}
.soc-dock-vol:hover .soc-dock-volslider::-webkit-slider-thumb { opacity: 1; }
.soc-dock-volslider::-moz-range-thumb { width: 7px; height: 7px; border-radius: 50%; background: var(--accent, #4cc2ff); border: none; cursor: pointer; }
/* Clickable title/cover (opens the app) */
.soc-dock-open { cursor: pointer; user-select: none; }
.soc-dock-open:hover { color: var(--accent, #4cc2ff) !important; }
.soc-dock-cover.soc-dock-open:hover { background: rgba(76,194,255,.18); }
/* v55: Video preview — taller so the full video frame is visible */
.soc-dock-preview {
    width: 100%; height: 120px; border-radius: 8px 8px 0 0;
    overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.06);
    background: #0a0a0c; position: relative;
}
.soc-dock-preview[hidden] { display: none; }
.soc-dock-preview video, .soc-dock-preview canvas {
    display: block; width: 100%; height: 100%; object-fit: cover;
}
/* Bolder, more readable title */
.soc-dock-title { font-size: 13px; font-weight: 700; color: #f0f3f6; }
.soc-dock-sub { font-size: 10px; color: rgba(230,234,238,.45); }

/* v54: Live indicators — antenna on Home, dot on More, badge on Live */
.soc-live-badge {
    position: absolute; top: 4px; right: 6px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: #e94560; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    box-shadow: 0 0 6px rgba(233,69,96,.6);
}
.soc-live-badge[hidden] { display: none; }
.soc-home-navitem[data-appid="live"] { position: relative; }
/* Antenna on the Home/DM rail icon */
.soc-rail-home-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.soc-live-antenna {
    position: absolute; top: -2px; right: -2px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #e94560;
    box-shadow: 0 0 8px 2px rgba(233,69,96,.7);
    animation: socAntennaPulse 2s ease-in-out infinite;
}
.soc-live-antenna[hidden] { display: none; }
@keyframes socAntennaPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px 2px rgba(233,69,96,.7); }
    50% { opacity: .5; box-shadow: 0 0 4px 1px rgba(233,69,96,.4); }
}
/* Red dot on the "More" button */
.soc-live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #e94560;
    box-shadow: 0 0 5px 1px rgba(233,69,96,.6);
    flex: none;
    animation: socAntennaPulse 2s ease-in-out infinite;
}
.soc-live-dot[hidden] { display: none; }

/* v52: bolder rail icons (VLAN + download now render at 24px) */
.soc-rail-vlan svg, .soc-rail-dl svg { flex: none; }

/* ============ item 11j: sidebar management buttons + invite card ============ */
/* Create/manage buttons are revealed on hover of the row/section (Discord
   style). Touch devices have no hover, so they stay always visible. */
.soc-chan .soc-chan-mgmt { opacity: 0; transition: opacity .12s ease; }
.soc-chan:hover .soc-chan-mgmt,
.soc-chan:focus-within .soc-chan-mgmt { opacity: 1; }
#socLeftServer .soc-sec .soc-mini { opacity: 0; transition: opacity .12s ease; }
#socLeftServer .soc-sec:hover .soc-mini,
#socLeftServer .soc-sec:focus-within .soc-mini { opacity: 1; }
/* item 11p: while edit mode is ON, the ⚙ must stay visible (and highlighted) for
   the WHOLE session — the hover-reveal rule above faded it out as soon as the
   mouse left the top bar after the first click on anything else. */
#socLeft.soc-edit-mode #socEditMode { opacity: 1; }
@media (hover: none) {
    .soc-chan .soc-chan-mgmt,
    #socLeftServer .soc-sec .soc-mini { opacity: 1; }
}

/* Category header: type icon + access-rule (invite-only) hint */
.soc-cat-ic { display: inline-flex; margin-right: 5px; opacity: .8; vertical-align: -2px; }
.soc-cat-rule { display: inline-flex; margin-left: 5px; opacity: .7; vertical-align: -1px; }

/* Channel-invite card inside DMs (sent by the invite endpoint) */
.soc-invcard {
    display: flex; align-items: center; gap: 10px;
    max-width: 340px; margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-left: 3px solid var(--accent, #4cc2ff);
    border-radius: 10px;
    background: rgba(76,194,255,.07);
}
.soc-invcard-ic { color: var(--accent, #4cc2ff); display: inline-flex; flex: none; }
.soc-invcard-body { min-width: 0; }
.soc-invcard-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-invcard-sub { font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-invcard .soc-btn { margin-left: auto; white-space: nowrap; flex: none; }

/* Mobile: the BETA badge + invite code live in the servers rail (see
   .soc-rail-meta above) — hide the desktop header stack so they never show
   twice. Placed at the end of the file so it beats .soc-beta-stack's own
   display rule. */
@media (max-width: 768px) {
    .soc-beta-stack { display: none; }
}

/* Phase D: pinned messages */
.soc-pins-cnt { background: var(--accent, #4cc2ff); color: #08202e; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; margin-left: 4px; }
.soc-pins-panel { position: fixed; max-width: 100vw; background: var(--win-bg, #1e1f22); border: 1px solid var(--win-border, rgba(255,255,255,.1)); border-radius: 12px; overflow: hidden; z-index: 9999; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: transform .18s cubic-bezier(.2,.8,.3,1), opacity .15s ease; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.soc-pins-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.soc-pins-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); background: var(--win-bg-2, #26282c); flex: none; }
.soc-pins-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--win-text, #f2f3f5); }
.soc-pins-x { background: rgba(255,255,255,.06); border: none; color: var(--win-text, #f2f3f5); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.soc-pins-x:hover { background: rgba(255,255,255,.14); }
.soc-pins-x .hi { display: block; }
.soc-pins-list { flex: 1; overflow-y: auto; padding: 12px 14px; min-height: 0; }
.soc-pin-item { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.soc-pin-img { margin-bottom: 8px; max-height: 160px; }
.soc-pin-img img { max-width: 100%; border-radius: 6px; }
.soc-pin-text { font-size: 13px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; color: var(--win-text, #f2f3f5); }
.soc-pin-meta { font-size: 11.5px; color: #9aa1ab; margin-top: 6px; }
.soc-pin-acts { display: flex; gap: 6px; margin-top: 8px; }
.soc-pin-notext { opacity: .5; font-style: italic; }
.soc-pins-empty { text-align: center; padding: 34px 12px; font-size: 13px; color: var(--win-text-2, #b9bec7); }
.soc-pins-empty-ic { margin-bottom: 10px; color: var(--win-text-2, #b9bec7); opacity: .9; display: flex; justify-content: center; }
.soc-pins-empty-sub { font-size: 11.5px; opacity: .85; margin-top: 5px; }
.soc-mini-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: var(--win-text, #f2f3f5); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.soc-mini-btn:hover { background: rgba(255,255,255,.14); }
@media (max-width: 767px) { .soc-pins-panel { max-width: calc(100vw - 16px); } }
@media (prefers-reduced-motion: reduce) { .soc-pins-panel { transition: none; } }

/* @mention suggestions (composer) */
.soc-mentionpop { max-height: 240px; min-width: 270px; }
.soc-mentionpop .soc-filepop-item { gap: 10px; }
.soc-mentionpop .soc-filepop-item > span:first-child { width: 18px; text-align: center; }
.soc-ment-name { font-weight: 600; color: var(--win-text, #f2f3f5); }
.soc-ment-sub { margin-left: auto; font-size: 11px; opacity: .55; white-space: nowrap; }

/* ============================================================
   PROFILE MODAL (full profile — “Profile” right-click action)
   Dimmed overlay + centered card: identity left, tabs right.
   Palette matches .soc-popout (bg #2b2d31, border rgba(255,255,255,.08)).
   ============================================================ */
.soc-prof-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,.68);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .16s ease;
}
.soc-prof-overlay.show { opacity: 1; }
.soc-prof {
    position: relative;
    width: 100%;
    max-width: 720px;
    height: min(560px, calc(100vh - 40px)); /* fixed so switching tabs never resizes the window */
    max-height: min(560px, calc(100vh - 40px));
    display: flex;
    background: #2b2d31;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    box-shadow: 0 24px 72px rgba(0,0,0,.6), 0 6px 18px rgba(0,0,0,.4);
    overflow: hidden;
    transform: translateY(10px) scale(.98);
    transition: transform .16s ease;
}
.soc-prof-overlay.show .soc-prof { transform: none; }
.soc-prof-x {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 5;
    width: 30px; height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.07);
    color: var(--win-text, #f2f3f5);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.soc-prof-x:hover { background: rgba(255,255,255,.16); }
.soc-prof-left {
    flex: 0 0 250px;
    max-width: 250px;
    border-right: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.14);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.soc-prof-banner { height: 84px; flex: none; }
.soc-prof-banner .soc-popout-avatar-wrap { bottom: -26px; left: 16px; width: 52px; height: 52px; }
.soc-prof-id { padding: 34px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.soc-prof-selfnote, .soc-prof-selfonly {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--win-text-2, #b9bec7);
    opacity: .85;
    padding: 8px 2px;
}
.soc-prof-btns {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.soc-prof-btns .soc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 12.5px;
    white-space: nowrap;
}
.soc-prof-btns2 {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.soc-prof-btns2 .soc-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 11.5px;
    text-align: center;
    white-space: nowrap;
}
.soc-prof-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.soc-prof-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 12px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex: none;
}
.soc-prof-tab {
    appearance: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px 12px 10px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--win-text-2, #b9bec7);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.soc-prof-tab:hover { color: var(--win-text, #f2f3f5); }
.soc-prof-tab.active {
    color: var(--accent, #4cc2ff);
    border-bottom-color: var(--accent, #4cc2ff);
}
.soc-prof-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px 18px;
}
.soc-prof-body[hidden] { display: none; }
.soc-prof-grp {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--win-text-2, #b9bec7);
    opacity: .75;
    margin: 14px 0 8px;
}
.soc-prof-grp:first-child { margin-top: 2px; }
.soc-prof-filegrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
}

/* Shared Files: THUMBNAIL-FIRST tiles — the picture is the main element,
   the filename is a single truncated line. 12 per page + "Load more"
   (social.js: _profRenderFiles / _renderRightDmProfile). */
.soc-prof-tile {
    appearance: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.soc-prof-tile:hover {
    background: rgba(76,194,255,.1);
    border-color: rgba(76,194,255,.35);
    transform: translateY(-1px);
}
.soc-prof-tile:active { transform: none; }
.soc-prof-tileface {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.soc-prof-tileimg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.soc-prof-tileglyph { font-size: 26px; line-height: 1; }
.soc-prof-tilename {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--win-text, #f2f3f5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-prof-tilesub { font-size: 10px; color: var(--win-text-2, #9aa1ab); }
.soc-prof-morewrap { display: flex; justify-content: center; margin-top: 14px; }
.soc-prof-loadmore { min-width: 180px; }

/* DM right panel: compact mini-tiles (3-column grid). */
.soc-dmp-filegrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.soc-dmp-tile {
    appearance: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background .12s ease, border-color .12s ease;
}
.soc-dmp-tile:hover { background: rgba(76,194,255,.1); border-color: rgba(76,194,255,.35); }
.soc-dmp-tileface {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.soc-dmp-tileimg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.soc-dmp-tileglyph { font-size: 20px; line-height: 1; }
.soc-dmp-tilename {
    font-size: 10.5px;
    color: var(--win-text, #f2f3f5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-dmp-loadmore { width: 100%; margin-top: 10px; }

/* OWN PROFILE (self view): stats, storage bar, RTMP rows, app launchers. */
.soc-selfbody { display: flex; flex-direction: column; gap: 14px; }
.soc-self-sec {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
}
.soc-self-sec-t {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--win-text-2, #b9bec7);
}
.soc-self-sec-t svg { color: var(--accent, #4cc2ff); flex: none; }
.soc-self-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
}
.soc-self-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
}
.soc-self-statn { font-size: 17px; font-weight: 700; color: var(--win-text, #f2f3f5); }
.soc-self-statl { font-size: 10.5px; color: var(--win-text-2, #9aa1ab); letter-spacing: .2px; }
.soc-self-sub {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--win-text-2, #9aa1ab);
}
.soc-self-sub b { color: var(--win-text, #f2f3f5); }
.soc-self-store { display: flex; flex-direction: column; gap: 6px; }
.soc-self-storebar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
}
.soc-self-storebar span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(76,194,255,.7), #4cc2ff);
}
.soc-self-storetxt { font-size: 11.5px; color: var(--win-text-2, #9aa1ab); }
.soc-self-url {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 10px;
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
}
.soc-self-urltxt {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11.5px;
    color: var(--win-text-2, #b9bec7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-self-copy {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
}
.soc-self-openhero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
}
.soc-self-apps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 8px;
}
.soc-self-appbtn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 8px;
    font-size: 11px;
}
.soc-selfnote2 {
    flex: none;
    padding: 8px 14px 10px;
    border-top: 1px solid rgba(255,255,255,.07);
    font-size: 11px;
    line-height: 1.45;
    color: var(--win-text-2, #9aa1ab);
    opacity: .9;
}
.soc-prof-file {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    padding: 10px 12px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.soc-prof-file:hover {
    background: rgba(76,194,255,.1);
    border-color: rgba(76,194,255,.35);
    transform: translateY(-1px);
}
.soc-prof-file:active { transform: none; }
.soc-prof-fileic { font-size: 18px; line-height: 1; }
.soc-prof-filename {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--win-text, #f2f3f5);
    word-break: break-word;
    line-height: 1.35;
}
.soc-prof-filesub { font-size: 11px; color: var(--win-text-2, #9aa1ab); }
.soc-prof-frow {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background .12s ease, border-color .12s ease;
}
.soc-prof-frow:hover { background: rgba(76,194,255,.09); border-color: rgba(76,194,255,.3); }
.soc-prof-frow .soc-av { flex: none; }
.soc-prof-fname {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--win-text, #f2f3f5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-prof-fst { font-size: 11.5px; color: var(--win-text-2, #9aa1ab); flex: none; }
.soc-prof-fst.on { color: #23a55a; }
.soc-prof-srow { margin-bottom: 10px; }
.soc-prof-srow .soc-prof-frow { margin-bottom: 0; }
.soc-prof-sicon {
    width: 30px; height: 30px;
    border-radius: 8px;
    object-fit: cover;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.soc-prof-sinit {
    background: rgba(76,194,255,.18);
    color: var(--accent, #4cc2ff);
    font-weight: 700;
    font-size: 12px;
}
.soc-prof-since {
    font-size: 11.5px;
    color: var(--win-text-2, #9aa1ab);
    padding: 5px 10px 0;
    opacity: .9;
}
.soc-prof-body .soc-empty { padding: 30px 10px; }

/* Mobile: the profile modal goes full-screen (two stacked panes) */
@media (max-width: 767px) {
    .soc-prof-overlay { padding: 0; align-items: stretch; }
    .soc-prof {
        max-width: none;
        max-height: none;
        height: 100%;
        width: 100%;
        border-radius: 0;
        border: none;
        flex-direction: column;
    }
    .soc-prof-left {
        flex: none;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,.07);
    }
    .soc-prof-right { flex: 1; min-height: 0; }
    .soc-prof-x { top: 8px; right: 8px; }
    /* Never overflow the screen horizontally, whatever the content says. */
    .soc-prof { max-width: 100vw; min-width: 0; }
    .soc-prof-left { width: 100%; min-width: 0; overflow-x: hidden; }
    /* Action button rows must fit a 390px screen — wrap to a second row
       instead of clipping (the "Remove Frie…" / "C…opy ID" state). */
    .soc-prof-btns, .soc-prof-btns2 { flex-wrap: wrap; }
    .soc-prof-btns .soc-btn { flex: 1 1 140px; }
    .soc-prof-btns2 .soc-btn { flex: 1 1 90px; }
}

/* ============================================================
   DM RIGHT PANEL: compact peer profile (“Active Now” moves to home)
   ============================================================ */
.soc-dmp { padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.soc-dmp-head { display: flex; gap: 12px; align-items: flex-start; }
.soc-dmp-head .soc-av-wrap { flex: none; }
.soc-dmp-id { min-width: 0; }
.soc-dmp-name { font-size: 15.5px; font-weight: 700; color: var(--win-text, #f2f3f5); line-height: 1.3; }
.soc-dmp-user { font-size: 12.5px; color: var(--win-text-2, #b9bec7); margin-top: 1px; }
.soc-dmp-st {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--win-text-2, #b9bec7);
}
.soc-dmp-stats {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.soc-dmp-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
}
.soc-dmp-statn { font-size: 17px; font-weight: 700; color: var(--win-text, #f2f3f5); }
.soc-dmp-statl { font-size: 10.5px; color: var(--win-text-2, #9aa1ab); letter-spacing: .2px; }
.soc-dmp-since, .soc-dmp-files {
    font-size: 12px;
    color: var(--win-text-2, #9aa1ab);
    padding: 2px 2px;
}
.soc-dmp-files b { color: var(--win-text, #f2f3f5); }
.soc-dmp-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.soc-dmp-actions .soc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
}
/* DM panel hero header — centered avatar + identity (Discord-style). */
.soc-dmp-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 6px 0 2px;
    text-align: center;
    min-width: 0;
    max-width: 100%;
}
.soc-dmp-avhero {
    position: relative;
    width: 72px;
    height: 72px;
    flex: none;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(76,194,255,.32), 0 8px 22px rgba(0,0,0,.4);
}
.soc-dmp-avhero .soc-av { width: 72px; height: 72px; border-radius: 50%; font-size: 30px; }
.soc-dmp-avhero .soc-dot { width: 17px; height: 17px; border-width: 3px; border-color: #191919; right: -1px; bottom: -1px; }
.soc-dmp-hero .soc-dmp-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--win-text, #f2f3f5);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}
.soc-dmp-hero .soc-dmp-user { font-size: 12.5px; color: var(--win-text-2, #b9bec7); }
.soc-dmp-hero .soc-dmp-st { margin-top: 1px; justify-content: center; }
/* DM panel compact hero — the SAME palette layers as the settings avatar hero
   (JS paints the --h-* vars via _paintHeroEl; fallbacks match .soc-avhero).
   Layers back→front: base fill → blurred-avatar glow → gradients → grain → avatar. */
.soc-dmph {
    position: relative;
    width: 100%;
    height: 104px;
    flex: none;
    border-radius: 14px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #1e1f22;
    --h-c1:  rgb(64,105,159);
    --h-c2:  rgb(94,82,158);
    --h-c3:  rgb(58,66,92);
    --h-c1g: rgba(64,105,159,.50);
    --h-c2g: rgba(94,82,158,.42);
}
.soc-dmph-av {
    position: relative;
    z-index: 2;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    line-height: 0;
    box-shadow: 0 0 0 3px rgba(76,194,255,.32), 0 6px 18px rgba(0,0,0,.45);
}
.soc-dmph-av .soc-av { width: 60px; height: 60px; border-radius: 50%; font-size: 26px; }
.soc-dmph-av .soc-dot { width: 16px; height: 16px; border-color: #191919; right: -2px; bottom: -2px; }
/* One-line identity: name + @username (+ friend tag). Presence is the
   avatar's status dot — no separate status text. */
.soc-dmp-name1 {
    min-width: 0;
    max-width: 100%;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--win-text, #f2f3f5);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.soc-dmp-name1 .soc-dmp-user { font-size: 12.5px; font-weight: 500; color: var(--win-text-2, #b9bec7); margin: 0; }
/* DM panel quick-access app launchers (open the existing in-app apps). */
.soc-dmp-quickgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.soc-dmp-quick {
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 9px;
    color: var(--win-text, #e9eaec);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.soc-dmp-quick:hover { background: rgba(76,194,255,.12); border-color: rgba(76,194,255,.42); color: #fff; }
.soc-dmp-quick:active { background: rgba(76,194,255,.2); }
.soc-dmp-quick svg { flex: none; color: var(--accent, #4cc2ff); }
.soc-dmp-quick-wide { grid-column: 1 / -1; }
/* Quiet placeholder while the first mutual-info ack is in flight. */
.soc-dmp-pending { opacity: .55; letter-spacing: 1px; }
/* Hard guard: the DM panel must never scroll horizontally. */
#socRList { overflow-x: hidden; }
.soc-dmp { max-width: 100%; }
/* DM panel: labeled sections + clickable item rows (Mutual Friends /
   Mutual Servers / Shared Files — real lists, not counters). */
.soc-dmp-sec { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.soc-dmp-sec-t {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--win-text-2, #b9bec7);
    opacity: .8;
    margin-bottom: 8px;
}
.soc-dmp-item {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background .12s ease;
}
.soc-dmp-item:hover { background: rgba(255,255,255,.06); }
.soc-dmp-item img, .soc-dmp-item .soc-prof-thumb { flex: none; }
.soc-dmp-itemname {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--win-text, #f2f3f5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.soc-dmp-itemsub { flex: none; font-size: 11px; color: var(--win-text-2, #9aa1ab); }
.soc-dmp-itemsub.on { color: #23a55a; }
.soc-dmp-sicon {
    width: 26px; height: 26px;
    border-radius: 7px;
    object-fit: cover;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.soc-dmp-sinit {
    background: rgba(76,194,255,.18);
    color: var(--accent, #4cc2ff);
    font-weight: 700;
    font-size: 11px;
}
.soc-dmp-empty {
    padding: 8px 8px 4px;
    font-size: 12px;
    color: var(--win-text-2, #9aa1ab);
    opacity: .85;
}
/* Custom scrollbars: profile modal body + DM right panel (site language). */
.soc-prof-body::-webkit-scrollbar,
.soc-dmp::-webkit-scrollbar { width: 8px; height: 8px; }
.soc-prof-body::-webkit-scrollbar-track,
.soc-dmp::-webkit-scrollbar-track { background: transparent; }
.soc-prof-body::-webkit-scrollbar-thumb,
.soc-dmp::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.soc-prof-body::-webkit-scrollbar-thumb:hover,
.soc-dmp::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.30); }

/* ============================================================
   NICKNAME PROMPT (reuses the confirm-box card + overlay classes)
   ============================================================ */
.soc-nickcard { text-align: left; }
.soc-nickcard .soc-confirm-ic { margin-bottom: 12px; color: var(--accent, #4cc2ff); background: rgba(76,194,255,.12); }
.soc-nickcard .soc-confirm-title { margin-bottom: 8px; }
.soc-nickcard .soc-confirm-body {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--win-text-2, #b9bec7);
    margin-bottom: 12px;
    text-align: left;
}
.soc-nickcard .soc-confirm-reason { text-align: left; }
.soc-nickcard .soc-confirm-btns { justify-content: flex-end; }
.soc-nickcard .soc-nick-clear { margin-right: auto; }
/* Locked-nickname note (set by a moderator) + lock glyph in member rows. */
.soc-nick-locked {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(250,166,26,.08);
    border: 1px solid rgba(250,166,26,.25);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--win-text-2, #b9bec7);
}
.soc-nick-locked svg { color: #faa61a; flex: none; margin-top: 1px; }
.soc-nicklock { display: inline-flex; vertical-align: -1px; margin-left: 2px; color: #faa61a; opacity: .9; }
/* Shared Files: real image thumbnail with the type emoji as fallback. */
.soc-prof-thumb {
    position: relative;
    width: 24px; height: 24px;
    font-size: 15px; line-height: 1;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.soc-prof-thumbimg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
/* @role / @everyone mention pills: rendered but not clickable (no single
   profile to open) — keep the base tint, suppress the hover highlight. */
.soc-mention-noclk { cursor: default; }
.soc-mention-noclk:hover { background: rgba(88, 101, 242, .30); }
