/* ==========================================================================
   KSpeak · Modern Chat Theme
   Element-inspired layout · Manrope typography · Deep warm dark palette
   ========================================================================== */

/* Self-hosted brand fonts: keeps CSP strict and avoids production fallback typography. */
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("./fonts/manrope-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("./fonts/manrope-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("./fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("./fonts/jetbrains-mono-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/instrument-serif-regular-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Instrument Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/instrument-serif-regular-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Serif";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/instrument-serif-italic-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Instrument Serif";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/instrument-serif-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Background stack — warm-tinted dark */
    --bg-0: #08090c;            /* deepest (page) */
    --bg-1: #0e1014;            /* deep panel */
    --bg-2: #13151b;            /* rooms sidebar / members sidebar */
    --bg-3: #171922;            /* chat background */
    --bg-4: #1d2029;            /* elevated panels */
    --bg-5: #252934;            /* hover */
    --bg-6: #2f3442;            /* active / pressed */

    /* Borders */
    --border: rgba(255, 255, 255, 0.055);
    --border-strong: rgba(255, 255, 255, 0.095);
    --border-focus: rgba(45, 212, 191, 0.45);

    /* Text */
    --text: #e7ebf2;
    --text-soft: #cbd2de;
    --text-dim: #aab3c2;
    --text-muted: #939daf;
    --text-faint: #838da0;

    /* Accents */
    --accent: #2dd4bf;             /* teal primary */
    --accent-bright: #5eead4;
    --accent-dim: #14b8a6;
    --accent-wash: rgba(45, 212, 191, 0.12);
    --accent-glow: rgba(45, 212, 191, 0.35);

    --coral: #fb923c;              /* warm secondary (online/attention) */
    --coral-wash: rgba(251, 146, 60, 0.15);
    --violet: #a78bfa;
    --rose: #fb7185;
    --danger: #f87171;
    --warning: #fbbf24;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 32px var(--accent-glow);

    /* Radii */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-2xl: 24px;
    --r-full: 999px;

    /* Typography */
    --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
    --font-display: "Instrument Serif", Georgia, serif;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html {
    color-scheme: dark;
    min-height: 100%;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg-0);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
}

body {
    overflow: hidden;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: inherit;
    padding: 0;
}

:where(button, a, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.14);
}

::selection {
    background: var(--accent-wash);
    color: var(--accent-bright);
}

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--r-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
    background-clip: padding-box;
    border: 2px solid transparent;
}

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

.is-hidden { display: none !important; }

/* ==========================================================================
   PUBLIC SCREEN-SHARE VIEW
   ========================================================================== */

.public-share-view {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(ellipse 60% 40% at 20% 10%, rgba(45, 212, 191, 0.08), transparent 60%),
        radial-gradient(ellipse 50% 35% at 80% 90%, rgba(167, 139, 250, 0.07), transparent 60%),
        radial-gradient(ellipse 40% 25% at 90% 20%, rgba(251, 146, 60, 0.05), transparent 70%),
        var(--bg-0);
}

.public-share-view::before {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 42px 42px;
    content: "";
    pointer-events: none;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.public-share-topbar,
.public-share-layout {
    position: relative;
    z-index: 1;
    width: min(1480px, calc(100% - 48px));
    margin-inline: auto;
}

.public-share-topbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.public-share-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}

.public-share-brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 8px 24px -4px var(--accent-glow);
    color: #0a0b0e;
    font: 800 13px/1 var(--font-mono);
}

.public-share-brand > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.public-share-brand strong {
    font-size: 15px;
    letter-spacing: 0.01em;
}

.public-share-brand small {
    color: var(--text-dim);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.public-share-live-state {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(19, 21, 27, 0.88);
    box-shadow: var(--shadow-sm);
    color: var(--text-soft);
    font-size: 11px;
}

.public-share-live-state > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-dim);
    box-shadow: 0 0 0 4px rgba(136, 145, 161, 0.09);
}

.public-share-live-state.is-live {
    border-color: rgba(45, 212, 191, 0.28);
    color: var(--accent-bright);
}

.public-share-live-state.is-live > span {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.1), 0 0 16px rgba(45, 212, 191, 0.75);
    animation: pulse 1.45s ease-in-out infinite;
}

.public-share-live-state.is-error {
    border-color: rgba(248, 113, 113, 0.32);
    color: var(--rose);
}

.public-share-live-state.is-error > span {
    background: var(--rose);
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.1);
}

.public-share-layout {
    min-height: calc(100dvh - 100px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: start;
    gap: 16px;
    padding: 0 0 24px;
}

.public-share-player-card,
.public-share-viewers-card {
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)),
        var(--bg-2);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.public-share-player-head {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--border);
}

.public-share-player-head > div {
    min-width: 0;
}

.public-share-player-head span,
.public-share-viewers-card > header span:not(.public-share-viewer-count) {
    display: block;
    margin-bottom: 3px;
    color: var(--accent);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.public-share-player-head h1 {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(17px, 2vw, 23px);
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-share-player-head p {
    margin: 4px 0 0;
    color: var(--text-dim);
    font-size: 11.5px;
}

.public-share-player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.public-share-audio-btn,
.public-share-fullscreen-btn {
    min-height: 34px;
    padding: 7px 12px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-4);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
}

.public-share-audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-color: rgba(45, 212, 191, 0.34);
    background: rgba(13, 148, 136, 0.12);
    color: var(--accent-bright);
}

.public-share-audio-btn svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.public-share-audio-btn strong {
    font: inherit;
}

.public-share-audio-btn.is-muted .public-share-audio-wave {
    opacity: 0.25;
}

.public-share-audio-btn.needs-action {
    border-color: rgba(45, 212, 191, 0.72);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

.public-share-audio-btn:hover,
.public-share-fullscreen-btn:not(:disabled):hover {
    border-color: var(--border-focus);
    background: var(--accent-wash);
    color: var(--accent-bright);
}

.public-share-fullscreen-btn:disabled {
    opacity: 0.42;
    cursor: default;
}

.public-share-video-wrap {
    position: relative;
    min-height: 520px;
    height: calc(100dvh - 180px);
    max-height: 860px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--bg-0);
}

.public-share-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-0);
}

.public-share-recording-notice {
    position: absolute;
    z-index: 4;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid rgba(248, 113, 113, 0.42);
    border-radius: var(--r-full);
    background: rgba(22, 10, 13, 0.88);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    color: #fecdd3;
    font-size: 11px;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.public-share-recording-notice > span {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
    animation: pulse 1.15s ease-in-out infinite;
}

.public-share-video-wrap:fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: none;
}

.public-share-waiting,
.public-share-entry {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.public-share-waiting {
    padding: 28px;
    background:
        radial-gradient(circle at center, rgba(45, 212, 191, 0.055), transparent 34%),
        var(--bg-0);
}

.public-share-waiting-icon {
    position: relative;
    width: 58px;
    height: 39px;
    margin-bottom: 18px;
    border: 2px solid rgba(45, 212, 191, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 38px rgba(45, 212, 191, 0.11);
}

.public-share-waiting-icon::before {
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: rgba(45, 212, 191, 0.65);
    content: "";
    transform: translateX(-50%);
}

.public-share-waiting-icon::after {
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 2px;
    height: 8px;
    background: rgba(45, 212, 191, 0.65);
    content: "";
    transform: translateX(-50%);
}

.public-share-waiting strong {
    color: var(--text);
    font-size: 16px;
}

.public-share-waiting p {
    max-width: 380px;
    margin: 7px 0 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.55;
}

.public-share-entry {
    z-index: 2;
    padding: 26px;
    background:
        radial-gradient(circle at 50% 38%, rgba(45, 212, 191, 0.1), transparent 34%),
        rgba(8, 9, 12, 0.96);
}

.public-share-entry-kicker {
    color: var(--accent);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.public-share-entry h2 {
    margin: 7px 0 5px;
    color: var(--text);
    font-size: clamp(24px, 4vw, 38px);
    letter-spacing: -0.035em;
}

.public-share-entry > p {
    max-width: 480px;
    margin: 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.55;
}

.public-share-member-entry,
.public-share-guest-form {
    width: min(100%, 520px);
    margin-top: 22px;
}

.public-share-member-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--border-focus);
    border-radius: var(--r-lg);
    background: var(--accent-wash);
}

.public-share-entry-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.public-share-entry-identity > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 11px;
    background: var(--accent-wash);
    color: var(--accent-bright);
    font-weight: 850;
}

.public-share-entry-identity > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.public-share-entry-identity small {
    color: var(--text-dim);
    font-size: 9.5px;
}

.public-share-entry-identity strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-share-primary-btn {
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: var(--r-md);
    background: linear-gradient(180deg, var(--accent-bright), var(--accent-dim));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 8px 20px -6px var(--accent-glow);
    color: #081413;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.public-share-primary-btn:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

.public-share-primary-btn:disabled {
    opacity: 0.58;
    cursor: wait;
    filter: none;
    transform: none;
}

.public-share-guest-form {
    padding: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)),
        var(--bg-2);
    text-align: left;
}

.public-share-guest-form label {
    display: block;
    margin: 0 0 7px 2px;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 750;
}

.public-share-guest-form > div {
    display: flex;
    gap: 8px;
}

.public-share-guest-form input {
    min-width: 0;
    min-height: 40px;
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-4);
    color: var(--text);
    padding: 9px 11px;
    outline: none;
}

.public-share-guest-form input:focus {
    border-color: var(--border-focus);
    background: var(--bg-5);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

.public-share-guest-form > small {
    display: block;
    margin-top: 9px;
    color: var(--text-dim);
    font-size: 9.5px;
    line-height: 1.45;
}

.public-share-entry-notice {
    min-height: 18px;
    margin-top: 12px !important;
    color: var(--rose) !important;
    font-size: 10.5px !important;
}

.public-share-viewers-card {
    min-height: 420px;
    max-height: calc(100dvh - 100px);
    display: flex;
    flex-direction: column;
}

.public-share-viewers-card > header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.public-share-viewers-card > header strong {
    color: var(--text);
    font-size: 15px;
}

.public-share-viewer-count {
    min-width: 31px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-focus);
    border-radius: 999px;
    background: var(--accent-wash);
    color: var(--accent-bright);
    font: 800 11px/1 var(--font-mono);
}

.public-share-viewer-list {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.public-share-viewer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 11px;
}

.public-share-viewer-item:hover {
    background: var(--bg-4);
}

.public-share-viewer-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid var(--border-focus);
    border-radius: 10px;
    background: var(--accent-wash);
    color: var(--accent-bright);
    font-size: 11px;
    font-weight: 850;
}

.public-share-viewer-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.public-share-viewer-copy strong {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-share-viewer-copy small {
    margin-top: 1px;
    color: var(--text-dim);
    font-size: 9.5px;
}

.public-share-viewer-here {
    color: var(--accent);
    font-size: 9px;
    font-weight: 800;
}

.public-share-viewers-empty {
    min-height: 250px;
    display: grid;
    place-content: center;
    justify-items: center;
    color: var(--text-dim);
    text-align: center;
}

.public-share-viewers-empty span {
    color: var(--accent-dim);
    font-size: 30px;
}

.public-share-viewers-empty p {
    margin: 7px 0 0;
    font-size: 11px;
}

.public-share-viewers-card > footer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 13px 14px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 9.5px;
    line-height: 1.45;
}

.public-share-lock {
    position: relative;
    width: 11px;
    height: 9px;
    margin-top: 3px;
    flex-shrink: 0;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.public-share-lock::before {
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 6px;
    height: 6px;
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    content: "";
    transform: translateX(-50%);
}

@media (max-width: 900px) {
    .public-share-layout {
        grid-template-columns: 1fr;
    }
    .public-share-viewers-card {
        min-height: 230px;
        max-height: 360px;
    }
    .public-share-video-wrap {
        min-height: 420px;
        height: min(64dvh, 700px);
    }
}

@media (max-width: 600px) {
    .public-share-topbar,
    .public-share-layout {
        width: min(100% - 20px, 1480px);
    }
    .public-share-topbar {
        min-height: 66px;
    }
    .public-share-live-state strong {
        display: none;
    }
    .public-share-live-state {
        min-width: 34px;
        justify-content: center;
        padding-inline: 9px;
    }
    .public-share-player-card,
    .public-share-viewers-card {
        border-radius: 14px;
    }
    .public-share-player-head {
        min-height: 70px;
        padding: 12px;
        gap: 10px;
    }
    .public-share-player-head p {
        max-width: 210px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .public-share-video-wrap {
        min-height: 340px;
        height: 58dvh;
    }
    .public-share-player-actions {
        gap: 6px;
    }
    .public-share-audio-btn,
    .public-share-fullscreen-btn {
        min-height: 44px;
        padding: 7px 9px;
        font-size: 10.5px;
    }
    .public-share-entry {
        padding: 18px;
    }
    .public-share-member-entry,
    .public-share-guest-form > div {
        align-items: stretch;
        flex-direction: column;
    }
    .public-share-primary-btn {
        width: 100%;
    }
}

/* ==========================================================================
   App shell
   ========================================================================== */

.app-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==========================================================================
   AUTH VIEW
   ========================================================================== */

.auth-view {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    background: var(--bg-0);
}

body[data-auth-pending="1"] .auth-view {
    visibility: hidden;
    pointer-events: none;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 10%, rgba(45, 212, 191, 0.08), transparent 60%),
        radial-gradient(ellipse 50% 35% at 80% 90%, rgba(167, 139, 250, 0.07), transparent 60%),
        radial-gradient(ellipse 40% 25% at 90% 20%, rgba(251, 146, 60, 0.05), transparent 70%);
    pointer-events: none;
    animation: bg-drift 22s var(--ease-smooth) infinite alternate;
}

@keyframes bg-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-2%, 2%, 0) scale(1.05); }
}

