/* --------------------------------------------------------------------------
   Channel-first management + voice channel stage
   -------------------------------------------------------------------------- */
.category-header-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px;
    align-items: center;
    gap: 2px;
}

.category-add-button {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--dashboard-text-dim);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.category-add-button:hover {
    background: var(--hover);
    color: var(--dashboard-text);
}

@media (hover: hover) and (pointer: fine) {
    .category-add-button {
        opacity: 0;
        transition: opacity 100ms ease, background 100ms ease, color 100ms ease;
    }

    .category-header-row:hover .category-add-button,
    .category-header-row:focus-within .category-add-button,
    .category-add-button:focus-visible {
        opacity: 1;
    }
}

.channel-row-wrap {
    position: relative;
    min-width: 0;
}

.category-draggable,
.channel-draggable {
    cursor: grab;
}

.category-draggable:active,
.channel-draggable:active {
    cursor: grabbing;
}

.channel-category.dragging,
.channel-row-wrap.dragging {
    opacity: .42;
}

.channel-category.drop-before,
.channel-row-wrap.drop-before {
    box-shadow: inset 0 2px 0 var(--accent);
}

.channel-category.drop-after,
.channel-row-wrap.drop-after {
    box-shadow: inset 0 -2px 0 var(--accent);
}

.channel-category.channel-drop-target > .category-header-row {
    color: var(--dashboard-text-soft);
}

.voice-channel-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: center;
    border-radius: var(--radius-sm);
}

.voice-channel-row.active,
.voice-channel-row:hover {
    background: var(--active);
}

.voice-channel-row.connected {
    box-shadow: inset 2px 0 var(--success);
}

.voice-channel-row.connected .channel-button {
    color: var(--dashboard-text-soft);
}

.voice-channel-row.connected.active .channel-button {
    color: var(--dashboard-text);
}

.voice-channel-row .channel-button,
.voice-channel-row .channel-button:hover,
.voice-channel-row .channel-button[aria-current="true"] {
    background: transparent;
}

.voice-channel-chat-button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--dashboard-text-dim);
    cursor: pointer;
}

.voice-channel-chat-button .icon {
    width: 15px;
    height: 15px;
}

.voice-channel-chat-button:hover,
.voice-channel-chat-button:focus-visible {
    background: rgba(255, 255, 255, .07);
    color: var(--dashboard-text);
    outline: none;
}


.channel-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-channel-dialog);
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgb(5 7 10 / 62%);
}

.channel-dialog {
    width: min(420px, 100%);
    overflow: hidden;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-popover);
    background: var(--dashboard-panel);
    box-shadow: 0 22px 64px rgb(0 0 0 / 42%);
}

.channel-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--dashboard-panel-3);
    background: var(--dashboard-sidebar);
}

.channel-dialog-header > div {
    display: grid;
    gap: 2px;
}

.channel-dialog-header strong {
    font-size: 13px;
}

.channel-dialog-header span,
.channel-dialog-note {
    color: var(--dashboard-text-dim);
    font-size: 11px;
}

.channel-dialog-form {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.channel-dialog-note {
    margin: 0;
    line-height: 1.5;
}

.channel-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    align-items: center;
    padding-top: 3px;
}

.channel-dialog-actions.split {
    justify-content: space-between;
}

.channel-dialog-actions.split > div {
    display: flex;
    gap: 7px;
}

.channel-context-menu {
    position: fixed;
    z-index: var(--z-context-menu);
    width: 196px;
    padding: 5px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-popover);
    background: #11151c;
    box-shadow: 0 12px 34px rgb(0 0 0 / 42%);
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--dashboard-text-soft);
    text-align: left;
    font-size: 11px;
    cursor: pointer;
}

.context-menu-item:hover:not(:disabled) {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.context-menu-item.danger {
    color: #efaab1;
}

.context-menu-item:disabled {
    opacity: .35;
    cursor: default;
}

.context-menu-separator {
    height: 1px;
    margin: 4px 2px;
    background: var(--dashboard-panel-3);
}

.management-settings-body {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    min-height: 0;
    flex: 1;
}

.management-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 9px;
    border-right: 1px solid var(--dashboard-panel-3);
    background: var(--dashboard-sidebar);
}

