.nwc-app .nwc-voice-call-open {
    display: grid;
    place-items: center;
    flex: 0 0 2.5rem;
    inline-size: 2.5rem;
    block-size: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: .65rem;
    color: #f1c8df;
    background: transparent;
    cursor: pointer;
}
.nwc-app .nwc-voice-call-open svg { inline-size: 1.2rem; block-size: 1.2rem; }
.nwc-app .nwc-voice-call-open:hover { background: #3d2737; }
.nwc-app .nwc-voice-call-open:disabled { opacity: .5; cursor: default; }
.nwc-app .nwc-voice-call-open[hidden],
.nwc-app .nwc-voice-call[hidden],
.nwc-app .nwc-voice-call [hidden] { display: none; }

.nwc-app .nwc-voice-call {
    position: fixed;
    z-index: 95;
    box-sizing: border-box;
    top: max(4.1rem, calc(env(safe-area-inset-top, 0px) + 3.25rem));
    right: max(.75rem, env(safe-area-inset-right, 0px));
    inline-size: min(25rem, calc(100% - 1.5rem));
    padding: .85rem;
    border: 1px solid #79546e;
    border-radius: .95rem;
    color: #fff4fa;
    background: #2a2029;
    box-shadow: 0 .7rem 1.8rem #130a13bb;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.nwc-voice-call-row {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr) auto;
    align-items: center;
    column-gap: .65rem;
}
.nwc-voice-call-avatar {
    display: grid;
    place-items: center;
    inline-size: 2.6rem;
    block-size: 2.6rem;
    border-radius: 50%;
    color: #ffeafa;
    background: #593247;
    font-weight: 700;
}
.nwc-voice-call-copy h2 {
    margin: 0 0 .15rem;
    color: #e4bbd0;
    font-size: .76rem;
    font-weight: 650;
    line-height: 1.25;
}
.nwc-voice-call-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.02rem;
    line-height: 1.3;
}
.nwc-voice-call time {
    padding: .25rem .42rem;
    border-radius: .48rem;
    color: #c8f8de;
    background: #243a33;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}
.nwc-voice-call [data-nwchat-voice-call-status] {
    margin: .46rem 0 .5rem;
    color: #ebd5e2;
    font-size: .82rem;
    line-height: 1.4;
}
.nwc-voice-call[data-state="connected"] [data-nwchat-voice-call-status] { color: #a9e9c9; }
.nwc-voice-call-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; margin: -.18rem; }
.nwc-voice-call-actions button {
    box-sizing: border-box;
    min-block-size: 44px;
    margin: .18rem;
    padding: .42rem .62rem;
    border: 1px solid #82546f;
    border-radius: .55rem;
    color: #fff7fc;
    background: #4b3144;
    font: inherit;
    font-size: .83rem;
    font-weight: 640;
    cursor: pointer;
}
.nwc-voice-call-actions button:disabled { opacity: .58; cursor: default; }
.nwc-voice-call-actions [data-nwchat-voice-call-accept] { border-color: #71b99b; background: #275742; }
.nwc-voice-call-actions [data-nwchat-voice-call-end],
.nwc-voice-call-actions [data-nwchat-voice-call-decline] { border-color: #af6a85; background: #73344f; }
.nwc-voice-call-actions [aria-pressed="true"] { border-color: #edacd0; background: #683d57; }
.nwc-app .nwc-voice-call-open:focus-visible,
.nwc-voice-call-actions button:focus-visible { outline: 2px solid #f6b4db; outline-offset: 2px; }

.nwc-app .nwc-voice-call[data-media="video"] {
    max-height: calc(100vh - 5rem);
    max-block-size: calc(100dvh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.nwc-video-call-previews {
    display: flex;
    margin: .25rem -.2rem .55rem;
}
.nwc-video-call-previews figure {
    position: relative;
    min-inline-size: 0;
    flex: 1 1 0;
    margin: 0 .2rem;
    overflow: hidden;
    border: 1px solid #6c4e60;
    border-radius: .65rem;
    background: #19131a;
}
.nwc-video-call-previews video {
    display: block;
    inline-size: 100%;
    aspect-ratio: 4 / 3;
    max-height: 13rem;
    object-fit: cover;
}
.nwc-video-call-previews figcaption {
    position: absolute;
    bottom: .33rem;
    left: .33rem;
    max-width: calc(100% - .66rem);
    padding: .16rem .38rem;
    border-radius: .35rem;
    color: #fff4fa;
    background: #171218e8;
    font-size: .68rem;
    line-height: 1.3;
}
.nwc-voice-call .nwc-video-call-controls { justify-content: flex-start; }
.nwc-video-call-status {
    margin: .3rem 0 .55rem;
    color: #ebccdf;
    font-size: .78rem;
    line-height: 1.4;
}
.nwc-video-call-status[data-reason="weak-network"] { color: #fed6a4; }

.nwc-thread-body,
.nwc-thread-chat {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-block-size: 0;
    min-inline-size: 0;
}
.nwc-thread-body[data-call-layout] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}
.nwc-thread-body[data-call-layout="compact"] { grid-template-columns: minmax(11rem, .65fr) minmax(0, 1fr); }
.nwc-thread-body[data-call-layout] .nwc-historywrap { scrollbar-color: #6a4b5e #201920; }
.nwc-video-stage {
    display: flex;
    min-block-size: 0;
    min-inline-size: 0;
    border-inline-end: 1px solid #382d35;
    background: #19151a;
}
.nwc-video-lobby { flex: 1 1 0; }
.nwc-app[data-call-lobby] .nwc-placeholder { display: none; }
.nwc-app .nwc-video-stage .nwc-voice-call[data-media="video"] {
    position: static;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    inline-size: 100%;
    max-block-size: none;
    min-inline-size: 0;
    gap: .5rem;
    padding: clamp(.55rem, 1.35vw, 1.05rem);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.nwc-app .nwc-video-stage .nwc-voice-call[hidden] { display: none; }
.nwc-video-stage .nwc-voice-call-row { grid-template-columns: 2.2rem minmax(0, 1fr) auto auto; gap: .46rem; }
.nwc-video-stage .nwc-voice-call-avatar { inline-size: 2.2rem; block-size: 2.2rem; }
.nwc-video-stage .nwc-voice-call [data-nwchat-voice-call-status] { margin: 0; }
.nwc-app .nwc-call-size {
    display: grid;
    place-items: center;
    min-block-size: 44px;
    inline-size: 44px;
    padding: 0;
    border: 1px solid #557168;
    border-radius: .6rem;
    color: #d8f2e4;
    background: #24342e;
}
.nwc-call-size svg { inline-size: 1.15rem; block-size: 1.15rem; }
.nwc-call-size[aria-expanded="false"] svg { transform: rotate(90deg); }
.nwc-video-stage .nwc-video-call-details {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-block-size: 0;
    gap: .5rem;
}
.nwc-video-stage .nwc-video-call-previews {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: .45rem;
    min-block-size: 0;
    margin: 0;
}
.nwc-video-stage .nwc-video-call-previews figure { min-block-size: 0; margin: 0; }
.nwc-video-stage .nwc-video-call-previews figure:only-of-type,
.nwc-video-stage .nwc-video-call-previews[data-visible-count="1"] figure { grid-column: 1 / -1; }
.nwc-video-stage .nwc-video-call-previews video { max-block-size: min(24dvh, 12.5rem); object-fit: contain; }
.nwc-video-stage .nwc-video-call-previews[data-visible-count="1"] video { max-block-size: min(36dvh, 19rem); }
.nwc-video-stage .nwc-video-call-previews[data-many] video { max-block-size: min(18dvh, 9rem); }
.nwc-video-call-members { color: #d9cbd5; font-size: .77rem; overflow-wrap: anywhere; }
.nwc-video-stage .nwc-call-command-bar { display: flex; flex-direction: column; gap: .37rem; }
.nwc-video-stage .nwc-voice-call-actions { justify-content: flex-start; }
.nwc-video-call-approval {
    padding: .46rem .55rem;
    border: 1px solid #5a7d6a;
    border-radius: .62rem;
    font-size: .8rem;
}
.nwc-video-call-approval .nwc-voice-call-actions { margin-block-start: .12rem; }
.nwc-voice-call-actions :is([data-nwchat-voice-call-invite],[data-nwchat-voice-call-approve]) {
    border-color: #679d81;
    color: #e0f7ea;
    background: #2c4b3c;
}
.nwc-app .nwc-call-invite {
    inline-size: min(27rem, calc(100% - 1.25rem));
    max-block-size: min(36rem, calc(100dvh - 2rem));
    overflow: auto;
    padding: 1rem;
    border: 1px solid #6d5063;
    border-radius: .85rem;
    color: #fff4fa;
    background: #292129;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.nwc-call-invite::backdrop { background: #130e15c9; }
.nwc-call-invite header { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.nwc-call-invite header button { inline-size: 44px; padding: 0; border: 0; background: transparent; font-size: 1.35rem; }
.nwc-app .nwc-call-invite p { margin: .45rem 0; font-size: .85rem; line-height: 1.4; }
.nwc-app .nwc-call-invite input { inline-size: 100%; }
.nwc-call-invite ul { display: grid; gap: .32rem; }
.nwc-call-invite li button {
    inline-size: 100%;
    padding: .48rem .65rem;
    border: 1px solid #557565;
    border-radius: .55rem;
    color: #e0f7ea;
    background: #2c4839;
    text-align: start;
    overflow-wrap: anywhere;
}

@media (min-width: 901px) {
    .nwc-video-stage .nwc-video-call-previews[data-pair-preview] { position: relative; grid-template-columns: minmax(0, 1fr); }
    .nwc-video-stage .nwc-video-call-previews[data-pair-preview] [data-nwchat-voice-call-remote-video] { max-block-size: min(40dvh, 20rem); }
    .nwc-video-stage .nwc-video-call-previews[data-pair-preview] [data-nwchat-voice-call-local-frame] {
        position: absolute;
        inset-inline-end: .5rem;
        inset-block-end: .5rem;
        inline-size: clamp(6.3rem, 29%, 9rem);
        box-shadow: 0 .3rem 1rem #1a131bbf;
    }
}
@media (max-width: 900px) {
    .nwc-thread-body[data-call-layout] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 46%) minmax(0, 1fr);
    }
    .nwc-thread-body[data-call-layout="compact"] { grid-template-rows: auto minmax(0, 1fr); }
    .nwc-video-stage { border-inline-end: 0; border-block-end: 1px solid #382d35; }
    .nwc-video-stage .nwc-video-call-previews video { max-block-size: min(16dvh, 8rem); }
    .nwc-video-stage .nwc-video-call-previews[data-visible-count="1"] video { max-block-size: min(19dvh, 9rem); }
    .nwc-video-stage .nwc-video-call-previews[data-many] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .nwc-video-stage .nwc-video-call-previews[data-visible-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .nwc-video-stage .nwc-video-call-previews[data-many] video { max-block-size: min(16dvh, 7rem); }
    .nwc-video-stage .nwc-call-command-bar { flex-flow: row wrap; align-items: center; gap: .32rem; }
    .nwc-video-stage .nwc-call-command-bar > .nwc-voice-call-actions { display: contents; }
    .nwc-video-stage .nwc-call-command-bar button { margin: 0; }
    .nwc-video-stage .nwc-call-command-bar > .nwc-video-call-status { flex: 1 0 100%; margin: 0; }
    .nwc-video-lobby { flex: 0 1 auto; max-block-size: 46dvh; }
}
@media (max-width: 760px) {
    .nwc-app[data-call-lobby][data-view="inbox"] .nwc-workspace > .nwc-chat { display: flex; flex: 0 1 auto; order: -1; }
}
@media (max-width: 360px) {
    .nwc-app .nwc-voice-call { padding: .7rem; }
    .nwc-app .nwc-voice-call-open { inline-size: 2.25rem; flex-basis: 2.25rem; }
}