.auth-view::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.auth-grid {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.7fr);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(20px, 3vw, 48px);
    gap: clamp(24px, 3vw, 48px);
    align-items: center;
    overflow-y: auto;
}

.auth-hero {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 560px;
}

.auth-hero-art {
    min-width: 0;
    max-width: none;
    gap: 14px;
}

.auth-hero-visual {
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(45, 212, 191, 0.24);
    border-radius: clamp(18px, 2vw, 30px);
    background: #020b15;
    box-shadow:
        0 30px 80px -34px rgba(0, 0, 0, 0.92),
        0 0 44px -28px rgba(34, 211, 238, 0.68),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset;
    isolation: isolate;
}

.auth-hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background:
        linear-gradient(130deg, rgba(45, 212, 191, 0.06), transparent 32%),
        linear-gradient(315deg, rgba(14, 165, 233, 0.05), transparent 42%);
    pointer-events: none;
}

.auth-hero-visual img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1744 / 907;
    object-fit: cover;
}

.auth-hero-art .auth-hero-footer {
    margin: 0 6px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-orb {
    width: 52px;
    height: 52px;
    border-radius: var(--r-lg);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.02em;
    color: #0a0b0e;
    background:
        linear-gradient(135deg, var(--accent-bright), var(--accent));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 8px 24px -4px var(--accent-glow);
}

.brand-wordmark {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    margin: 0;
}

.auth-hero :is(h1, h2) {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0;
    color: var(--text);
}

.auth-hero :is(h1, h2) em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    color: var(--accent-bright);
    letter-spacing: -0.01em;
}

.auth-lede {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0;
    max-width: 520px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.metric-card {
    position: relative;
    padding: 16px 16px 16px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.metric-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.metric-dot {
    position: absolute;
    left: 16px;
    top: 20px;
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
    background: var(--dot, var(--accent));
    box-shadow: 0 0 12px var(--dot, var(--accent));
}

.metric-card strong {
    padding-left: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.metric-card span:not(.metric-dot) {
    padding-left: 12px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
}

.auth-hero-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.status-pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: pulse 2.2s var(--ease-smooth) infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}

.auth-card {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card-inner {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
        var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.auth-card-inner::before {
    content: "";
    position: absolute;
    top: 0; left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.5), transparent);
}

.auth-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 4px;
    margin-bottom: 24px;
}

.auth-switch-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.guest-notice {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.06), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: var(--r-md);
    align-items: flex-start;
    margin-bottom: 4px;
}

.guest-notice svg {
    width: 18px;
    height: 18px;
    color: var(--accent-bright);
    flex-shrink: 0;
    margin-top: 1px;
}

.guest-notice p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-soft);
}

.guest-notice strong {
    color: var(--accent-bright);
    font-weight: 700;
}

.switch-btn {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    border-radius: var(--r-sm);
    transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.switch-btn.is-active {
    color: var(--text);
    background: var(--bg-6);
    box-shadow: inset 0 0 0 1px var(--border-strong);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stack label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stack label span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.stack label.remember-option {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
}

.remember-option input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: var(--accent-bright);
}

.stack label.remember-option span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-transform: none;
    letter-spacing: 0;
}

.remember-option strong {
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 700;
}

.remember-option small {
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.35;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-4);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

input::placeholder {
    color: var(--text-faint);
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--border-focus);
    background: var(--bg-5);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

.primary-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(180deg, var(--accent-bright), var(--accent-dim));
    color: #081413;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.005em;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out), filter 0.2s var(--ease-out);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 8px 20px -6px var(--accent-glow);
}

.primary-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 12px 28px -6px var(--accent-glow);
}

.primary-btn:active { transform: translateY(0); filter: brightness(0.95); }

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.primary-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s var(--ease-out);
}

.primary-btn:hover svg { transform: translateX(3px); }

.auth-inline-notice {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    min-height: 46px;
    display: flex;
    align-items: center;
}

.auth-foot {
    margin: 20px 0 0;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

.auth-foot a {
    color: var(--text-soft);
    text-decoration-color: rgba(45, 212, 191, 0.45);
    text-underline-offset: 3px;
}

.auth-foot a:hover {
    color: var(--accent-bright);
}

@media (max-width: 860px) {
    .auth-view { overflow-y: auto; }
    .auth-grid {
        grid-template-columns: 1fr;
        align-items: start;
        max-width: 760px;
        min-height: 100%;
        padding: 24px;
        gap: 22px;
        overflow: visible;
    }
    .auth-hero { order: 1; }
    .auth-card { order: 2; }
    .auth-card-inner { max-width: 560px; }
}

/* ==========================================================================
   APP VIEW · Grid
   ========================================================================== */

.app-view {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 300px 1fr 260px;
    background: var(--bg-3);
    overflow: hidden;
}

.app-view:not(.has-room) .members-sidebar {
    display: none;
}

.app-view:not(.has-room) {
    grid-template-columns: 300px 1fr;
}

@media (max-width: 1100px) and (min-width: 761px) {
    .app-view,
    .app-view:not(.has-room) {
        grid-template-columns: 260px 1fr;
    }
    .members-sidebar { display: none !important; }
}

@media (max-width: 760px) {
    body {
        min-width: 0;
        overscroll-behavior: none;
    }

    .app-shell {
        height: 100dvh;
        min-height: 100dvh;
    }

    /* Single-panel sliding layout: three columns are absolutely stacked,
       only one visible at a time via .mobile-view-* on app-view */
    .app-view,
    .app-view:not(.has-room) {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        position: relative;
    }

    .app-view > .rooms-sidebar,
    .app-view > .chat-area,
    .app-view > .members-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: calc(56px + env(safe-area-inset-bottom)); /* leave room for the bottom nav */
        width: 100%;
        min-height: 0;
        background: var(--bg-2);
        transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .app-view > .chat-area { background: var(--bg-3); }

    /* Default (rooms view) */
    .app-view > .rooms-sidebar { transform: translateX(0); z-index: 3; }
    .app-view > .chat-area { transform: translateX(100%); z-index: 2; }
    .app-view > .members-sidebar {
        display: flex !important;
        transform: translateX(100%);
        z-index: 4;
    }

    /* Chat view */
    .app-view.mobile-view-chat > .rooms-sidebar { transform: translateX(-100%); }
    .app-view.mobile-view-chat > .chat-area { transform: translateX(0); }
    .app-view.mobile-view-chat > .members-sidebar { transform: translateX(100%); }

    /* Members view */
    .app-view.mobile-view-members > .rooms-sidebar { transform: translateX(-100%); }
    .app-view.mobile-view-members > .chat-area { transform: translateX(-100%); }
    .app-view.mobile-view-members > .members-sidebar { transform: translateX(0); }

    /* Bottom navigation bar — fixed to viewport bottom */
    .mobile-nav {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(56px + env(safe-area-inset-bottom));
        display: flex;
        align-items: flex-start;
        background: var(--bg-2);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 20;
    }

    .rooms-sidebar {
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-topbar {
        min-height: 46px;
        padding: 9px 10px 7px;
        gap: 6px;
    }

    .session-profile {
        padding: 5px 8px;
        font-size: 11.5px;
    }

    .icon-btn-ghost {
        width: 30px;
        height: 30px;
    }

    .sidebar-search {
        margin: 8px 10px 4px;
    }

    .sidebar-search input {
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 12.5px;
    }

    .search-kbd {
        display: none;
    }

    .sidebar-scroll {
        padding: 6px 8px 8px;
    }

    .sidebar-section-head {
        padding: 5px 8px 4px;
    }

    .section-label {
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    .channel-join-card {
        margin: 0 2px 8px;
        padding: 9px;
        gap: 7px;
    }

    .channel-join-card > div {
        display: none;
    }

    .channel-join-row {
        gap: 6px;
    }

    .channel-join-row input {
        padding: 8px;
    }

    .room-list {
        gap: 2px;
    }

    .room-item {
        min-height: 38px;
    }

    .room-item-clickable {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 38px;
        padding: 6px 30px 6px calc(8px + min(var(--room-indent, 0px), 28px));
    }

    .room-avatar {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .room-title {
        font-size: 12.5px;
    }

    .room-subline {
        font-size: 10.5px;
    }

    .room-kebab {
        right: 5px;
    }

    .chat-area {
        min-height: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.025);
    }

    .chat-header {
        min-height: 48px;
        padding: 8px 10px;
        gap: 8px;
    }

    .chat-header-main {
        gap: 8px;
    }

    .chat-header-avatar {
        width: 32px;
        height: 32px;
    }

    .chat-header-text h2 {
        font-size: 14px;
    }

    .chat-topic {
        display: none;
    }

    .chat-header-actions {
        gap: 2px;
    }

    .chat-header-actions > .header-icon-btn:nth-last-child(-n + 2) {
        display: none;
    }

    .header-icon-btn {
        width: 32px;
        height: 32px;
    }

    .voice-strip {
        padding: 7px 10px;
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;
        font-size: 11px;
    }

    .voice-text {
        flex: 1 1 calc(100% - 18px);
        line-height: 1.35;
    }

    .voice-latency-chip,
    .voice-settings-chip,
    .voice-clear-chat-btn {
        margin-left: 0;
        padding: 3px 8px;
        font-size: 10.5px;
        min-width: auto;
    }

    .message-list {
        padding: 10px 0;
        gap: 0;
    }

    .message-item {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 3px 8px 3px 0;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        margin-top: 3px;
    }

    .message-copy {
        padding: 0 8px 0 8px;
    }

    .message-copy p {
        font-size: 13.5px;
        line-height: 1.5;
    }

    .message-log-item {
        padding: 5px 8px 5px 42px;
    }

    .message-log-line {
        gap: 6px;
        padding: 7px 10px;
    }

    .composer {
        padding:
            8px
            max(10px, env(safe-area-inset-right))
            calc(10px + env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left));
    }

    .composer-shell {
        border-radius: 14px;
        padding: 5px 5px 5px 10px;
    }

    .composer-shell input {
        font-size: 13.5px;
        padding: 7px 3px;
    }

    /* Bottom nav buttons */
    .mobile-nav-btn {
        flex: 1;
        height: 56px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 4px 6px;
        background: transparent;
        border: 0;
        color: var(--text-muted);
        cursor: pointer;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.01em;
        position: relative;
        transition: color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-btn svg {
        width: 21px;
        height: 21px;
    }

    .mobile-nav-btn.is-active {
        color: var(--accent-bright);
    }

    .mobile-nav-btn.is-active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 28px;
        height: 2.5px;
        background: var(--accent);
        border-radius: 0 0 3px 3px;
    }

    /* Badge for unread / pending counts on nav */
    .mobile-nav-badge {
        position: absolute;
        top: 5px;
        right: calc(50% - 20px);
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        background: var(--coral, #f87171);
        color: #fff;
        border-radius: 999px;
        font-size: 9px;
        font-weight: 700;
        display: grid;
        place-items: center;
        font-family: var(--font-mono);
    }

    .mobile-nav-badge.is-hidden { display: none; }

    /* Back button in chat header — shown only on mobile */
    .chat-header-back {
        display: grid !important;
        place-items: center;
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        background: transparent;
        border: 0;
        color: var(--text-soft);
        cursor: pointer;
        border-radius: var(--r-sm);
        margin-right: 2px;
    }

    .chat-header-back svg { width: 20px; height: 20px; }

    /* Members toggle button in chat header — shown on mobile */
    .chat-header-members-btn {
        display: grid !important;
    }

    /* Members sidebar back header on mobile */
    .members-mobile-back {
        display: flex !important;
    }
}

/* Desktop: hide all mobile-only chrome */
@media (min-width: 761px) {
    .mobile-nav { display: none; }
    .chat-header-back { display: none; }
    .chat-header-members-btn { display: none; }
    .members-mobile-back { display: none; }
}

/* ==========================================================================
   Column 1 · Rooms sidebar
   ========================================================================== */

.rooms-sidebar {
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sidebar-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}

.session-profile {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn-ghost {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    color: var(--text-dim);
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
    flex-shrink: 0;
}

.icon-btn-ghost svg { width: 16px; height: 16px; }
.icon-btn-ghost:hover { background: var(--bg-4); color: var(--text); }
#logoutBtn.icon-btn-ghost:hover {
    background: rgba(251, 113, 133, 0.1);
    color: var(--rose);
}

.sidebar-search {
    position: relative;
    margin: 12px 12px 4px;
}

.sidebar-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 13px;
    transition: all 0.2s var(--ease-out);
}

.sidebar-search input:focus {
    background: var(--bg-5);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-5);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    pointer-events: none;
}

.sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 8px 8px;
}