.management-nav-item {
    min-height: 34px;
    padding: 7px 9px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--dashboard-text-dim);
    text-align: left;
    cursor: pointer;
}

.management-nav-item:hover {
    background: var(--hover);
    color: var(--dashboard-text-soft);
}

.management-nav-item.active {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.management-settings-panel .management-scroll {
    min-width: 0;
}

.management-panel-compact {
    width: min(620px, 100%);
}


@media (max-width: 720px) {
    .management-settings-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .management-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 7px;
        border-right: 0;
        border-bottom: 1px solid var(--dashboard-panel-3);
    }

    .management-nav-item {
        flex: 0 0 auto;
    }

    .channel-dialog-overlay {
        padding: 8px;
    }

    .channel-context-menu {
        max-width: calc(100vw - 16px);
    }
}



/* --------------------------------------------------------------------------
   Voice channel workspace

   This is the single sizing/layout owner for the linked voice + text surface.
   Generic chat styling lives in chat.css; this file only defines how a chat
   mount participates in the voice workspace.
   -------------------------------------------------------------------------- */
.voice-channel-pane {
    --voice-stage-size: 27%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.voice-channel-pane.voice-active {
    --voice-stage-size: 58%;
}

.call-stage-shell {
    display: block;
    flex: 0 0 var(--voice-stage-size);
    min-width: 0;
    min-height: 96px;
    overflow: hidden;
    background: #090a0d;
}

.voice-chat-splitter {
    position: relative;
    z-index: 4;
    flex: 0 0 9px;
    width: 100%;
    cursor: row-resize;
    touch-action: none;
    outline: none;
}

.voice-chat-splitter::before {
    content: "";
    position: absolute;
    top: 4px;
    right: 0;
    left: 0;
    height: 1px;
    background: var(--border);
}

.voice-chat-splitter:hover::before,
.voice-chat-splitter.dragging::before,
.voice-chat-splitter:focus-visible::before {
    background: var(--dashboard-text-dim);
}

body.voice-resizing {
    cursor: row-resize;
    user-select: none;
}

/* Override the generic full-height chat mount only in a linked voice channel.
   The flex item is allowed to shrink all the way to its actual composer floor;
   the message log owns overflow inside it. */
.voice-chat-mount.chat-mount[data-chat-root] {
    flex: 1 1 0;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: var(--dashboard-panel);
}

.call-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 120%, rgba(35, 41, 54, 0.38), transparent 44%),
        #090a0d;
}

.call-stage-topline {
    position: absolute;
    top: 12px;
    right: 14px;
    left: 14px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--dashboard-text-soft);
    font-size: 11px;
    pointer-events: none;
    text-shadow: 0 1px 8px rgb(0 0 0 / 70%);
}

.call-stage-topline > div {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.call-stage-topline strong {
    color: var(--dashboard-text);
    font-size: 12px;
}

.call-stage-mode {
    color: var(--dashboard-text-dim);
}

.call-stage-media {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    place-items: stretch;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.call-stage-idle {
    display: grid;
    place-self: center;
    justify-items: center;
    gap: 7px;
    width: min(420px, 92%);
    color: var(--dashboard-text-dim);
    text-align: center;
}

.call-stage-idle strong {
    color: var(--dashboard-text-soft);
    font-size: 13px;
}

.call-stage-idle > span {
    max-width: 48ch;
    font-size: 10px;
    line-height: 1.5;
}

.call-stage-idle-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 3px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    background: #111318;
    color: var(--dashboard-text-dim);
}

.call-stage-idle-icon .icon {
    width: 24px;
    height: 24px;
}

/* Gallery -----------------------------------------------------------------
   Gallery tiles are media frames, not generic cards. Runtime layout chooses
   the row/column count and a near-16:9 rectangle that uses the current stage
   well. Width and height are both supplied by the layout helper so extreme
   splitter positions cannot make CSS reconstruct an overflowing ratio. */
.voice-gallery {
    --voice-gallery-gap: 10px;
    --voice-gallery-tile-width: 420px;
    --voice-gallery-tile-height: 236px;
    display: flex;
    flex-wrap: wrap;
    align-content: safe center;
    justify-content: safe center;
    gap: var(--voice-gallery-gap);
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 44px 10px 78px;
    overflow: hidden;
}

.voice-gallery > .voice-gallery-tile {
    width: min(100%, var(--voice-gallery-tile-width));
    height: min(100%, var(--voice-gallery-tile-height));
    max-width: 100%;
    max-height: 100%;
}

.call-stage .media-tile.voice-gallery-tile {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: #111318;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    appearance: none;
    box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
}

.voice-gallery-tile:hover,
.voice-gallery-tile:focus-visible {
    border-color: rgba(255, 255, 255, .24);
    outline: none;
}

.voice-gallery-tile:focus-visible {
    box-shadow: 0 0 0 2px var(--accent), 0 8px 28px rgb(0 0 0 / 18%);
}

/* Publication/focus state is communicated by badges and layout, not a blue
   border around the whole tile. Keyboard focus retains its accessibility ring. */
.call-stage .media-tile.screen.active,
.voice-gallery-tile[aria-pressed="true"] {
    border-color: rgba(255, 255, 255, .10);
}

.voice-gallery-tile .media-video,
.voice-focus-main .voice-gallery-tile .media-video {
    width: 100%;
    height: 100%;
}

.voice-gallery-tile.camera .media-video { object-fit: cover; }
.voice-gallery-tile.screen .media-video { object-fit: contain; }

.media-tile-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    padding: 3px 6px;
    border-radius: 5px;
    background: rgba(224, 108, 117, .92);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
}

.call-stage .media-tile-label {
    left: 9px;
    bottom: 9px;
    max-width: calc(100% - 18px);
    border: 0;
    border-radius: 6px;
    background: rgb(9 10 13 / 78%);
    color: var(--dashboard-text);
    backdrop-filter: blur(8px);
}

/* Profile tiles ----------------------------------------------------------- */
.voice-gallery-tile.participant-tile {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
}

.participant-tile-avatar {
    display: grid;
    place-items: center;
    width: clamp(58px, 7vw, 104px);
    height: clamp(58px, 7vw, 104px);
    border: 2px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    background: var(--dashboard-panel-2);
    color: var(--dashboard-text);
    font-size: clamp(18px, 2.2vw, 30px);
    font-weight: 800;
}

.participant-tile-copy {
    display: grid;
    gap: 2px;
}

.participant-tile-copy strong {
    color: var(--dashboard-text);
    font-size: 11px;
}

.participant-tile-copy span {
    color: var(--dashboard-text-dim);
    font-size: 9px;
}

.participant-muted-badge {
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(224, 108, 117, .18);
    color: var(--danger);
}

.participant-muted-badge .icon {
    width: 13px;
    height: 13px;
}

/* Diagnostics tile -------------------------------------------------------- */
.voice-gallery-tile.diagnostics {
    display: grid;
    place-items: stretch;
    overflow: hidden;
    background: #101319;
}

.voice-diagnostics-summary {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    align-content: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    padding: clamp(12px, 2vw, 22px);
    text-align: left;
}

.voice-diagnostics-summary-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 2px;
    border-radius: 9px;
    background: var(--dashboard-panel-2);
    color: var(--dashboard-text-soft);
}

.voice-diagnostics-summary-icon .icon {
    width: 17px;
    height: 17px;
}

.voice-diagnostics-summary-title {
    color: var(--dashboard-text);
    font-size: 12px;
}

.voice-diagnostics-summary-sampled {
    color: var(--dashboard-text-dim);
    font-size: 9px;
}

.voice-diagnostics-summary-grid {
    display: grid;
    align-content: end;
    gap: 4px;
    min-height: 0;
}

.voice-diagnostics-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 72px) minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    font-size: 9px;
}

.voice-diagnostics-summary-row span { color: var(--dashboard-text-dim); }