.sidebar-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 6px;
    user-select: none;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.section-label .caret {
    width: 12px;
    height: 12px;
    transition: transform 0.2s var(--ease-out);
}

.section-add-btn {
    width: 22px;
    height: 22px;
    border-radius: var(--r-xs);
    display: grid;
    place-items: center;
    color: var(--text-dim);
    transition: all 0.2s var(--ease-out);
}

.section-add-btn svg { width: 14px; height: 14px; }
.section-add-btn:hover {
    background: var(--bg-4);
    color: var(--accent);
}

/* Room creator drawer */
.room-creator {
    margin: 4px 4px 12px;
}
.room-creator > summary { display: none; }
.room-creator:not([open]) { display: none; }

.create-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
}

.create-form-head h3 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.create-form-head p {
    margin: 0;
    font-size: 11px;
    color: var(--text-dim);
}

.create-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.create-form label span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}
.create-form input, .create-form select {
    font-size: 13px;
    padding: 8px 10px;
}
.create-form .primary-btn { padding: 9px 14px; font-size: 13px; }


.channel-join-card {
    margin: 0 4px 12px;
    padding: 12px;
    border: 1px solid rgba(45, 212, 191, 0.22);
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.09), rgba(20, 184, 166, 0.03));
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.channel-join-card strong {
    display: block;
    font-size: 12px;
    color: var(--text);
}
.channel-join-card span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.35;
}
.channel-join-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}
.channel-join-row input {
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
}
.channel-code-panel {
    padding: 12px;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: var(--r-md);
    background: rgba(45, 212, 191, 0.045);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.channel-code-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.channel-code-actions .settings-hint {
    margin: 0;
    flex: 1 1 180px;
}
.channel-invite-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.channel-invite-link label {
    gap: 6px;
}
.channel-invite-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.channel-invite-link-row input[readonly] {
    color: var(--text-soft);
    background: rgba(15, 23, 42, 0.56);
    cursor: text;
}
.channel-invite-link-row .mini-btn:disabled {
    opacity: 0.46;
    cursor: not-allowed;
}

/* Room list */
.room-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 2px;
}

.room-item {
    position: relative;
    display: block;
    padding: 0;
    border-radius: var(--r-md);
    cursor: default;
    transition: background 0.15s var(--ease-out);
    min-height: 42px;
}

.room-item-clickable {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 7px 32px 7px calc(10px + var(--room-indent, 0px)); /* leave room for kebab on right */
    border-radius: var(--r-md);
    cursor: pointer;
    min-height: 42px;
}

.room-item:hover {
    background: var(--bg-4);
}

.room-item.is-active {
    background: var(--bg-5);
}

.room-item.is-active::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 2px;
}

.room-item.is-lobby {
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.06), transparent 80%);
}

.room-item.is-lobby:hover {
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.1), var(--bg-4) 80%);
}

.room-item.is-lobby.is-active {
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.14), var(--bg-5) 80%);
}

.room-item.is-lobby .room-title::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    margin-right: 6px;
    vertical-align: middle;
}

.room-item.is-private .room-title::after {
    content: "🔒";
    font-size: 9px;
    margin-left: 6px;
    opacity: 0.7;
    vertical-align: middle;
}

.room-item.is-nested .room-item-clickable::before {
    content: "";
    position: absolute;
    left: calc(14px + var(--room-indent, 0px) - 10px);
    top: 9px;
    bottom: 9px;
    width: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(45, 212, 191, 0.12));
    border-radius: 999px;
}

.room-item.is-nested .room-title-wrap::before {
    content: "";
    width: 10px;
    height: 1px;
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
    flex-shrink: 0;
}

.room-item.is-channel .room-title {
    font-weight: 700;
}

.room-item.is-nested .room-title {
    font-size: 13px;
}

/* Kebab menu (3-dot) inside each room item — revealed on hover */
.room-kebab {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    color: var(--text-dim);
    background: var(--bg-5);
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s var(--ease-out), color 0.15s var(--ease-out), background 0.15s var(--ease-out);
    z-index: 2;
}
.room-kebab svg { width: 14px; height: 14px; }
.room-item:hover .room-kebab,
.room-item.is-menu-open .room-kebab {
    opacity: 1;
    pointer-events: auto;
}
.room-kebab:hover {
    color: var(--text);
    background: var(--bg-6);
    border-color: var(--border-strong);
}
.room-item.is-menu-open .room-kebab {
    color: var(--accent);
    border-color: rgba(45, 212, 191, 0.3);
    background: var(--accent-wash);
}

/* Floating context menu */
.room-menu {
    position: fixed;
    min-width: 180px;
    padding: 4px;
    background: var(--bg-4);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    animation: modal-in 0.12s var(--ease-out);
}

.room-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    background: transparent;
    border: none;
    transition: background 0.12s var(--ease-out), color 0.12s var(--ease-out);
}
.room-menu-item:hover {
    background: var(--bg-5);
    color: var(--text);
}

.room-menu-item:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.room-menu-item:disabled:hover {
    background: transparent;
}

.room-menu-item.warn { color: var(--rose); }
.room-menu-item.warn:hover {
    background: rgba(251, 113, 133, 0.1);
    color: var(--rose);
}
.room-menu-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.8;
}
.room-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 2px;
}

/* Checkbox row in forms */
.checkbox-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    align-items: flex-start;
    padding: 10px 12px;
    background: var(--bg-5);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: var(--accent);
}
.checkbox-row > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.checkbox-row strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.checkbox-row span {
    font-size: 11.5px;
    color: var(--text-dim);
    line-height: 1.5;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Invite search input */
.invite-search-wrap {
    position: relative;
}
.invite-search-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}
.invite-search-wrap input {
    padding-left: 36px;
}

.room-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.room-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.room-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.room-title-wrap {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: -0.005em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.room-item.is-active .room-title {
    color: var(--text);
    font-weight: 700;
}

.room-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 5px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    flex-shrink: 0;
    line-height: 1.2;
    transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

.room-count svg {
    width: 11px;
    height: 11px;
    opacity: 0.85;
}

.room-count.is-live {
    color: var(--accent-bright);
    background: var(--accent-wash);
    border-color: rgba(45, 212, 191, 0.24);
}

.room-item.is-active .room-count.is-live {
    color: var(--accent-bright);
    background: rgba(45, 212, 191, 0.18);
    border-color: rgba(45, 212, 191, 0.36);
}

.room-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none; /* hidden by default; keep room item tight */
}

.room-meta-line {
    display: flex;
    gap: 8px;
    font-size: 10.5px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: lowercase;
}

.room-meta-line span:first-child {
    display: inline-block;
    padding: 1px 7px;
    background: var(--bg-4);
    border-radius: var(--r-full);
    font-weight: 500;
}

.room-item.is-active .room-meta-line span:first-child {
    background: var(--accent-wash);
    color: var(--accent-bright);
}

.sidebar-footer {
    display: none;
}

.notice {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-dim);
    padding: 6px 10px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
    max-height: 3.4em;
    white-space: normal;
    word-break: break-word;
    cursor: help;
}

.notice:hover,
.notice:focus-within {
    max-height: 14em;
    overflow: auto;
}

/* Empty state */
.empty-state {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.empty-state-chat {
    margin: auto;
    padding: 48px 24px;
    max-width: 320px;
}

.empty-state-orb {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    color: var(--accent);
}

.empty-state-orb svg { width: 28px; height: 28px; }

.empty-state-chat h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.empty-state-chat p {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
}

/* ==========================================================================
   Column 2 · Chat area
   ========================================================================== */

.chat-area {
    background: var(--bg-3);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    min-height: 56px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    z-index: 2;
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.chat-header-avatar {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-header-avatar .avatar {
    width: 100%;
    height: 100%;
    border-radius: var(--r-md);
    font-size: 14px;
}

.chat-header-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-header-text h2 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-topic {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.state-chip {
    padding: 4px 10px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-weight: 500;
    margin-right: 4px;
    white-space: nowrap;
}

.header-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    color: var(--text-dim);
    transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.header-icon-btn svg { width: 17px; height: 17px; }

.header-action-btn {
    width: auto;
    min-width: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.header-action-label {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.screen-share-glyph {
    position: relative;
    width: 17px;
    height: 12px;
    border: 1.8px solid currentColor;
    border-radius: 3px;
}

.screen-share-glyph::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 7px;
    height: 4px;
    transform: translateX(-50%);
    border-bottom: 1.8px solid currentColor;
}

.screen-record-global-btn {
    border: 1px solid rgba(248, 113, 113, 0.26);
    background: rgba(248, 113, 113, 0.055);
}

.screen-record-global-glyph {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border: 1.5px solid rgba(248, 113, 113, 0.78);
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.16);
}

.screen-record-global-btn.is-active {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.15);
    color: #fecdd3;
}

.screen-record-global-btn.is-active .screen-record-global-glyph {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.82);
    animation: pulse 1.15s ease-in-out infinite;
}

.screen-record-global-timer {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 800;
    color: #fff1f2;
}

.screen-share-glyph::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -3px;
    height: 3px;
    border-left: 1.8px solid currentColor;
    transform: translateX(-50%);
}

.screen-share-trigger.is-pending .screen-share-glyph {
    animation: screen-share-pending 0.85s ease-in-out infinite alternate;
}

.header-icon-btn:hover {
    background: var(--bg-4);
    color: var(--text);
}

.header-icon-btn.is-active {
    background: var(--accent-wash);
    color: var(--accent-bright);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.22);
}

.header-icon-btn.is-off {
    background: rgba(248, 113, 113, 0.08);
    color: var(--danger);
}

.header-icon-btn.is-off:hover {
    background: rgba(248, 113, 113, 0.14);
    color: #fca5a5;
}

.header-icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.header-icon-btn:disabled:hover {
    background: transparent;
    color: var(--text-dim);
}

/* Voice strip */
.voice-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: var(--bg-4);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
}

.voice-text {
    flex: 1;
    min-width: 0;
}

.voice-latency-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    padding: 4px 9px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.voice-latency-chip::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    content: "";
}

.voice-latency-chip.is-hidden {
    display: none;
}

.voice-latency-chip.is-very-good {
    border-color: rgba(34, 197, 94, 0.28);
    color: #22c55e;
}

.voice-latency-chip.is-good {
    border-color: rgba(45, 212, 191, 0.3);
    color: var(--accent-bright);
}

.voice-latency-chip.is-weak,
.voice-latency-chip.is-mid {
    border-color: rgba(251, 191, 36, 0.32);
    color: var(--warning);
}

.voice-latency-chip.is-bad {
    border-color: rgba(251, 113, 133, 0.34);
    color: var(--rose);
}

.voice-settings-chip {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--bg-5);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.16s var(--ease-out), border-color 0.16s var(--ease-out), color 0.16s var(--ease-out), transform 0.16s var(--ease-out);
}

.voice-settings-chip:hover {
    background: var(--accent-wash);
    border-color: var(--accent);
    color: var(--accent-bright);
    transform: translateY(-1px);
}

.voice-settings-chip.is-ptt {
    border-color: rgba(251, 191, 36, 0.32);
    color: var(--warning);
}

.voice-settings-chip.is-vad {
    border-color: rgba(34, 197, 94, 0.34);
    color: #86efac;
}

.voice-clear-chat-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: var(--r-full);
    border: 1px solid rgba(248, 113, 113, 0.28);
    background: rgba(248, 113, 113, 0.08);
    color: var(--danger);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.16s var(--ease-out), border-color 0.16s var(--ease-out), color 0.16s var(--ease-out), transform 0.16s var(--ease-out), opacity 0.16s var(--ease-out);
}

.voice-clear-chat-btn:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(248, 113, 113, 0.44);
    color: #fecaca;
    transform: translateY(-1px);
}

.voice-clear-chat-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.voice-strip.is-live {
    background: linear-gradient(90deg, var(--accent-wash), transparent 40%);
    color: var(--accent-bright);
}

.voice-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--text-faint);
    flex-shrink: 0;
}

.voice-strip.is-live .voice-dot {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

.voice-strip.is-warn { color: var(--warning); }
.voice-strip.is-warn .voice-dot { background: var(--warning); }

.voice-strip.is-screen-sharing {
    border-bottom-color: rgba(45, 212, 191, 0.2);
}

/* Screen sharing */
.screen-share-stage {
    position: relative;
    width: min(calc(100% - 32px), 980px, 103dvh);
    height: auto;
    max-width: 980px;
    max-height: none;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    margin: 18px auto 10px;
    overflow: hidden;
    border: 1px solid rgba(45, 212, 191, 0.34);
    border-radius: var(--r-xl);
    background: var(--bg-0);
    box-shadow:
        0 22px 54px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

.screen-share-stage-head {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px 10px;
    min-height: 0;
    flex: 0 0 auto;
    flex-wrap: wrap;
    padding: 7px 8px 7px 12px;
    border-bottom: 0;
    background:
        linear-gradient(180deg, rgba(8, 9, 12, 0.97) 0%, rgba(8, 9, 12, 0.86) 68%, transparent 100%);
    backdrop-filter: blur(5px);
}

.screen-share-stage-copy,
.screen-share-stage-copy > div {
    min-width: 0;
    display: flex;
}

.screen-share-stage-copy {
    align-items: center;
    flex: 1 1 190px;
    gap: 10px;
    overflow: hidden;
}

.screen-share-stage-copy > div {
    flex-direction: column;
    gap: 1px;
}

.screen-share-stage-copy span:not(.screen-share-live-dot) {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.screen-share-stage-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-share-live-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.8);
    animation: pulse 1.45s ease-in-out infinite;
}

.screen-share-stage.is-recording {
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow:
        0 22px 54px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(248, 113, 113, 0.08) inset;
}

.screen-share-stage.is-local-recording .screen-share-live-dot {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.82);
}

.screen-recording-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(248, 113, 113, 0.34);
    border-radius: var(--r-full);
    background: rgba(248, 113, 113, 0.1);
    color: #fecdd3 !important;
    font-size: 9.5px !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
}

.screen-recording-chip > span {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.85);
    animation: pulse 1.15s ease-in-out infinite;
}

.screen-recording-chip strong {
    color: #fff1f2;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 800;
}

.screen-share-quality-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: var(--r-full);
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent-bright) !important;
    font-family: var(--font-mono);
    font-size: 9.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    line-height: 1;
    text-transform: none !important;
    white-space: nowrap;
}

.screen-share-stage-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    flex: 1 1 360px;
    flex-wrap: wrap;
}

.screen-share-stage-btn {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--bg-5);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.055) inset,
        0 3px 10px rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.15;
    white-space: nowrap;
    transition:
        background 0.15s var(--ease-out),
        border-color 0.15s var(--ease-out),
        box-shadow 0.15s var(--ease-out),
        color 0.15s var(--ease-out),
        transform 0.15s var(--ease-out);
}

.screen-share-stage-btn:hover {
    border-color: var(--border-focus);
    background: var(--bg-6);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 6px 16px rgba(0, 0, 0, 0.26);
    color: var(--accent-bright);
    transform: translateY(-1px);
}

.screen-share-stage-btn.is-danger {
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(248, 113, 113, 0.14);
    color: #fecdd3;
}

.screen-share-stage-btn.is-danger:hover {
    border-color: rgba(248, 113, 113, 0.62);
    background: rgba(248, 113, 113, 0.23);
    box-shadow: 0 6px 18px rgba(248, 113, 113, 0.12);
    color: #fff1f2;
}

.screen-recording-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.screen-recording-btn > span {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 1px solid rgba(248, 113, 113, 0.7);
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.18);
}

.screen-recording-btn > strong {
    font-size: inherit;
    font-weight: inherit;
}

.screen-recording-btn.is-active {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.16);
    color: #fecdd3;
}

.screen-recording-btn.is-active > span {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
    animation: pulse 1.15s ease-in-out infinite;
}

#screenShareLinkBtn {
    border-color: rgba(45, 212, 191, 0.38);
    background: var(--accent-wash);
    color: var(--accent-bright);
}

#screenShareLinkBtn:hover {
    border-color: rgba(45, 212, 191, 0.62);
    background: rgba(45, 212, 191, 0.2);
    box-shadow: 0 6px 18px rgba(45, 212, 191, 0.12);
}

#screenShareFullscreenBtn {
    border-color: rgba(167, 139, 250, 0.38);
    background: rgba(167, 139, 250, 0.12);
    color: #ddd6fe;
}

#screenShareFullscreenBtn:hover {
    border-color: rgba(167, 139, 250, 0.62);
    background: rgba(167, 139, 250, 0.2);
    box-shadow: 0 6px 18px rgba(167, 139, 250, 0.12);
    color: #ede9fe;
}

.screen-share-video-wrap {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(45, 212, 191, 0.055), transparent 66%),
        var(--bg-0);
}

.screen-share-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-0);
}

.screen-share-stage:fullscreen {
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    flex: none;
    max-height: none;
    max-width: none;
    aspect-ratio: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
}

.screen-share-stage:fullscreen .screen-share-video-wrap {
    width: 100vw;
    height: 100%;
    min-height: 0;
    flex: 0 0 auto;
}

@keyframes screen-share-pending {
    from { opacity: 0.45; }
    to { opacity: 1; }
}

/* Message list */
.message-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 8px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    scroll-behavior: smooth;
}

.message-list:empty { display: flex; align-items: center; justify-content: center; }

.message-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    column-gap: 2px;
    padding: 4px 18px 4px 0;
    margin-left: 0;
    position: relative;
    transition: background 0.1s var(--ease-out);
    align-items: start;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.018);
}

.message-item.is-first-in-group {
    margin-top: 10px;
    padding-top: 6px;
}

.message-avatar {
    grid-row: 1 / 3;
    width: 36px;
    height: 36px;
    margin: 2px auto 0;
    justify-self: center;
    flex-shrink: 0;
    display: none; /* default: hidden (grouped), shown on first-in-group */
}

.message-item.is-first-in-group .message-avatar {
    display: grid;
}

.message-copy {
    min-width: 0;
    padding: 0 12px 0 10px;
    border-left: 2px solid var(--msg-accent, transparent);
}

.message-meta {
    display: none;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 1px;
}

.message-item.is-first-in-group .message-meta {
    display: flex;
}

.message-meta strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--msg-name, var(--text));
    letter-spacing: -0.005em;
}

.message-meta span {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 400;
}

.message-copy p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-soft);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-item:not(.is-first-in-group) .message-copy {
    position: relative;
}

/* show timestamp on hover for grouped messages */
.message-item:not(.is-first-in-group) .message-copy::before {
    content: attr(data-time);
    position: absolute;
    left: -60px;
    top: 3px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s var(--ease-out);
    width: 52px;
    text-align: right;
    pointer-events: none;
}

 .message-item:not(.is-first-in-group):hover .message-copy::before {
    opacity: 1;
}

.message-log-item {
    display: block;
    padding: 2px 18px 2px 56px;
    opacity: 0.7;
}

.message-log-item:hover {
    background: transparent;
}

.message-log-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 3px 8px;
    margin-left: 2px;
    border-left: 1px solid rgba(148, 163, 184, 0.2);
    background: transparent;
}

.message-log-time {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.message-log-copy,
.message-log-details {
    font-size: 11px;
    color: var(--text-dim);
}

.message-log-details summary {
    cursor: pointer;
    list-style-position: inside;
}

.message-log-details > span {
    display: block;
    padding: 3px 0 1px 15px;
    color: var(--text-muted);
}

/* Composer */
.composer {
    position: relative;
    overflow: visible;
    padding: 12px 18px 18px;
    background: var(--bg-3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.composer-shell {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 12px;
    background: var(--bg-4);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.composer-shell:focus-within {
    border-color: var(--border-focus);
    background: var(--bg-5);
    box-shadow: 0 0 0 4px var(--accent-wash);
}
.composer-shell input {
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text);
}

.composer-shell input:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}
.composer-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    color: var(--text-dim);
    transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out);
    flex-shrink: 0;
}

.composer-icon svg { width: 17px; height: 17px; }

.composer-icon:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.composer-send {
    width: 34px;
    height: 34px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    color: #081413;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    box-shadow: 0 2px 10px -2px var(--accent-glow);
    transition: transform 0.15s var(--ease-out), filter 0.15s var(--ease-out);
    flex-shrink: 0;
}

.composer-send svg { width: 16px; height: 16px; }

.composer-send:hover { transform: translateY(-1px); filter: brightness(1.05); }

 .composer-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.7);
}

.composer-emoji-picker {
    position: absolute;
    right: 18px;
    bottom: calc(100% - 6px);
    z-index: 30;
    width: min(380px, calc(100vw - 24px));
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at top, rgba(45, 212, 191, 0.08), transparent 48%),
        rgba(9, 13, 18, 0.96);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.28);
    padding: 12px;
}

.composer-emoji-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.composer-emoji-head strong {
    font-size: 12px;
    color: var(--text);
}

.composer-emoji-head span {
    font-size: 11px;
    color: var(--text-muted);
}

.composer-emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.composer-emoji-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    place-items: center;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.14s var(--ease-out), background 0.14s var(--ease-out), border-color 0.14s var(--ease-out);
}

.composer-emoji-btn:hover {
    transform: translateY(-1px);
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.24);
}

/* ==========================================================================
   Column 3 · Members sidebar
   ========================================================================== */

.members-sidebar {
    background: var(--bg-2);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}

.members-header .eyebrow {
    margin: 0 0 2px;
    font-size: 10px;
    letter-spacing: 0.14em;
}

.members-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.members-count {
    padding: 2px 9px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.member-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.member-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px 0;
}

.member-group-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.member-group-count {
    padding: 2px 8px;
    border-radius: var(--r-full);
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-size: 10px;
    font-family: var(--font-mono);
}

.member-group-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.member-group.is-offline .member-group-title {
    color: rgba(226, 232, 240, 0.62);
}

.member-group.is-offline .member-item {
    background: transparent;
    border-color: transparent;
    opacity: 0.6;
}
.member-group.is-offline .member-item:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.member-item {
    padding: 4px 8px;
    border-radius: var(--r-sm);
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.12s var(--ease-out);
    position: relative;
}

.member-item:nth-child(even) {
    background: transparent;
    border-color: transparent;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: transparent;
}

.member-header {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 8px;
    align-items: center;
}

.member-avatar-button {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: zoom-in;
}

.member-avatar {
    width: 26px;
    height: 26px;
    position: relative;
    transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), filter 0.16s var(--ease-out);
}
.member-avatar.avatar { width: 26px; height: 26px; font-size: 10px; }

.member-avatar-button:hover .member-avatar {
    transform: scale(1.08);
    filter: brightness(1.04);
    box-shadow: 0 10px 18px -14px rgba(15, 23, 42, 0.8);
}

.member-avatar-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--r-full);
}

.member-avatar::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background: var(--text-faint);
    border: 2px solid var(--bg-2);
    border-radius: var(--r-full);
}

.member-item .badge.is-accent + .member-avatar::after,
.member-item[data-online="1"] .member-avatar::after {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.member-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.member-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* name takes remaining space, audio icons sit flush right */
.member-meta > .member-title-wrap { flex: 1; min-width: 0; }
.member-meta > .member-audio-indicators {
    margin-left: auto;
}

.member-meta > .member-audio-status {
    margin-left: auto;
}

/* Presence is shown by the avatar dot — hide the redundant word badge
   that was squeezing names in the narrow panel. */
.member-meta > .badge {
    display: none;
}

.member-title-wrap {
    min-width: 0;
    flex: 1;
}

.member-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.member-item[data-online="1"] .member-name { color: var(--text); }
.member-item:hover .member-name { color: var(--text); }

.member-copy p {
    margin: 0;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: lowercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-role-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.member-role-row > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-audio-indicators {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.member-audio-status {
    display: inline-flex;
    align-items: center;
    max-width: 116px;
    padding: 3px 7px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-audio-status.is-live,
.member-audio-status.is-speaking {
    border-color: rgba(52, 211, 153, 0.28);
    background: rgba(52, 211, 153, 0.09);
    color: #34d399;
}

.member-audio-status.is-ready {
    border-color: rgba(94, 234, 212, 0.2);
    background: rgba(94, 234, 212, 0.07);
    color: #5eead4;
}

.member-audio-status.is-blocked {
    border-color: rgba(248, 113, 113, 0.25);
    background: rgba(248, 113, 113, 0.08);
    color: #f87171;
}

.member-audio-status.is-speaking {
    animation: member-voice-speaking 0.9s ease-in-out infinite;
}

.member-mic-indicator,
.member-voice-indicator {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}

.member-mic-indicator svg,
.member-voice-indicator svg {
    width: 15px;
    height: 15px;
}

/* Ses açık — canlı yeşil */
.member-mic-indicator.is-on,
.member-voice-indicator.is-on {
    color: #34d399;
    background: rgba(52, 211, 153, 0.16);
}

.member-mic-indicator.is-speaking,
.member-voice-indicator.is-speaking {
    animation: member-voice-speaking 0.9s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.32);
}

@keyframes member-voice-speaking {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.26); }
    50% { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.04); }
}

/* Ses hazır — sakin teal */
.member-voice-indicator.is-ready {
    color: #5eead4;
    background: rgba(94, 234, 212, 0.10);
}

.member-mic-indicator.is-muted {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.14);
}

/* Ses kapalı — kırmızı, üstü çizili hoparlör */
.member-mic-indicator.is-off,
.member-mic-indicator.is-blocked,
.member-voice-indicator.is-off {
    color: #f87171;
    background: rgba(248, 113, 113, 0.14);
}

.member-mic-indicator.is-blocked {
    background: rgba(248, 113, 113, 0.2);
}

.member-mic-slash,
.member-voice-slash {
    stroke-width: 2.6;
}

.member-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding-left: 34px;
    align-items: center;
}
.member-badges:empty {
    display: none;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: lowercase;
    color: var(--text-dim);
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    letter-spacing: 0.02em;
}

.badge.is-accent {
    color: var(--accent-bright);
    background: var(--accent-wash);
    border-color: rgba(45, 212, 191, 0.24);
}