.voice-diagnostics-summary-row strong {
    min-width: 0;
    overflow: hidden;
    color: var(--dashboard-text-soft);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Focused tile + optional member strip ----------------------------------- */
.voice-focus-layout {
    display: grid;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.voice-focus-main {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.voice-focus-main > .voice-gallery-tile {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.voice-focus-main > .voice-gallery-tile.participant-tile .participant-tile-avatar {
    width: clamp(104px, 13vw, 180px);
    height: clamp(104px, 13vw, 180px);
    font-size: clamp(28px, 4vw, 48px);
}

.voice-focus-main > .voice-gallery-tile.diagnostics {
    padding: 38px 0 70px;
    background: #0d0f13;
}

.voice-diagnostics-panel {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: auto;
    border: 0;
    border-radius: 0;
    background: #0d0f13;
    cursor: default;
}

.voice-focus-layout.with-members {
    grid-template-rows: minmax(0, 1fr) clamp(112px, 22%, 168px);
    gap: 10px;
    padding: 10px 10px 76px;
}

.voice-focus-layout.with-members .voice-focus-main > .voice-gallery-tile {
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
}

.voice-focus-filmstrip {
    display: flex;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.voice-focus-filmstrip .voice-gallery-tile {
    flex: 0 0 clamp(150px, 19vw, 232px);
    width: clamp(150px, 19vw, 232px);
    height: 100%;
    scroll-snap-align: center;
}

.voice-focus-filmstrip .participant-tile-avatar {
    width: clamp(48px, 5vw, 72px);
    height: clamp(48px, 5vw, 72px);
    font-size: 18px;
}

.voice-focus-filmstrip .participant-tile-copy span,
.voice-focus-filmstrip .voice-diagnostics-summary-grid {
    display: none;
}

.voice-focus-filmstrip .voice-diagnostics-summary {
    align-content: center;
    justify-items: center;
    text-align: center;
}

/* Active speaker ---------------------------------------------------------- */
/* Speaking is transient LiveKit room state. The RTC controller toggles this
   class directly so audio-level changes never rebuild the application shell. */
.call-stage .voice-gallery-tile.is-speaking {
    border-color: var(--success);
    box-shadow: inset 0 0 0 2px var(--success), 0 8px 28px rgb(0 0 0 / 18%);
}

.call-stage .voice-focus-main > .voice-gallery-tile.is-speaking {
    box-shadow: inset 0 0 0 2px var(--success);
}

.call-stage .voice-gallery-tile.is-speaking:focus-visible {
    box-shadow: inset 0 0 0 2px var(--success), 0 0 0 2px var(--accent), 0 8px 28px rgb(0 0 0 / 18%);
}

/* Overlay chrome ---------------------------------------------------------- */
.call-stage-actions {
    position: absolute;
    z-index: 12;
    bottom: 16px;
    left: 50%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 15px;
    background: rgb(16 18 23 / 90%);
    box-shadow: 0 10px 30px rgb(0 0 0 / 38%);
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
}

.call-stage-members-toggle {
    position: absolute;
    z-index: 12;
    bottom: 72px;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 58px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 18px;
    background: rgb(16 18 23 / 92%);
    color: var(--dashboard-text-soft);
    box-shadow: 0 8px 24px rgb(0 0 0 / 34%);
    cursor: pointer;
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
}

.call-stage-members-toggle:hover,
.call-stage-members-toggle:focus-visible {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
    outline: none;
}

.call-stage-members-toggle > .icon {
    width: 18px;
    height: 18px;
}

.voice-members-toggle-chevron {
    display: grid;
    place-items: center;
}

.voice-members-toggle-chevron .icon {
    width: 14px;
    height: 14px;
    transform: rotate(180deg);
    transition: transform 120ms ease;
}

.call-stage-members-toggle[aria-pressed="true"] .voice-members-toggle-chevron .icon {
    transform: rotate(0deg);
}

.call-stage-actions .call-stage-control {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: transparent;
    box-shadow: none;
}

.call-stage-actions .voice-primary-button {
    min-height: 42px;
}

.call-stage-actions .call-stage-control:hover {
    background: rgba(255, 255, 255, .08);
}

.call-stage-actions .call-stage-control.danger {
    width: 54px;
    border-radius: 12px;
    background: rgba(224, 108, 117, .92);
    color: #fff;
}

.call-stage-actions .call-stage-control.danger:hover {
    background: var(--danger);
    color: #fff;
}

.call-stage-fullscreen-tools {
    position: absolute;
    inset: 0;
    z-index: 13;
    pointer-events: none;
}

.call-stage-fullscreen-tools .call-stage-overlay-button {
    position: absolute;
    pointer-events: auto;
}

.call-stage-fullscreen-toggle {
    right: 14px;
    bottom: 14px;
}

.call-stage-fullscreen-chat-toggle {
    top: 14px;
    right: 14px;
}

.call-stage-overlay-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    background: rgb(16 18 23 / 88%);
    color: var(--dashboard-text-soft);
    box-shadow: 0 8px 24px rgb(0 0 0 / 32%);
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.call-stage-overlay-button:hover,
.call-stage-overlay-button:focus-visible,
.call-stage-overlay-button[aria-pressed="true"] {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
    outline: none;
}

.call-stage-overlay-button .icon {
    width: 18px;
    height: 18px;
}

.call-stage-fullscreen-chat-toggle,
.fullscreen-exit-icon {
    display: none;
}

.fullscreen-enter-icon,
.fullscreen-exit-icon {
    line-height: 0;
}

.call-stage-error {
    position: absolute;
    right: 14px;
    bottom: 74px;
    left: 14px;
    z-index: 11;
    margin: 0;
}

@media (hover: hover) and (pointer: fine) {
    .call-stage-shell.active-call .call-stage-chrome {
        opacity: 0;
        pointer-events: none;
        transition: opacity 120ms ease;
    }

    /* Pointer visibility is tracked outside the rendered shell so rebuilding
       voice controls cannot briefly reset :hover and flash the action pill. */
    .call-stage-shell.active-call.voice-chrome-visible .call-stage-chrome,
    .call-stage-shell.active-call .call-stage:has(.call-stage-chrome:focus-visible) .call-stage-chrome,
    .call-stage-shell.active-call .call-stage:has(.call-stage-chrome :focus-visible) .call-stage-chrome {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 720px) {
    .voice-channel-pane,
    .voice-channel-pane.voice-active {
        --voice-stage-size: 42%;
    }

    .call-stage-shell {
        min-height: 190px;
    }

    .voice-chat-splitter {
        display: none;
    }

    .voice-gallery {
        --voice-gallery-gap: 6px;
        padding: 36px 6px 66px;
    }

    .voice-focus-layout.with-members {
        grid-template-rows: minmax(0, 1fr) 96px;
        gap: 6px;
        padding: 6px 6px 68px;
    }

    .voice-focus-filmstrip {
        gap: 6px;
    }

    .voice-focus-filmstrip .voice-gallery-tile {
        flex-basis: 132px;
        width: 132px;
    }

    .call-stage-mode {
        display: none;
    }

    .call-stage-actions {
        bottom: 10px;
        max-width: calc(100% - 12px);
        gap: 3px;
        padding: 4px;
    }

    .call-stage-actions .call-stage-control {
        width: 38px;
        height: 38px;
    }

    .call-stage-actions .call-stage-control.danger {
        width: 48px;
    }

    .call-stage-members-toggle {
        bottom: 60px;
        width: 54px;
        height: 34px;
    }

    .voice-focus-main > .voice-gallery-tile.diagnostics {
        padding-bottom: 62px;
    }
}

/* Fullscreen voice workspace -----------------------------------------------
   The stable application root enters the browser Fullscreen API while CSS
   presents only the active voice workspace. Fullscreen therefore preserves
   gallery, focused, focused-with-members, and diagnostics modes across shell
   redraws instead of belonging to an individual media publication. The linked
   voice chat is the existing chat mount, moved into a right-hand column only
   while explicitly requested. */
.app-shell.voice-fullscreen-active {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    background: #090a0d;
}

.app-shell.voice-fullscreen-active > .navigation-stack,
.app-shell.voice-fullscreen-active > .member-sidebar,
.app-shell.voice-fullscreen-active > .mobile-backdrop {
    display: none;
}

.app-shell.voice-fullscreen-active > .content-pane {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.app-shell.voice-fullscreen-active > .content-pane > .content-header {
    display: none;
}

.app-shell.voice-fullscreen-active .voice-channel-pane {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.app-shell.voice-fullscreen-active .voice-channel-pane > .call-stage-shell {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.app-shell.voice-fullscreen-active .voice-chat-splitter,
.app-shell.voice-fullscreen-active .voice-chat-mount.chat-mount[data-chat-root] {
    display: none;
}

.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-channel-pane {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 29vw, 440px);
}

.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-chat-mount.chat-mount[data-chat-root] {
    display: block;
    grid-column: 2;
    grid-row: 1;
    width: auto;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border-left: 1px solid var(--border);
    background: var(--dashboard-panel);
}

.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-chat-mount .chat-composer-shell {
    padding-right: 10px;
    padding-left: 10px;
}

.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-chat-mount .chat-form,
.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-chat-mount .chat-reply-composer,
.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-chat-mount .chat-pending-attachments {
    width: 100%;
    max-width: none;
}

.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-chat-mount .chat-message-composer {
    border-radius: 14px;
}

.app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-chat-mount .chat-log {
    padding-top: 64px;
}

.app-shell.voice-fullscreen-active .call-stage-fullscreen-tools {
    z-index: 40;
}

.app-shell.voice-fullscreen-active .call-stage-fullscreen-tools .call-stage-overlay-button {
    opacity: 1;
    pointer-events: auto;
}

/* The fullscreen toggle stays attached to the voice stage's bottom-right
   corner. The chat toggle is viewport-anchored so opening the chat column does
   not move the control the pointer just used. */
.app-shell.voice-fullscreen-active .call-stage-fullscreen-toggle {
    right: 14px;
    bottom: 14px;
}

.app-shell.voice-fullscreen-active .call-stage-fullscreen-chat-toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    display: grid;
}

.app-shell.voice-fullscreen-active .fullscreen-exit-icon {
    display: grid;
}

.app-shell.voice-fullscreen-active .fullscreen-enter-icon {
    display: none;
}

@media (max-width: 760px) {
    .app-shell.voice-fullscreen-active.voice-fullscreen-chat-open .voice-channel-pane {
        grid-template-columns: minmax(0, 1fr) min(42vw, 340px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .call-stage-chrome,
    .voice-members-toggle-chevron .icon {
        transition: none !important;
    }
}

.participant-tile-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.voice-device-menu {
    position: fixed;
    z-index: var(--z-context-menu);
    width: min(290px, calc(100vw - 16px));
    max-height: min(420px, calc(100vh - 16px));
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--dashboard-panel-3);
    border-radius: var(--radius-popover);
    background: #11151c;
    box-shadow: 0 12px 34px rgb(0 0 0 / 42%);
}

.voice-device-menu-title {
    padding: 6px 8px 5px;
    color: var(--dashboard-text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.voice-device-menu-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--dashboard-text-soft);
    text-align: left;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.voice-device-menu-item:hover,
.voice-device-menu-item:focus-visible,
.voice-device-menu-item.selected {
    background: var(--dashboard-panel-3);
    color: var(--dashboard-text);
}

.voice-device-check {
    color: var(--success);
    font-weight: 700;
}

.voice-device-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-device-picker {
    margin-top: 4px;
    border-top: 1px solid var(--dashboard-panel-3);
    border-radius: 0 0 7px 7px;
}

.voice-device-menu-error {
    padding: 7px 8px;
    color: #efaab1;
    font-size: 10.5px;
    line-height: 1.4;
}

.voice-device-menu-note {
    padding: 7px 8px;
    color: var(--dashboard-text-dim);
    font-size: 10.5px;
    line-height: 1.4;
}