.badge.is-warn {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.24);
}

.member-actions {
    display: flex;
    gap: 3px;
    margin-top: 5px;
    padding-left: 34px;
    flex-wrap: wrap;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.18s var(--ease-out), opacity 0.15s var(--ease-out), margin-top 0.18s var(--ease-out);
}

.member-item:hover .member-actions {
    max-height: 60px;
    opacity: 1;
    margin-top: 6px;
}

.member-actions .mini-btn {
    padding: 3px 6px;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
}

.mini-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--r-sm);
    background: var(--bg-4);
    border: 1px solid var(--border);
    color: var(--text-soft);
    transition: all 0.15s var(--ease-out);
    cursor: pointer;
}

.mini-btn:hover {
    background: var(--bg-5);
    color: var(--text);
    border-color: var(--border-strong);
}

.mini-btn.warn {
    color: var(--rose);
    border-color: rgba(251, 113, 133, 0.2);
}

.mini-btn.warn:hover {
    background: rgba(251, 113, 133, 0.1);
    border-color: rgba(251, 113, 133, 0.4);
}

.mini-btn.accent {
    color: var(--accent-bright);
    border-color: rgba(45, 212, 191, 0.2);
    background: rgba(45, 212, 191, 0.08);
}

.mini-btn.accent:hover {
    background: rgba(45, 212, 191, 0.14);
    border-color: rgba(45, 212, 191, 0.34);
}

.mini-select {
    width: auto;
    min-width: 96px;
    padding: 4px 26px 4px 10px;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 700;
    background-color: var(--bg-4);
}

/* ==========================================================================
   Avatars (generic)
   ========================================================================== */

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: -0.01em;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg,
            hsl(var(--avatar-hue, 180), 62%, 58%),
            hsl(calc(var(--avatar-hue, 180) + 35), 62%, 40%));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.avatar.has-image {
    background: rgba(255, 255, 255, 0.04);
}

.avatar.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.room-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.36) inset;
    background: rgba(7, 10, 20, 0.96);
    background-clip: padding-box;
}

.room-avatar.has-image {
    background: rgba(7, 10, 20, 0.98);
}

.room-avatar.has-image img {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: contain;
    object-position: center center;
    transform: none;
}

.room-item.is-active .room-avatar,
.chat-header-avatar .room-avatar {
    border-color: rgba(45, 212, 191, 0.34);
}

.member-avatar,
.message-avatar {
    border-radius: var(--r-full);
}

.message-avatar { font-size: 13px; }

 .pm-modal-root {
    z-index: 1160;
}

.pm-modal-card {
    position: relative;
    width: min(460px, calc(100vw - 28px));
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top, rgba(45, 212, 191, 0.11), transparent 48%),
        rgba(10, 14, 20, 0.97);
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.56);
    overflow: hidden;
}

.pm-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 2;
}

.pm-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.pm-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.pm-modal-avatar .avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 16px;
}

.pm-modal-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pm-modal-copy h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.pm-modal-copy span {
    font-size: 12px;
    color: var(--text-muted);
}

.pm-message-list {
    flex: 1;
    min-height: 220px;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pm-message-list .empty-state {
    margin: auto 0;
}

.pm-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pm-message.is-own {
    align-items: flex-end;
}

.pm-bubble {
    width: min(100%, 320px);
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
}

.pm-message.is-own .pm-bubble {
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    border-color: rgba(45, 212, 191, 0.34);
}

.pm-bubble-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.pm-bubble-meta strong {
    font-size: 12px;
    color: var(--text);
}

.pm-bubble-meta span {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.pm-message.is-own .pm-bubble-meta strong,
.pm-message.is-own .pm-bubble-meta span,
.pm-message.is-own .pm-bubble p {
    color: #081413;
}

.pm-bubble p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

.pm-composer {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-composer input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: var(--bg-4);
    color: var(--text);
}

.pm-composer input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-wash);
}

.member-avatar-preview-root {
    z-index: 1150;
}

.member-avatar-preview-card {
    position: relative;
    width: min(280px, calc(100vw - 28px));
    padding: 22px 20px 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top, rgba(45, 212, 191, 0.12), transparent 46%),
        rgba(10, 14, 20, 0.96);
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.56);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.member-avatar-preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.member-avatar-preview-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.member-avatar-preview-frame {
    width: 124px;
    height: 124px;
    display: grid;
    place-items: center;
}

.member-avatar-preview-media {
    width: 124px;
    height: 124px;
    font-size: 38px;
    box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.7);
}

.member-avatar-preview-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    text-align: center;
}

.member-avatar-preview-meta {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.avatar-uploader {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 12px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.avatar-uploader.compact {
    grid-template-columns: 56px minmax(0, 1fr);
}

.avatar-preview-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.avatar-preview {
    width: 52px;
    min-width: 52px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview .avatar {
    width: 52px;
    height: 52px;
    font-size: 14px;
}

.avatar-preview.is-room .avatar,
.avatar-preview .room-avatar {
    border-radius: var(--r-md);
}

.avatar-uploader.compact .avatar-preview,
.avatar-uploader.compact .avatar-preview .avatar {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    height: 48px;
}

.avatar-uploader-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.checkbox-row.compact-row {
    gap: 10px !important;
}

.checkbox-row.compact-row strong {
    display: block;
    margin-bottom: 2px;
}

@media (max-width: 640px) {
    .avatar-uploader,
    .avatar-uploader.compact {
        grid-template-columns: 1fr;
    }

    .avatar-preview-stack {
        flex-direction: row;
        align-items: center;
    }
}
/* Audio mount */
.audio-mount {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   Settings Modal
   ========================================================================== */

.modal-root {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modal-in 0.2s var(--ease-out);
}

@keyframes modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 6, 10, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modal-rise 0.25s var(--ease-out);
}

@keyframes modal-rise {
    from { transform: translateY(8px) scale(0.985); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-card::before {
    content: "";
    position: absolute;
    top: 0; left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.5), transparent);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-head .eyebrow {
    margin: 0 0 4px;
}

.modal-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.modal-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 16px 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.modal-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
    white-space: nowrap;
}

.modal-tab svg {
    width: 15px;
    height: 15px;
}

.modal-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
}

.modal-tab::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transition: transform 0.2s var(--ease-out);
}

.modal-tab.is-active {
    color: var(--text);
}

.modal-tab.is-active::after {
    transform: scaleX(1);
}

.modal-tab.is-hidden {
    display: none !important;
}

.modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-3);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
    animation: tab-fade 0.2s var(--ease-out);
}

@keyframes tab-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-group {
    padding: 16px 18px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-group + .settings-group {
    margin-top: 16px;
}

.settings-group h3 {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.settings-group label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-group label span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: -0.005em;
}

.read-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-5);
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}

.field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.field-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
}

.sharing-file-example {
    align-items: flex-start;
    gap: 14px;
}

.sharing-file-example .field-value {
    max-width: 74%;
    text-align: right;
    overflow-wrap: anywhere;
}

.settings-quality-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: var(--bg-5);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.settings-quality-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-quality-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.settings-quality-options button {
    display: flex;
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--bg-4);
    color: var(--text-soft);
    text-align: left;
    transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.settings-quality-options button:hover {
    border-color: var(--border-focus);
    background: var(--bg-6);
}

.settings-quality-options button.is-active {
    border-color: rgba(45, 212, 191, 0.46);
    background: var(--accent-wash);
    color: var(--accent-bright);
}

.settings-quality-options button strong {
    color: inherit;
    font-size: 12px;
}

.settings-quality-options button small {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
}

.settings-quality-audio {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    cursor: pointer;
}

.settings-quality-audio input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.settings-quality-lock-note {
    color: var(--text-dim);
    font-size: 10.5px;
    line-height: 1.45;
}

.settings-quality-options button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 620px) {
    .settings-quality-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .settings-quality-options {
        grid-template-columns: 1fr;
    }

    .settings-quality-options button {
        min-height: 48px;
    }
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.toggle-row > div strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    letter-spacing: -0.005em;
}

.toggle-row > div p {
    margin: 0;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
}

.toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.toggle-state-label {
    min-width: 52px;
    text-align: right;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.toggle-btn {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: var(--r-full);
    background: var(--bg-6);
    border: 1px solid var(--border-strong);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.toggle-btn .toggle-pill {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: var(--r-full);
    background: var(--text-dim);
    transition: transform 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.toggle-btn[data-locked="1"] {
    background: var(--accent-wash);
    border-color: rgba(45, 212, 191, 0.4);
}

.toggle-btn[data-locked="1"] .toggle-pill {
    transform: translateX(20px);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.danger-zone {
    border-color: rgba(248, 113, 113, 0.22) !important;
    background: rgba(248, 113, 113, 0.04) !important;
}

.danger-zone h3 {
    color: var(--danger);
}

.danger-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    flex-shrink: 0;
}

.danger-btn:hover {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.5);
    color: var(--text);
}

.settings-hint {
    margin: 2px 0 0;
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.55;
}

.ptt-key-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.1), transparent 34%),
        var(--bg-5);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
}

.ptt-key-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.field-label-inline {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: -0.005em;
}

.ptt-help-card {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(251, 191, 36, 0.18);
    background: rgba(251, 191, 36, 0.07);
}

.ptt-help-card strong {
    color: var(--text);
    font-size: 12.5px;
}

.ptt-help-card span {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.45;
}

.ptt-helper-download {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(34, 197, 94, 0.42);
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.98), rgba(22, 163, 74, 0.92));
    box-shadow: 0 14px 34px rgba(6, 78, 59, 0.26);
}

.ptt-helper-download-copy {
    display: grid;
    gap: 5px;
}

.ptt-helper-download-copy strong {
    color: #f3fff6;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ptt-helper-download-copy span {
    color: rgba(236, 253, 245, 0.96);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}


.ptt-helper-download-copy a {
    color: #ecfeff;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 800;
}

.ptt-helper-download-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.ptt-helper-download .mini-btn {
    white-space: nowrap;
    flex-shrink: 0;
    border-color: rgba(209, 250, 229, 0.34);
    background: rgba(240, 253, 244, 0.14);
    color: #f3fff6;
    font-weight: 800;
}

.ptt-helper-download .mini-btn:hover {
    background: rgba(240, 253, 244, 0.22);
    border-color: rgba(209, 250, 229, 0.56);
    color: #ffffff;
}

.vad-settings-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.11), transparent 34%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(12, 22, 18, 0.72));
    border: 1px solid rgba(34, 197, 94, 0.24);
    border-radius: var(--r-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.vad-settings-head,
.vad-meter-meta,
.vad-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vad-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 94px;
    padding: 4px 9px;
    border-radius: var(--r-full);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.vad-state-pill.is-speaking {
    border-color: rgba(34, 197, 94, 0.36);
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.18);
}

.vad-help-card {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(34, 197, 94, 0.18);
    background: rgba(34, 197, 94, 0.07);
}

.vad-help-card strong {
    color: var(--text);
    font-size: 12.5px;
}

.vad-help-card span {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.45;
}

.vad-profile-row {
    margin: 0;
}

.vad-profile-row span {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.vad-profile-row select {
    max-width: 260px;
}

.vad-meter {
    position: relative;
    height: 11px;
    overflow: hidden;
    border-radius: var(--r-full);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.09), rgba(148, 163, 184, 0.03)),
        rgba(2, 6, 23, 0.36);
}

.vad-meter::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0 var(--vad-threshold, 54%), rgba(251, 191, 36, 0.26) var(--vad-threshold, 54%) calc(var(--vad-threshold, 54%) + 2px), transparent calc(var(--vad-threshold, 54%) + 2px));
    pointer-events: none;
}

.vad-meter-fill {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.7), rgba(251, 191, 36, 0.72));
    box-shadow: 0 0 16px rgba(45, 212, 191, 0.18);
    transition: width 0.11s linear, background 0.16s var(--ease-out);
}

.vad-meter-fill.is-speaking {
    background: linear-gradient(90deg, #22c55e, #86efac);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.32);
}

.vad-meter-meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-muted);
}

.voice-command-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.1), transparent 36%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.74), rgba(9, 28, 32, 0.72));
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: var(--r-md);
}

.voice-command-card.is-active {
    border-color: rgba(45, 212, 191, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 16px 34px rgba(8, 47, 73, 0.15);
}

.voice-command-card.is-muted {
    border-color: rgba(251, 191, 36, 0.32);
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.1), transparent 36%),
        linear-gradient(135deg, rgba(24, 20, 10, 0.74), rgba(30, 22, 9, 0.72));
}

.voice-command-card.is-unsupported {
    opacity: 0.72;
}

.voice-command-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.voice-command-head p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.45;
}

.voice-command-phrases {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-command-phrases span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: var(--r-full);
    border: 1px solid rgba(45, 212, 191, 0.2);
    background: rgba(45, 212, 191, 0.08);
    color: #a7f3d0;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
}

.voice-command-admin-phrases span {
    border-color: rgba(251, 191, 36, 0.22);
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
}

.voice-command-media-phrases span {
    border-color: rgba(45, 212, 191, 0.22);
    background: rgba(45, 212, 191, 0.07);
    color: var(--accent-bright);
}

.screen-recording-folder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-5);
}

.screen-recording-folder-row > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.screen-recording-folder-row strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-recording-folder-row small {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
}

.screen-recording-folder-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.voice-action-modal-root {
    z-index: 5200;
}

.voice-action-card {
    position: relative;
    width: min(440px, 100%);
    padding: 26px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    background: var(--bg-3);
    box-shadow: var(--shadow-lg);
}

.voice-action-icon {
    display: block;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, var(--accent) 0 4px, transparent 5px),
        var(--accent-wash);
    box-shadow: 0 0 22px rgba(45, 212, 191, 0.1);
}

.voice-action-card .eyebrow {
    margin: 0 0 6px;
}

.voice-action-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.voice-action-card > p:not(.eyebrow) {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.55;
}

.voice-action-folder {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-5);
    color: var(--text-soft);
    font-size: 12px;
}

.voice-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.voice-action-buttons .primary-btn {
    width: auto;
    min-width: 170px;
}

.compact-toggle-row {
    padding: 10px 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.voice-command-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.voice-command-status span {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
}

.voice-command-status small {
    color: var(--text-muted);
    font-size: 10.5px;
}

.ptt-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ptt-preset-btn {
    min-height: 42px;
    padding: 8px 9px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-3);
    color: var(--text-soft);
    font-weight: 800;
    font-size: 12px;
    line-height: 1.1;
    cursor: pointer;
    transition: background 0.16s var(--ease-out), border-color 0.16s var(--ease-out), color 0.16s var(--ease-out), transform 0.16s var(--ease-out);
}

.ptt-preset-btn small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.ptt-preset-btn:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: var(--bg-4);
    color: var(--text);
}

.ptt-preset-btn.is-active {
    border-color: var(--accent);
    background: var(--accent-wash);
    color: var(--accent-bright);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.12);
}

.key-capture-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-3);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r-md);
    color: var(--text-soft);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), color 0.2s var(--ease-out);
    font-size: 13px;
    width: 100%;
}

.key-capture-btn:hover {
    background: var(--bg-4);
    border-color: var(--accent);
    color: var(--text);
}

.key-capture-btn.is-listening {
    border-style: solid;
    border-color: var(--border-focus);
    background: var(--accent-wash);
    color: var(--accent-bright);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
    animation: key-pulse 1.2s var(--ease-smooth) infinite;
}

@keyframes key-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12); }
    50%      { box-shadow: 0 0 0 8px rgba(45, 212, 191, 0.02); }
}

.key-capture-btn kbd {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 14px;
    background: var(--bg-5);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text);
    min-width: 72px;
    text-align: center;
    box-shadow:
        inset 0 -2px 0 rgba(0, 0, 0, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.04);
}

.key-capture-btn.is-listening kbd {
    background: var(--accent);
    color: #081413;
    border-color: var(--accent-bright);
    box-shadow: 0 0 0 1px var(--accent-bright);
}

.key-capture-btn span {
    font-size: 12.5px;
    color: var(--text-muted);
    flex: 1;
}

.key-capture-btn.is-listening span {
    color: var(--accent-bright);
    font-weight: 600;
}

/* PTT status indicator in voice strip */
.voice-strip.is-ptt-armed .voice-dot {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.voice-strip.is-ptt-talking .voice-dot {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 0.8s ease-in-out infinite;
}

.voice-strip.is-vad-listening {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.09), transparent 42%);
    color: #86efac;
}

.voice-strip.is-vad-listening .voice-dot {
    background: #22c55e;
    box-shadow: 0 0 9px rgba(34, 197, 94, 0.65);
}

.voice-strip.is-vad-speaking {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.16), transparent 44%);
    color: #bbf7d0;
}

.voice-strip.is-vad-speaking .voice-dot {
    background: #86efac;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.78);
    animation: pulse 0.72s ease-in-out infinite;
}

.voice-strip.is-command-muted {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.12), transparent 44%);
    color: var(--warning);
}

.voice-strip.is-command-muted .voice-dot {
    background: var(--warning);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.62);
}

@media (max-width: 720px) {
    .voice-strip {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .voice-settings-chip {
        margin-left: 18px;
    }

    .voice-latency-chip {
        margin-left: 18px;
    }

    .voice-clear-chat-btn {
        margin-left: 18px;
    }

    .ptt-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vad-settings-head,
    .vad-meter-meta,
    .vad-profile-row {
        align-items: stretch;
        flex-direction: column;
    }

    .vad-profile-row select {
        max-width: none;
    }

    .voice-command-head,
    .voice-command-status {
        align-items: stretch;
        flex-direction: column;
    }
}
.mini-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mini-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-5);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.mini-row .mini-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mini-row strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-row small {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.mini-row-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mini-row .avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
}

.mini-row[data-kind="ban"] {
    background: rgba(248, 113, 113, 0.05);
    border-color: rgba(248, 113, 113, 0.15);
}

.mini-row[data-kind="pending"] {
    background: rgba(251, 191, 36, 0.04);
    border-color: rgba(251, 191, 36, 0.18);
}

/* Responsive */
@media (max-width: 560px) {
    .modal-card { max-height: 95vh; }
    .modal-body { padding: 16px; }
    .modal-head { padding: 16px; }
    .modal-tabs { padding: 8px 8px 0; }
    .modal-tab { padding: 8px 10px 10px; }
    .mini-row { grid-template-columns: 30px 1fr; }
    .mini-row-actions { grid-column: 1 / -1; margin-top: 4px; }
    .sharing-file-example { flex-direction: column; }
    .sharing-file-example .field-value { max-width: 100%; text-align: left; }
    .screen-recording-folder-row {
        align-items: stretch;
        flex-direction: column;
    }
    .screen-recording-folder-actions,
    .voice-action-buttons {
        width: 100%;
    }
    .screen-recording-folder-actions > *,
    .voice-action-buttons > * {
        flex: 1;
    }
}

/* ==========================================================================
   Responsive refinements
   ========================================================================== */

@media (max-width: 640px) {
    .chat-header-actions .state-chip { display: none; }
    .chat-header { padding: 10px 12px; }
    .screen-share-stage {
        width: min(calc(100% - 16px), 92dvh);
        height: auto;
        max-width: calc(100% - 16px);
        max-height: none;
        min-height: 0;
        flex: 0 0 auto;
        aspect-ratio: 16 / 9;
        margin: 8px auto 10px;
        border-radius: var(--r-md);
    }
    .screen-share-stage-head {
        align-items: flex-start;
        padding: 8px 9px;
    }
    .screen-share-stage-copy > div > span {
        display: none;
    }
    .screen-share-stage-actions {
        gap: 4px;
    }
    .screen-share-stage-btn {
        padding-inline: 8px;
        font-size: 10.5px;
    }
    .composer { padding: 10px 12px 14px; }
    .composer-emoji-picker {
        left: 12px;
        right: 12px;
        bottom: calc(100% - 4px);
        width: auto;
    }
    .message-list { padding: 12px 4px 12px 0; }
    .message-item { padding-right: 12px; grid-template-columns: 48px 1fr; }
}

/* Final mobile stability layer: keep later legacy rules from reintroducing
   horizontal overflow or iOS input zoom. */
@media (max-width: 760px) {
    input[type="text"],
    input[type="password"],
    select,
    .composer-shell input,
    .pm-composer input {
        font-size: 16px;
    }


    .voice-latency-chip,
    .voice-settings-chip,
    .voice-clear-chat-btn {
        margin-left: 0;
    }

    .composer {
        padding:
            8px
            max(10px, env(safe-area-inset-right))
            calc(10px + env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left));
    }

    .modal-root,
    .pm-modal-root,
    .member-avatar-preview-root {
        padding: 8px;
        align-items: stretch;
    }

    .modal-card,
    .pm-modal-card {
        max-height: calc(100dvh - 16px);
        border-radius: 18px;
    }

    .modal-head {
        padding: 16px 16px 12px;
    }

    .modal-tabs {
        padding: 8px 8px 0;
        scrollbar-width: none;
    }

    .modal-tabs::-webkit-scrollbar {
        display: none;
    }

    .modal-tab {
        flex: 0 0 auto;
        padding: 9px 10px 11px;
    }

    .modal-body {
        padding: 14px;
    }

    .settings-group {
        padding: 13px;
    }
}

@media (max-width: 480px) {
    .auth-backdrop {
        background:
            linear-gradient(180deg, rgba(2, 10, 20, 0.72), rgba(2, 8, 16, 0.94)),
            url("./kspeak-login-hero.png?v=1.20.1") center top / cover no-repeat;
        opacity: 0.72;
        animation: none;
    }

    .auth-grid {
        align-items: center;
        padding: 14px;
        gap: 0;
    }

    .auth-card-inner {
        padding: 20px 16px;
        border-radius: 18px;
        background:
            linear-gradient(180deg, rgba(10, 24, 38, 0.9), rgba(5, 13, 24, 0.94)),
            var(--bg-2);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .auth-hero-art { display: none; }

    .auth-hero :is(h1, h2) {
        font-size: 25px;
    }

    .auth-lede {
        font-size: 13px;
        line-height: 1.5;
    }

    .hero-metrics,
    .auth-hero-footer {
        display: none;
    }

    .switch-btn {
        padding: 7px 6px;
        font-size: 12px;
    }


    .sidebar-topbar {
        min-height: 42px;
        padding: 7px 8px 6px;
    }

    .sidebar-search {
        margin: 6px 8px 3px;
    }

    .sidebar-scroll {
        padding: 5px 6px 7px;
    }

    .channel-join-card {
        padding: 7px;
        margin-bottom: 6px;
    }

    .room-item-clickable {
        min-height: 36px;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .chat-header {
        min-height: 44px;
        padding: 7px 8px;
    }

    .chat-header-avatar {
        width: 30px;
        height: 30px;
    }

    .header-icon-btn {
        width: 30px;
        height: 30px;
    }

    .voice-strip {
        padding: 6px 8px;
    }

    .message-item {
        grid-template-columns: 38px minmax(0, 1fr);
        padding-right: 6px;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
    }

    .message-log-item {
        padding-left: 38px;
    }
}


.system-mode-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.08), rgba(15, 23, 42, 0.32));
}
.system-mode-card h3 {
    margin-bottom: 6px;
}
.system-mode-card strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    margin-bottom: 4px;
}
.system-mode-card p {
    margin: 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
}
.system-mode-card.is-normal {
    border-color: rgba(251, 191, 36, 0.24);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(15, 23, 42, 0.32));
}

.channel-register-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-mode-hint {
    margin: -2px 0 0;
    padding: 9px 10px;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: var(--r-sm);
    background: rgba(45, 212, 191, 0.055);
    color: var(--text-dim);
    font-size: 11.5px;
    line-height: 1.45;
}
.auth-mode-hint.is-hidden,
.channel-register-fields.is-hidden {
    display: none !important;
}

/* Compact private-message dock */
.pm-dock {
    position: absolute;
    right: 12px;
    bottom: 82px;
    z-index: 12;
    width: 221px;
    max-height: 211px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.pm-dock::-webkit-scrollbar {
    width: 4px;
}

.chat-area.is-theater .pm-dock {
    display: none;
}

.pm-dock-item {
    height: 35px;
    min-height: 35px;
    flex: 0 0 35px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 7px;
    background: rgba(9, 14, 21, 0.96);
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(12px);
}

.pm-dock-item.is-active {
    border-color: rgba(45, 212, 191, 0.42);
    background: rgba(20, 52, 52, 0.96);
}

.pm-dock-item.is-unread {
    border-color: rgba(45, 212, 191, 0.72);
    animation: pm-dock-alert 2.2s ease-in-out infinite;
}

.pm-dock-open {
    min-width: 0;
    min-height: 33px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    color: var(--text-soft);
    text-align: left;
}

.pm-dock-open:hover,
.pm-dock-open:focus-visible {
    background: rgba(45, 212, 191, 0.09);
    color: var(--text);
    outline: none;
}

.pm-dock-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-dock-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--r-full);
    background: var(--accent);
    color: #06211f;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
}

.pm-dock-close {
    width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    flex: 0 0 auto;
    color: var(--text-dim);
    font-size: 15px;
    transition: width 0.14s var(--ease-out), opacity 0.14s var(--ease-out), background 0.14s var(--ease-out);
}

.pm-dock-item:hover .pm-dock-close,
.pm-dock-item:focus-within .pm-dock-close {
    width: 25px;
    opacity: 1;
}

.pm-dock-close:hover,
.pm-dock-close:focus-visible {
    background: rgba(248, 113, 113, 0.13);
    color: #fda4af;
    outline: none;
}

@keyframes pm-dock-alert {
    0%, 100% {
        opacity: 0.68;
        background: rgba(9, 14, 21, 0.9);
        box-shadow: 0 8px 22px rgba(2, 6, 23, 0.28);
    }
    50% {
        opacity: 1;
        background: rgba(16, 48, 48, 0.98);
        box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2), 0 10px 28px rgba(13, 148, 136, 0.28);
    }
}

/* PM opens as a lightweight window beside the members panel. */
.pm-modal-root {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 276px 84px 0;
    pointer-events: none;
}

.pm-modal-root .modal-backdrop {
    display: none;
}

.pm-modal-card {
    width: min(390px, calc(100vw - 28px));
    max-height: min(60vh, 540px);
    pointer-events: auto;
    border-radius: 14px;
}

.pm-modal-head {
    min-height: 52px;
    padding: 10px 78px 9px 14px;
}

.pm-modal-avatar,
.pm-modal-copy .eyebrow {
    display: none;
}

.pm-modal-copy h3 {
    font-size: 14px;
}

.pm-modal-copy span {
    font-size: 10.5px;
}

.pm-modal-close,
.pm-modal-minimize {
    top: 10px;
    width: 27px;
    height: 27px;
}

.pm-modal-close {
    right: 10px;
}

.pm-modal-minimize {
    position: absolute;
    right: 42px;
    border-radius: var(--r-full);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 2;
    font-size: 18px;
    line-height: 1;
}

.pm-modal-minimize:hover {
    background: rgba(45, 212, 191, 0.11);
    color: var(--accent-bright);
}

.pm-message-list {
    min-height: 180px;
}

@media (max-width: 1100px) and (min-width: 761px) {
    .pm-modal-root {
        padding-right: 16px;
    }
}

@media (hover: none) {
    .pm-dock-close {
        width: 25px;
        opacity: 1;
    }
}

@media (max-width: 760px) {
    .pm-dock {
        right: 10px;
        bottom: 84px;
        width: min(214px, calc(100vw - 20px));
        max-height: 158px;
    }

    .pm-modal-root {
        align-items: flex-end;
        justify-content: center;
        padding: 8px 8px calc(72px + env(safe-area-inset-bottom));
    }

    .pm-modal-card {
        width: 100%;
        max-height: min(72dvh, 580px);
        border-radius: 16px;
    }
}

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

/* ========================================================================== 
   Product reliability and accessibility surfaces
   ========================================================================== */

.auth-hero-visual picture {
    display: block;
    width: 100%;
    height: 100%;
}

.auth-switch [role="tab"][aria-selected="true"],
.modal-tab[aria-selected="true"] {
    color: var(--text);
}

.password-field {
    position: relative;
    display: block !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.password-field input {
    padding-right: 76px;
}

.password-toggle {
    position: absolute;
    top: auto;
    right: 7px;
    bottom: 6px;
    min-width: 58px;
    min-height: 32px;
    padding: 0 9px;
    transform: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--bg-5);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
    text-transform: none;
    letter-spacing: 0;
}

.password-toggle:hover {
    color: var(--text);
    background: var(--bg-6);
}

details.channel-register-fields {
    display: block;
    padding: 10px 12px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.025);
}

.channel-register-fields > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 750;
    list-style-position: inside;
}

.channel-register-fields > summary small {
    padding: 2px 7px;
    border-radius: var(--r-full);
    background: var(--accent-wash);
    color: var(--accent-bright);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.channel-register-fields[open] > summary {
    margin-bottom: 12px;
}

.channel-register-fields > label + label {
    margin-top: 12px;
}

.channel-register-fields > .password-field {
    margin-top: 12px;
}

.channel-register-fields > .auth-mode-hint {
    margin: 0 0 12px;
}

.toggle-btn[aria-checked="true"] {
    background: var(--accent-wash);
    border-color: rgba(45, 212, 191, 0.4);
}

.toggle-btn[aria-checked="true"] .toggle-pill {
    transform: translateX(20px);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.connection-status-band {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    border-bottom: 1px solid rgba(251, 191, 36, 0.32);
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.13), rgba(251, 146, 60, 0.06));
    color: var(--text-soft);
}

.connection-status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12);
}

.connection-status-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
}

.connection-status-copy strong {
    color: var(--text);
    font-size: 12px;
    white-space: nowrap;
}

.connection-status-copy span {
    overflow: hidden;
    color: var(--text-dim);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connection-status-band[data-state="offline"] {
    border-color: rgba(248, 113, 113, 0.34);
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.14), rgba(251, 146, 60, 0.05));
}

.connection-status-band[data-state="offline"] .connection-status-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.13);
}

.connection-status-band[data-state="online"] {
    border-color: rgba(45, 212, 191, 0.28);
    background: rgba(45, 212, 191, 0.08);
}

.connection-status-band[data-state="online"] .connection-status-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
}

.unread-center-trigger {
    position: relative;
}

.unread-center-glyph {
    width: 16px;
    height: 13px;
    border: 1.7px solid currentColor;
    border-radius: 5px;
}

.unread-center-glyph::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    margin: 8px 0 0 -3px;
    border-left: 1.7px solid currentColor;
    border-bottom: 1.7px solid currentColor;
    transform: skewY(-35deg);
}

.global-unread-badge {
    position: absolute;
    top: -3px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border: 2px solid var(--bg-3);
    border-radius: var(--r-full);
    background: var(--coral);
    color: #15100b;
    font-family: var(--font-mono);
    font-size: 8.5px;
    font-weight: 900;
}

.compact-dialog-root {
    z-index: 1320;
}

.compact-dialog-card {
    position: relative;
    width: min(520px, calc(100vw - 28px));
    max-height: min(78vh, 680px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    background: var(--bg-2);
    box-shadow: var(--shadow-lg);
}

.compact-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.compact-dialog-head .eyebrow {
    margin: 0 0 3px;
}

.compact-dialog-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.compact-dialog-head h2 span {
    display: inline-grid;
    min-width: 24px;
    min-height: 20px;
    margin-left: 5px;
    place-items: center;
    border-radius: var(--r-full);
    background: var(--accent-wash);
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 10px;
}

.unread-center-list,
.global-search-results {
    min-height: 170px;
    overflow-y: auto;
    padding: 12px;
}

.compact-dialog-actions {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.global-search-field {
    display: block;
    padding: 14px 16px 0;
}

.global-search-field input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    outline: none;
    background: var(--bg-4);
    color: var(--text);
}

.global-search-field input::placeholder {
    color: var(--text-faint);
}

.info-card-content {
    display: grid;
    gap: 16px;
    padding: 20px;
    color: var(--text-dim);
}

.info-card-content p {
    margin: 0;
}

.info-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.info-card-content > a {
    color: var(--accent-bright);
    text-underline-offset: 3px;
}

.device-check-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(45, 212, 191, 0.22);
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.075), rgba(255, 255, 255, 0.02));
}

.device-check-head,
.recording-recovery-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.device-check-head strong {
    color: var(--text);
}

.device-check-head p,
.recording-recovery-head p {
    margin: 3px 0 0;
    color: var(--text-dim);
    font-size: 11.5px;
}

#deviceCheckStatus {
    padding: 3px 8px;
    border-radius: var(--r-full);
    background: var(--bg-6);
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.device-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.device-check-item {
    display: grid;
    align-content: space-between;
    gap: 10px;
    min-height: 105px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: rgba(5, 8, 12, 0.24);
}

.device-check-item > div {
    display: grid;
    gap: 2px;
}

.device-check-item strong {
    color: var(--text-soft);
    font-size: 11.5px;
}

.device-check-item span {
    color: var(--text-muted);
    font-size: 10.5px;
}

.recording-recovery-card {
    border-color: rgba(251, 191, 36, 0.25);
}

.recording-recovery-head h3 {
    margin-bottom: 0;
}

#recordingRecoveryStatus {
    margin: 0;
    color: var(--text-dim);
    font-size: 11.5px;
}

.recording-recovery-list {
    display: grid;
    gap: 8px;
}

.pm-modal-actions-btn {
    position: absolute;
    top: 10px;
    right: 74px;
    z-index: 3;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    font-size: 12px;
    letter-spacing: 1px;
}

.pm-modal-actions-btn:hover {
    background: rgba(45, 212, 191, 0.11);
    color: var(--accent-bright);
}

.pm-actions-menu {
    position: absolute;
    top: 43px;
    right: 10px;
    z-index: 5;
    width: min(240px, calc(100% - 20px));
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--bg-4);
    box-shadow: var(--shadow-md);
}

.pm-actions-menu button {
    width: 100%;
    padding: 10px 12px;
    color: var(--text-soft);
    text-align: left;
    font-size: 11.5px;
}

.pm-actions-menu button:hover,
.pm-actions-menu button:focus-visible {
    background: var(--bg-6);
    color: var(--text);
}

.pm-actions-menu #pmBlockUserBtn,
.pm-actions-menu #pmReportUserBtn {
    color: #fda4af;
}

.pm-modal-head {
    padding-right: 112px;
}

.admin-reports-group {
    display: grid;
    gap: 12px;
}

.admin-reports-head,
.admin-reports-tools,
.admin-report-card-head,
.admin-report-actions {
    display: flex;
    align-items: center;
}

.admin-reports-head {
    justify-content: space-between;
    gap: 16px;
}

.admin-reports-head h3,
.admin-reports-head p,
.admin-report-card p {
    margin: 0;
}

.admin-reports-head p {
    margin-top: 4px;
    color: var(--text-3);
    font-size: 12px;
}

.admin-reports-tools,
.admin-report-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.admin-report-count {
    display: inline-grid;
    min-width: 24px;
    height: 22px;
    place-items: center;
    margin-left: 5px;
    padding: 0 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-3);
    font-size: 11px;
    vertical-align: middle;
}

.admin-report-count.has-pending {
    border-color: rgba(251, 191, 36, 0.42);
    background: rgba(251, 191, 36, 0.1);
    color: #fde68a;
}

.admin-reports-list {
    display: grid;
    gap: 10px;
}

.admin-report-card {
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--r-lg);
    background: var(--bg-3);
    background: color-mix(in srgb, var(--bg-3) 88%, transparent);
}

.admin-report-card.is-pending { border-left-color: #fbbf24; }
.admin-report-card.is-reviewed { border-left-color: #38bdf8; }
.admin-report-card.is-actioned { border-left-color: #34d399; }
.admin-report-card.is-dismissed { border-left-color: #64748b; }

.admin-report-card-head {
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.admin-report-card-head > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-report-card-head strong {
    color: var(--text-1);
    overflow-wrap: anywhere;
}

.admin-report-card-head span,
.admin-report-target-meta,
.admin-report-review-meta {
    color: var(--text-3);
    font-size: 11px;
}

.admin-report-status {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-2);
}

.admin-report-reason,
.admin-report-snapshot {
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border-radius: var(--r-md);
    background: rgba(2, 6, 23, 0.32);
}

.admin-report-reason small,
.admin-report-snapshot small {
    color: var(--text-3);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.admin-report-reason p,
.admin-report-snapshot p {
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.admin-report-snapshot {
    border: 1px solid rgba(45, 212, 191, 0.13);
}

.admin-reports-more {
    justify-self: center;
}

@media (max-width: 760px) {
    [data-mobile-panel][aria-hidden="true"] {
        visibility: hidden;
        pointer-events: none;
    }

    [data-mobile-panel][aria-hidden="false"] {
        visibility: visible;
        pointer-events: auto;
    }

    .chat-header-actions #unreadCenterBtn,
    .chat-header-actions #infoBtn {
        display: grid !important;
    }

    .admin-reports-head,
    .admin-report-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-reports-tools .mini-select {
        flex: 1 1 150px;
    }

    .connection-status-band {
        align-items: flex-start;
        padding: 8px 10px;
    }

    .connection-status-copy {
        display: grid;
        gap: 1px;
    }

    .connection-status-copy span {
        white-space: normal;
    }

    .connection-status-band .mini-btn {
        align-self: center;
        white-space: nowrap;
    }

    .device-check-grid {
        grid-template-columns: 1fr;
    }

    .device-check-item {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .compact-dialog-root {
        padding: 8px;
        align-items: flex-end;
    }

    .compact-dialog-card {
        width: 100%;
        max-height: min(82dvh, 680px);
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .connection-status-band {
        flex-wrap: wrap;
    }

    .connection-status-copy {
        flex-basis: calc(100% - 24px);
    }

    .connection-status-band .mini-btn {
        width: 100%;
    }

    .device-check-head,
    .recording-recovery-head {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ========================================================================== 
   PRIVACY / LEGAL PAGE
   ========================================================================== */

body.legal-body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 12% 8%, rgba(45, 212, 191, 0.13), transparent 31rem),
        radial-gradient(circle at 88% 24%, rgba(251, 146, 60, 0.08), transparent 28rem),
        var(--bg-0);
}

.legal-shell {
    position: relative;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 80px;
}

.legal-shell::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0;
    opacity: 0.25;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

.legal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0 32px;
}

.legal-brand,
.legal-back {
    color: inherit;
    text-decoration: none;
}

.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.legal-brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(45, 212, 191, 0.4);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(45, 212, 191, 0.2), rgba(45, 212, 191, 0.04));
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 12px;
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.12);
}

.legal-back {
    padding: 9px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text-soft);
    font-size: 12px;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.legal-back:hover {
    border-color: rgba(45, 212, 191, 0.34);
    background: var(--accent-wash);
    color: var(--accent-bright);
}

.legal-hero {
    max-width: 850px;
    padding: clamp(34px, 7vw, 86px) 0 clamp(42px, 7vw, 78px);
}

.legal-hero .eyebrow {
    margin: 0 0 18px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
}

.legal-hero h1 {
    max-width: 820px;
    margin: 0;
    color: #f4f7fb;
    font-family: var(--font-display);
    font-size: clamp(42px, 6.2vw, 76px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.legal-hero > p:not(.eyebrow) {
    max-width: 690px;
    margin: 24px 0 12px;
    color: var(--text-soft);
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.65;
}

.legal-hero > span {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.legal-layout {
    display: grid;
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
    gap: clamp(28px, 6vw, 74px);
    align-items: start;
}

.legal-summary {
    position: sticky;
    top: 28px;
    padding: 22px;
    border: 1px solid rgba(45, 212, 191, 0.16);
    border-radius: var(--r-xl);
    background: linear-gradient(145deg, rgba(29, 32, 41, 0.95), rgba(14, 16, 20, 0.9));
    box-shadow: var(--shadow-md);
}

.legal-summary > strong {
    display: block;
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.legal-summary > p {
    margin: 13px 0 20px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.65;
}

.legal-summary dl,
.legal-summary dl div {
    margin: 0;
}

.legal-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.legal-summary dt,
.legal-summary dd {
    margin: 0;
    font-size: 11px;
}

.legal-summary dt { color: var(--text-dim); }
.legal-summary dd { color: var(--text); font-weight: 700; text-align: right; }

.legal-content {
    min-width: 0;
}

.legal-content section {
    padding: 0 0 34px;
    margin: 0 0 34px;
    border-bottom: 1px solid var(--border);
}

.legal-content section:last-child {
    margin-bottom: 0;
    border-bottom: 0;
}

.legal-content h2 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 18px;
    letter-spacing: -0.025em;
}

.legal-content p,
.legal-content li {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.78;
}

.legal-content p { margin: 0; }
.legal-content ul { margin: 0; padding-left: 20px; }
.legal-content li + li { margin-top: 9px; }
.legal-content strong { color: var(--text-soft); }
.legal-content a { color: var(--accent-bright); text-underline-offset: 3px; }

@media (max-width: 760px) {
    .legal-shell {
        width: min(100% - 28px, 680px);
        padding-top: 14px;
    }

    .legal-nav { padding-bottom: 18px; }
    .legal-hero { padding-top: 34px; }
    .legal-layout { grid-template-columns: 1fr; }
    .legal-summary { position: static; }
    .legal-content section { padding-bottom: 28px; margin-bottom: 28px; }
}

/* ==========================================================================
   Screen share · Faz 1 eklentileri (kalite menüsü, sinema, küçültme, ses)
   ========================================================================== */

.screen-share-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    margin-left: 6px;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.screen-share-timer {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 2px 7px;
    letter-spacing: 0.04em;
}

.screen-share-viewer-chip {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-bright);
    background: var(--accent-wash);
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: var(--r-full);
    padding: 2px 7px;
    white-space: nowrap;
}

.screen-share-audio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-right: 6px;
    margin-right: 2px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-share-audio input[type="range"] {
    width: 84px;
    accent-color: var(--accent);
}

/* Mini oynatıcı: görüntü görünür kalır, yalnızca oynatıcı küçülür */
.screen-share-stage.is-collapsed {
    width: min(calc(100% - 32px), 640px, 74dvh);
    height: auto;
    max-width: 640px;
    max-height: none;
    min-height: 0;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
}

.screen-share-stage.is-collapsed .screen-share-video-wrap {
    display: grid;
}

/* Geniş oynatıcı: yayın oda alanını doldurur, sohbet geçici olarak gizlenir */
.chat-area.is-theater .message-list,
.chat-area.is-theater .composer,
.chat-area.is-theater .voice-strip {
    display: none !important;
}

.chat-area.is-theater .screen-share-stage {
    width: calc(100% - 28px);
    max-width: none;
    flex: 1 1 auto;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    margin: 14px;
}

/* Kalite seçim menüsü */
.screen-share-anchor {
    position: relative;
    display: inline-flex;
}

.screen-share-quality-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1180;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 250px;
    padding: 10px;
    background: var(--bg-4);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
}

.screen-share-quality-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 2px 6px 6px;
}

.screen-quality-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.screen-share-quality-pop :is([data-share-quality], [data-record-quality]) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    text-align: left;
}

.screen-share-quality-pop :is([data-share-quality], [data-record-quality]):hover {
    background: var(--bg-5);
}

.screen-share-quality-pop :is([data-share-quality], [data-record-quality]).is-active {
    background: var(--accent-wash);
    border-color: rgba(45, 212, 191, 0.3);
}

.screen-share-quality-pop :is([data-share-quality], [data-record-quality]) strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.screen-share-quality-pop :is([data-share-quality], [data-record-quality]) small {
    font-size: 11px;
    color: var(--text-dim);
}

.quality-recommended {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 1px 5px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: var(--r-full);
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent-bright);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.screen-share-quality-audio {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-soft);
    border-top: 1px solid var(--border);
    cursor: pointer;
}

.screen-share-quality-audio input {
    accent-color: var(--accent);
}

.screen-quality-note {
    display: block;
    padding: 4px 10px 2px;
    color: var(--text-dim);
    font-size: 10px;
    line-height: 1.35;
}

/* Üye listesi: yayın rozeti */
.badge.is-live-share {
    color: var(--accent-bright);
    background: var(--accent-wash);
    border-color: rgba(45, 212, 191, 0.3);
}

/* Klavye odağı */
.screen-share-stage-btn:focus-visible,
.screen-share-quality-pop :is([data-share-quality], [data-record-quality]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 760px) {
    .screen-share-meta { margin-left: 6px; }
    .screen-share-audio input[type="range"] { width: 60px; }
    .screen-share-stage-actions { flex-wrap: wrap; justify-content: flex-end; }
    .screen-share-quality-pop { right: -8px; width: min(250px, calc(100vw - 32px)); }
    .chat-area.is-theater .screen-share-stage {
        margin: 8px;
        height: auto;
        aspect-ratio: auto;
    }
}

@container (max-width: 680px) {
    .screen-share-stage-copy,
    .screen-share-stage-actions {
        width: 100%;
        flex-basis: 100%;
    }

    .screen-share-stage-actions {
        justify-content: flex-start;
    }
}

@container (max-width: 440px) {
    .screen-share-stage-copy > div > span {
        display: none;
    }

    .screen-share-meta {
        margin-left: auto;
    }

    .screen-share-viewer-chip {
        max-width: 132px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Üst-orta, tam metinli uygulama bildirimleri */
.app-toast-region {
    position: fixed;
    z-index: 5000;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    width: min(540px, calc(100% - 28px));
    display: grid;
    pointer-events: none;
    transform: translateX(-50%);
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 11px 11px 11px 14px;
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-md);
    background: var(--bg-4);
    box-shadow: var(--shadow-lg);
    color: var(--text-soft);
    font-size: 12.5px;
    line-height: 1.45;
    pointer-events: auto;
    backdrop-filter: blur(16px);
    animation: app-toast-in 0.2s var(--ease-out);
}

.app-toast.is-success { border-left-color: #22c55e; }
.app-toast.is-warning { border-left-color: var(--warning); }
.app-toast.is-error { border-left-color: var(--rose); }

.app-toast-copy {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.app-toast-close {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    border-radius: var(--r-sm);
    color: var(--text-dim);
    font-size: 19px;
    line-height: 1;
}

.app-toast-close:hover {
    background: var(--bg-6);
    color: var(--text);
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}

@keyframes app-toast-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1280px) and (min-width: 761px) {
    .header-action-btn {
        width: 34px;
        padding: 0;
    }

    .header-action-label {
        display: none;
    }

    .screen-record-global-timer {
        display: none;
    }
}

@media (max-width: 760px) {
    .header-action-btn {
        width: 30px;
        min-width: 30px;
        padding: 0;
    }

    .header-action-label {
        display: none;
    }

    .screen-record-global-timer {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast,
    .app-toast.is-leaving,
    .member-audio-status.is-speaking,
    .public-share-recording-notice > span,
    .screen-recording-chip > span,
    .screen-recording-btn.is-active > span,
    .screen-record-global-btn.is-active .screen-record-global-glyph {
        animation: none;
        transition: none;
    }

    .pm-dock-item.is-unread {
        animation: none;
    }
}

/* ==========================================================================
   Responsive action access · touch, tablet members drawer and narrow header
   ========================================================================== */

.room-item:focus-within .room-kebab,
.room-kebab:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.member-item:focus-within .member-actions {
    max-height: 180px;
    opacity: 1;
    margin-top: 6px;
}

.room-menu-item:focus-visible,
.member-actions .mini-btn:focus-visible,
.header-overflow-menu button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.header-overflow-anchor {
    position: relative;
    display: none;
}

.header-overflow-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1220;
    display: grid;
    width: min(250px, calc(100vw - 16px));
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    background: var(--bg-4);
    box-shadow: var(--shadow-lg);
}

.header-overflow-menu button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 650;
    text-align: left;
}

.header-overflow-menu button:hover {
    background: var(--bg-5);
    color: var(--text);
}

.header-overflow-menu :is(svg, .unread-center-glyph) {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.header-overflow-record-glyph {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid rgba(248, 113, 113, 0.8);
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.14);
}

@media (max-width: 1100px) and (min-width: 761px) {
    .app-view {
        position: relative;
    }

    .chat-header-members-btn {
        display: grid !important;
        width: 44px;
        height: 44px;
    }

    .app-view > .members-sidebar {
        position: absolute;
        inset: 0 0 0 auto;
        z-index: 80;
        display: flex !important;
        width: min(320px, calc(100% - 48px));
        border-left-color: var(--border-strong);
        box-shadow: -18px 0 38px rgba(0, 0, 0, 0.34);
        transform: translateX(104%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.22s var(--ease-out), visibility 0s linear 0.22s;
    }

    .app-view.mobile-view-members > .members-sidebar {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .members-mobile-back {
        display: grid !important;
        width: 44px;
        height: 44px;
        margin-right: 4px;
    }

    .app-view:not(.has-room) > .members-sidebar,
    .app-view:not(.has-room) .chat-header-members-btn {
        display: none !important;
    }
}

@media (hover: none), (pointer: coarse) {
    .room-item,
    .room-item-clickable {
        min-height: 44px;
    }

    .room-item-clickable {
        padding-right: 50px;
    }

    .room-kebab {
        right: 3px;
        width: 40px;
        height: 40px;
        opacity: 1;
        pointer-events: auto;
        background: transparent;
        border-color: transparent;
    }

    .room-kebab:active {
        color: var(--accent-bright);
        background: var(--accent-wash);
    }

    .member-actions,
    .member-item:hover .member-actions {
        max-height: 180px;
        opacity: 1;
        margin-top: 6px;
    }

    .member-actions .mini-btn,
    .room-menu-item {
        min-height: 40px;
    }

    .member-avatar-button {
        width: 40px;
        height: 40px;
    }

    .member-header {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .member-actions {
        padding-left: 48px;
    }

    .header-icon-btn,
    .chat-header-back {
        min-width: 40px;
        height: 40px;
    }
}

@media (max-width: 760px) {
    .screen-share-quality-pop {
        position: fixed;
        top: auto;
        right: max(8px, env(safe-area-inset-right));
        bottom: calc(64px + env(safe-area-inset-bottom));
        left: max(8px, env(safe-area-inset-left));
        z-index: 1300;
        width: auto;
        max-height: calc(100dvh - 84px - env(safe-area-inset-bottom));
        padding: 12px;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 18px;
        box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.42);
    }

    .screen-share-quality-pop :is([data-share-quality], [data-record-quality]) {
        min-height: 52px;
        padding: 9px 11px;
    }

    .screen-share-quality-audio {
        min-height: 44px;
    }

    .room-menu {
        top: auto !important;
        right: max(8px, env(safe-area-inset-right));
        bottom: calc(64px + env(safe-area-inset-bottom));
        left: max(8px, env(safe-area-inset-left)) !important;
        width: auto;
        min-width: 0;
        max-height: calc(100dvh - 84px - env(safe-area-inset-bottom));
        padding: 8px;
        overflow-y: auto;
        border-radius: 18px;
    }

    .room-menu-item {
        min-height: 44px;
        padding: 10px 12px;
    }

    .header-icon-btn,
    .header-action-btn,
    .chat-header-back {
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0;
    }
}

@media (max-width: 560px) {
    .header-overflow-anchor {
        display: inline-flex;
    }

    .chat-header-actions > #screenRecordGlobalBtn,
    .chat-header-actions > #globalSearchBtn,
    .chat-header-actions > #unreadCenterBtn,
    .chat-header-actions > #infoBtn,
    .screen-record-anchor > #screenRecordGlobalBtn {
        display: none !important;
    }

    .chat-header-members-btn {
        display: none !important;
    }

    .screen-record-anchor {
        width: 0;
    }

    .chat-header {
        min-height: 52px;
        gap: 4px;
        padding: 6px 8px;
    }

    .chat-header-main {
        flex: 1 1 52px;
        gap: 6px;
    }

    .chat-header-actions {
        gap: 2px;
    }
}

@media (max-width: 360px) {
    .chat-header-avatar {
        display: none !important;
    }

    .chat-header-text h2 {
        font-size: 12.5px;
    }
}
