:root {
    --user-bg: #0b1018;
    --user-bg-shell: #0f1621;
    --user-bg-pane: #121b28;
    --user-bg-bubble-in: #162235;
    --user-bg-bubble-out: #2a3f7a;
    --user-border: rgba(177, 196, 232, 0.12);
    --user-border-strong: rgba(177, 196, 232, 0.18);
    --user-text: #edf3ff;
    --user-text-muted: #a2afc6;
    --user-text-soft: #77849b;
    --user-accent: #7b90ff;
    --user-accent-soft: rgba(123, 144, 255, 0.16);
    --user-shadow: 0 22px 60px rgba(3, 8, 15, 0.38);
    --user-radius-lg: 24px;
    --user-radius-md: 16px;
    --user-radius-sm: 12px;
    --user-scrollbar-track: rgba(8, 13, 22, 0.24);
    --user-scrollbar-thumb: rgba(111, 128, 164, 0.38);
    --user-scrollbar-thumb-hover: rgba(139, 156, 198, 0.58);
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--user-scrollbar-thumb) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: var(--user-scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    min-height: 34px;
    border: 2px solid rgba(8, 13, 22, 0.92);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(146, 162, 202, 0.5), rgba(82, 100, 134, 0.45))
        padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--user-scrollbar-thumb-hover);
}

*::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

html {
    background: var(--user-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(123, 144, 255, 0.1), transparent 24%),
        radial-gradient(circle at bottom right, rgba(86, 111, 201, 0.1), transparent 20%),
        var(--user-bg);
    color: var(--user-text);
    font-weight: 400;
}

a {
    color: inherit;
    text-decoration: none;
}

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

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

.user-shell {
    height: 100vh;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.topbar-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-title-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.user-app-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-app-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--user-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--user-text-muted);
    font-size: 0.8rem;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.user-app-nav-link.is-active {
    border-color: rgba(123, 144, 255, 0.24);
    background: rgba(123, 144, 255, 0.14);
    color: #eef3ff;
}

.topbar-controls,
.server-upload-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-controls {
    justify-content: flex-end;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.topbar-user-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--user-border);
    border-radius: var(--user-radius-sm);
    background: rgba(255, 255, 255, 0.03);
    min-width: 0;
}

.topbar-user-card strong {
    font-size: 0.84rem;
}

.topbar-user-card span {
    color: var(--user-text-soft);
    font-size: 0.74rem;
}

.logout-form {
    margin: 0;
}

.user-kicker,
.pane-kicker,
.session-inline-label {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--user-text-soft);
}

.topbar-title h1,
.chat-header-copy h2,
.chat-empty-state h2 {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.session-form-compact,
.conversation-search,
.composer,
.composer-message-form,
.composer-tools,
.chat-action-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.session-form-compact {
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.session-select.compact-select {
    width: 240px;
    min-width: 240px;
}

.server-upload-form {
    flex: 0 0 auto;
}

.topbar-upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    white-space: nowrap;
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.topbar-upload-status {
    min-width: 0;
    max-width: 108px;
    font-size: 0.74rem;
    color: var(--user-text-soft);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.topbar-upload-status[data-tone="error"] {
    color: #ffb8b8;
}

.topbar-upload-status[data-tone="progress"] {
    color: #c9d4ff;
}

.compact-select,
.search-input,
.form-input,
.composer-input {
    width: 100%;
    border: 1px solid var(--user-border-strong);
    background: rgba(255, 255, 255, 0.03);
    color: var(--user-text);
    border-radius: var(--user-radius-sm);
    padding: 10px 12px;
    outline: none;
}

.pane-card,
.chat-card,
.chat-empty-state,
.flash-banner {
    border: 1px solid var(--user-border);
    background: rgba(15, 22, 33, 0.94);
    box-shadow: var(--user-shadow);
    backdrop-filter: blur(18px);
}

.flash-banner {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    border-radius: var(--user-radius-md);
    padding: 10px 12px;
    font-size: 0.9rem;
}

.flash-banner-success {
    color: #dff9ee;
}

.flash-banner-error {
    color: #ffd7d7;
}

.is-hidden,
.screen-share-viewer-modal.is-hidden {
    display: none !important;
}

.call-transient-notice,
.call-button-reason {
    color: var(--user-text-soft);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

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

.call-screen {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
}

.call-screen [hidden] {
    display: none !important;
}

.call-screen-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 18%, rgba(118, 161, 255, 0.28), transparent 32%),
        radial-gradient(circle at 80% 16%, rgba(108, 199, 177, 0.24), transparent 28%),
        radial-gradient(circle at 50% 78%, rgba(88, 130, 235, 0.16), transparent 36%),
        linear-gradient(180deg, rgba(8, 14, 24, 0.96), rgba(6, 10, 18, 0.92));
    backdrop-filter: blur(24px);
}

.call-screen-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding:
        clamp(22px, 3vw, 34px)
        clamp(18px, 4vw, 42px)
        calc(max(22px, env(safe-area-inset-bottom)) + 10px);
    overflow: hidden;
}

.call-screen-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.call-screen-chip,
.call-screen-brand {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
}

.call-screen-chip {
    color: var(--user-text);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.call-screen-brand {
    color: var(--user-text-soft);
    font-size: 0.76rem;
    display: none;
}

.call-screen-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(28px, 8vh, 88px) 0 calc(184px + max(22px, env(safe-area-inset-bottom)));
}

.call-screen-identity {
    width: min(100%, 620px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    text-align: center;
}

.call-screen-avatar {
    width: clamp(152px, 24vw, 216px);
    height: clamp(152px, 24vw, 216px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(123, 144, 255, 0.3), rgba(95, 224, 145, 0.22)),
        rgba(14, 22, 36, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 0 0 16px rgba(255, 255, 255, 0.04),
        0 0 0 34px rgba(255, 255, 255, 0.025),
        0 28px 84px rgba(2, 7, 14, 0.42);
    color: #f5f8ff;
    font-size: clamp(3.1rem, 8vw, 5rem);
    font-weight: 620;
    letter-spacing: -0.05em;
}

.call-screen-avatar .conversation-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-screen-copy {
    width: min(100%, 560px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.call-screen-kicker {
    margin: 0;
    color: rgba(216, 226, 255, 0.72);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.call-screen-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.8rem);
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 1.04;
    text-wrap: balance;
}

.call-screen-subtitle,
.call-screen-status-detail {
    margin: 0;
    color: var(--user-text-muted);
    font-size: clamp(0.92rem, 1.4vw, 1.06rem);
    line-height: 1.45;
    text-wrap: balance;
}

.call-screen-local-muted {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 36px;
    padding: 9px 16px;
    border: 1px solid rgba(255, 124, 132, 0.34);
    border-radius: 999px;
    background: rgba(255, 92, 102, 0.16);
    color: #fff3f5;
    font-size: 0.84rem;
    font-weight: 620;
    letter-spacing: 0.01em;
    box-shadow: 0 16px 36px rgba(92, 14, 24, 0.18);
}

.call-screen-local-muted::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff747d;
    box-shadow: 0 0 0 6px rgba(255, 116, 125, 0.15);
}

.call-screen-status {
    margin: 8px 0 0;
    font-size: clamp(1.08rem, 2vw, 1.5rem);
    font-weight: 540;
    letter-spacing: -0.02em;
}

.call-screen-remote-presence {
    margin: 10px 0 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--user-text);
    font-size: 0.82rem;
    backdrop-filter: blur(14px);
}

.call-screen-remote-presence[data-remote-state="connected"] {
    border-color: rgba(95, 224, 145, 0.28);
    background: rgba(95, 224, 145, 0.12);
    color: #e7fff0;
}

.call-screen-remote-presence[data-remote-state="warning"] {
    border-color: rgba(248, 222, 157, 0.24);
    background: rgba(248, 222, 157, 0.12);
    color: #ffe7b5;
}

.call-screen-remote-presence[data-remote-state="muted"] {
    border-color: rgba(164, 179, 208, 0.18);
    background: rgba(164, 179, 208, 0.08);
}

.call-screen-notice {
    margin: 0;
    width: min(100%, 520px);
    text-align: center;
}

.call-debug-panel {
    position: absolute;
    left: clamp(18px, 4vw, 42px);
    bottom: calc(190px + max(22px, env(safe-area-inset-bottom)));
    width: min(380px, calc(100vw - 2 * clamp(18px, 4vw, 42px)));
    z-index: 2;
    margin: 0;
}

.call-debug-summary {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(8, 14, 22, 0.74);
    color: var(--user-text-muted);
    cursor: pointer;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    backdrop-filter: blur(16px);
}

.call-debug-panel[data-level="warning"] .call-debug-summary {
    border-color: rgba(248, 222, 157, 0.22);
    color: #ffe7b5;
}

.call-debug-panel[data-level="error"] .call-debug-summary {
    border-color: rgba(255, 133, 133, 0.24);
    color: #ffd0d0;
}

.call-debug-panel[data-level="ok"] .call-debug-summary {
    border-color: rgba(95, 224, 145, 0.24);
    color: #dff9ee;
}

.call-debug-dump {
    margin: 12px 0 0;
    max-height: min(38vh, 360px);
    overflow: auto;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(8, 14, 22, 0.82);
    color: #dbe5ff;
    font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace;
    font-size: 0.72rem;
    line-height: 1.52;
    white-space: pre-wrap;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(16px);
}

.call-screen-footer {
    position: absolute;
    left: clamp(18px, 4vw, 42px);
    right: clamp(18px, 4vw, 42px);
    bottom: calc(max(22px, env(safe-area-inset-bottom)) + 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 2;
}

.call-screen-secondary-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    min-height: 46px;
}

.call-secondary-action {
    min-width: 148px;
    padding: 11px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--user-text);
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.call-secondary-action:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
}

.call-secondary-action:disabled {
    cursor: default;
    opacity: 0.6;
}

.call-screen-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    width: 100%;
}

.call-control-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--user-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 86px;
    cursor: pointer;
}

.call-control-button-face {
    position: relative;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.call-control-button svg {
    width: 28px;
    height: 28px;
}

.call-control-button-label {
    color: var(--user-text-muted);
    font-size: 0.82rem;
    line-height: 1.2;
    text-align: center;
    white-space: pre-line;
}

.call-control-button:not(.is-passive):not(:disabled):hover .call-control-button-face {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
}

.call-control-button:disabled {
    cursor: default;
}

.call-control-button.is-passive .call-control-button-face,
.call-control-button:disabled .call-control-button-face {
    opacity: 0.58;
}

.call-control-button[data-active="true"] .call-control-button-face {
    border-color: rgba(123, 144, 255, 0.32);
    background: rgba(123, 144, 255, 0.18);
}

.call-control-button-danger .call-control-button-face {
    border-color: rgba(255, 112, 112, 0.3);
    background: linear-gradient(180deg, #ff6f72, #e84851);
    color: #fff;
}

.call-control-button-accept .call-control-button-face {
    border-color: rgba(95, 224, 145, 0.3);
    background: linear-gradient(180deg, #6ce49c, #36bf71);
    color: #08150f;
}

.call-control-button[data-call-speaker] .call-control-button-label[data-state-label]::after {
    content: attr(data-state-label);
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--user-text-soft);
}

.call-control-button[data-call-speaker][data-active="true"] .call-control-button-face {
    border-color: rgba(255, 255, 255, 0.9);
    background: #ffffff;
    color: #0c1422;
}

.call-control-button[data-call-speaker][data-active="true"] .call-control-button-label::after {
    color: #6ce49c;
}

.call-control-button[data-call-mute] .call-control-button-label[data-state-label]::after {
    content: attr(data-state-label);
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: #ffb7be;
}

.call-control-button[data-call-mute][data-active="true"] .call-control-button-face {
    border-color: rgba(255, 132, 141, 0.46);
    background: linear-gradient(180deg, rgba(255, 129, 137, 0.34), rgba(230, 72, 81, 0.56));
    color: #fff5f6;
    box-shadow:
        0 0 0 1px rgba(255, 132, 141, 0.08),
        0 16px 34px rgba(103, 18, 28, 0.34);
}

.call-control-button[data-call-mute][data-active="true"] .call-control-button-face::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(-45deg);
}

.call-control-button[data-call-mute][data-active="true"] .call-control-button-label::after {
    color: #ffd7db;
}

.call-screen[data-call-ui-mode="terminal"] .call-screen-footer {
    display: none;
}

.call-screen[data-call-ui-mode="terminal"] .call-screen-body {
    padding-bottom: clamp(24px, 6vh, 72px);
}

.call-screen-body {
    align-items: center;
}

.call-screen-copy {
    gap: 12px;
}

.call-screen-status {
    margin: 0;
    max-width: 18ch;
    color: rgba(237, 243, 255, 0.76);
    font-size: clamp(1rem, 1.8vw, 1.22rem);
    font-weight: 500;
    text-wrap: balance;
}

.call-screen-subtitle {
    color: rgba(237, 243, 255, 0.78);
}

.call-screen[data-call-ui-mode="incoming"] .call-screen-status {
    margin-top: 0;
}

.call-screen[data-call-ui-mode="active"] .call-screen-subtitle {
    margin-top: -2px;
}

.call-screen[data-call-ui-mode="active"] .call-screen-chip {
    min-width: 96px;
    justify-content: center;
    letter-spacing: 0.02em;
    text-transform: none;
}

.call-screen-footer {
    gap: 12px;
}

.call-screen-controls {
    width: min(100%, 360px);
    gap: 20px;
}

.call-control-button {
    flex: 1 1 92px;
    min-width: 92px;
}

.call-control-button-face {
    width: 78px;
    height: 78px;
}

.call-control-button-label {
    color: var(--user-text);
    font-size: 0.84rem;
    font-weight: 500;
}

.call-control-button[data-active="false"] .call-control-button-face {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.call-control-button[data-active="true"] .call-control-button-face {
    border-color: rgba(123, 144, 255, 0.4);
    background: rgba(123, 144, 255, 0.24);
}

.call-screen[data-call-ui-mode="incoming"] .call-screen-controls {
    width: min(100%, 280px);
}

.call-screen[data-call-ui-mode="active"] .call-screen-controls {
    width: min(100%, 420px);
}

.call-screen[data-call-ui-mode="outgoing"] .call-screen-controls {
    width: min(100%, 120px);
}

.call-screen[data-call-ui-mode="incoming"] .call-screen-controls,
.call-screen[data-call-ui-mode="active"] .call-screen-controls,
.call-screen[data-call-ui-mode="outgoing"] .call-screen-controls {
    flex-wrap: nowrap;
}

.call-screen[data-call-ui-mode="incoming"] .call-screen-controls > [data-call-speaker],
.call-screen[data-call-ui-mode="incoming"] .call-screen-controls > [data-call-video],
.call-screen[data-call-ui-mode="incoming"] .call-screen-controls > [data-call-mute],
.call-screen[data-call-ui-mode="incoming"] .call-screen-controls > [data-call-hangup],
.call-screen[data-call-ui-mode="incoming"] .call-screen-secondary-actions,
.call-screen[data-call-ui-mode="active"] .call-screen-controls > [data-call-accept],
.call-screen[data-call-ui-mode="active"] .call-screen-controls > [data-call-decline],
.call-screen[data-call-ui-mode="active"] .call-screen-controls > [data-call-video],
.call-screen[data-call-ui-mode="active"] .call-screen-secondary-actions,
.call-screen[data-call-ui-mode="outgoing"] .call-screen-controls > [data-call-accept],
.call-screen[data-call-ui-mode="outgoing"] .call-screen-controls > [data-call-decline],
.call-screen[data-call-ui-mode="outgoing"] .call-screen-controls > [data-call-speaker],
.call-screen[data-call-ui-mode="outgoing"] .call-screen-controls > [data-call-video],
.call-screen[data-call-ui-mode="outgoing"] .call-screen-controls > [data-call-mute],
.call-screen[data-call-ui-mode="outgoing"] .call-screen-secondary-actions {
    display: none !important;
}

.messaging-layout {
    flex: 1;
    min-height: 0;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 12px;
}

.conversation-pane,
.chat-pane {
    min-height: 0;
}

.conversation-hub,
.chat-card,
.chat-empty-state {
    height: 100%;
    min-height: 0;
    border-radius: var(--user-radius-lg);
}

.conversation-hub {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 12px;
}

.left-pane-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--user-border);
}

.mini-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-profile-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--user-accent-soft);
}

.mini-profile-avatar-fallback,
.conversation-avatar,
.chat-header-avatar,
.icon-button {
    display: grid;
    place-items: center;
    background: var(--user-accent-soft);
    color: #eef3ff;
}

.mini-profile-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    font-weight: 700;
}

.mini-profile-avatar-image,
.conversation-avatar-image,
.chat-header-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-profile-copy {
    min-width: 0;
}

.mini-profile-copy strong,
.conversation-copy-top strong,
.message-author {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-weight: 560;
}

.mini-profile-copy span,
.conversation-role,
.conversation-presence,
.profile-details,
.chat-subtitle,
.chat-presence,
.message-author-title,
.conversation-copy p,
.conversation-copy-top span {
    color: var(--user-text-soft);
    font-size: 0.79rem;
    font-weight: 400;
}

.conversation-presence,
.chat-presence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow-wrap: anywhere;
}

.chat-presence {
    margin-top: 4px;
}

.presence-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
    background: rgba(156, 171, 196, 0.56);
    box-shadow: 0 0 0 1px rgba(10, 15, 26, 0.34);
}

.presence-dot[data-online="true"] {
    background: #5fe091;
    box-shadow: 0 0 0 1px rgba(95, 224, 145, 0.18);
}

.profile-details {
    border: 1px solid var(--user-border);
    border-radius: var(--user-radius-sm);
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
}

.profile-details summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.86rem;
    color: var(--user-text-muted);
}

.profile-details[open] summary {
    margin-bottom: 10px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--user-text-muted);
}

.secondary-button,
.primary-button,
.icon-button {
    border: 1px solid transparent;
    border-radius: var(--user-radius-sm);
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease;
}

.secondary-button {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--user-border);
    color: var(--user-text);
}

.primary-button {
    padding: 10px 14px;
    background: linear-gradient(180deg, #7890ff, #6178e8);
    color: #f5f8ff;
}

.icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--user-border);
    font-size: 0.96rem;
}

.secondary-button:hover,
.primary-button:hover,
.icon-button:hover {
    transform: translateY(-1px);
}

.compact-search .search-input {
    padding: 9px 11px;
}

.roster-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conversation-item {
    display: block;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.conversation-item:hover,
.conversation-item.is-active {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--user-border);
}

.conversation-item-main {
    display: flex;
    gap: 10px;
}

.conversation-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 700;
}

.conversation-copy {
    min-width: 0;
    flex: 1;
}

.conversation-copy-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.conversation-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.unread-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(123, 144, 255, 0.2);
    color: #ebf1ff;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(123, 144, 255, 0.24);
}

.conversation-copy p {
    margin: 4px 0 0;
    color: var(--user-text-muted);
    line-height: 1.3;
    font-size: 0.8rem;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.chat-pane {
    min-height: 0;
}

.chat-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--user-border);
    position: relative;
    z-index: 2;
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-actions {
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 14px;
    overflow: hidden;
}

.chat-header-copy {
    min-width: 0;
    flex: 1;
}

.chat-header-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    position: relative;
}

.chat-header-title-row h2 {
    min-width: 0;
    flex: 1;
}

.chat-files-menu {
    position: relative;
    flex: 0 0 auto;
}

.chat-files-menu summary {
    list-style: none;
}

.chat-files-menu summary::-webkit-details-marker {
    display: none;
}

.chat-files-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--user-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--user-text);
    font: inherit;
    font-size: 0.76rem;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.chat-files-button:hover {
    transform: translateY(-1px);
}

.chat-files-menu[open] .chat-files-button {
    background: rgba(120, 144, 255, 0.14);
    border-color: rgba(120, 144, 255, 0.32);
}

.chat-files-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(120, 144, 255, 0.2);
    color: #eef3ff;
    font-size: 0.72rem;
    font-weight: 600;
}

.chat-files-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 12;
    width: min(360px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid var(--user-border);
    border-radius: 18px;
    background: rgba(8, 12, 20, 0.98);
    box-shadow: 0 18px 44px rgba(4, 10, 18, 0.35);
}

.chat-files-popover-header,
.chat-files-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-files-popover-header {
    justify-content: space-between;
    margin-bottom: 10px;
}

.chat-files-popover-copy {
    min-width: 0;
}

.chat-files-popover-copy strong,
.chat-files-item-name {
    display: block;
    color: var(--user-text);
}

.chat-files-popover-copy span,
.chat-files-item-meta {
    font-size: 0.78rem;
    color: var(--user-text-soft);
}

.chat-files-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.chat-files-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--user-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--user-text-soft);
    font: inherit;
    font-size: 0.74rem;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chat-files-filter-button.is-active {
    background: rgba(120, 144, 255, 0.14);
    border-color: rgba(120, 144, 255, 0.32);
    color: var(--user-text);
}

.chat-files-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 0.7rem;
    font-weight: 600;
}

.chat-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
}

.chat-files-item {
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.chat-files-item-copy {
    min-width: 0;
    flex: 1;
}

.chat-files-item-name,
.chat-files-item-meta {
    margin: 0;
    overflow-wrap: anywhere;
}

.chat-files-item-type {
    margin: 0 0 4px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(176, 191, 244, 0.88);
}

.chat-files-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--user-text-soft);
}

.chat-files-empty strong,
.chat-files-empty p {
    margin: 0;
}

.chat-subtitle {
    margin: 4px 0 0;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.call-button {
    min-width: 84px;
    white-space: nowrap;
}

.call-button:disabled {
    cursor: default;
    opacity: 0.6;
}

.call-transient-notice {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(122, 150, 255, 0.08), transparent 48%),
        rgba(10, 16, 26, 0.92);
}

.call-transient-notice[data-tone="error"] {
    color: #ffb8b8;
    border-color: rgba(255, 138, 138, 0.2);
}

.call-transient-notice[data-tone="warning"] {
    color: #f8de9d;
    border-color: rgba(248, 222, 157, 0.2);
}

.call-button-reason[data-tone="error"] {
    color: #ffb8b8;
}

.call-button-reason[data-tone="warning"] {
    color: #f8de9d;
}

.screen-share-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.screen-share-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 10, 0.78);
    backdrop-filter: blur(10px);
}

.screen-share-viewer-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background:
        radial-gradient(circle at top, rgba(115, 152, 255, 0.08), transparent 45%),
        rgba(6, 12, 22, 0.96);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.screen-share-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.screen-share-viewer-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.screen-share-viewer-copy strong {
    font-size: 1.08rem;
}

.screen-share-viewer-copy span {
    color: var(--user-text-soft);
    font-size: 0.86rem;
}

.screen-share-viewer-body {
    position: relative;
    flex: 1;
    min-height: min(72vh, 720px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        rgba(4, 8, 15, 0.96);
}

.screen-share-viewer-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020407;
}

.screen-share-viewer-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: var(--user-text-soft);
    background:
        linear-gradient(135deg, rgba(122, 150, 255, 0.08), transparent 44%),
        rgba(4, 8, 15, 0.92);
}

.screen-share-viewer-fallback strong {
    color: var(--user-text);
    font-size: 1rem;
}

.danger-button {
    border-color: rgba(255, 138, 138, 0.22);
    color: #ffd2d2;
}

.message-timeline {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)),
        rgba(8, 12, 20, 0.52);
}

.message-row {
    display: flex;
}

.message-row.is-sent {
    justify-content: flex-end;
}

.message-row.is-received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: min(68%, 720px);
    border-radius: 18px;
    padding: 10px 12px;
    border: 1px solid var(--user-border);
    background: var(--user-bg-bubble-in);
}

.message-row.is-sent .message-bubble {
    background: var(--user-bg-bubble-out);
    border-color: rgba(123, 144, 255, 0.24);
}

.message-author {
    margin: 0 0 4px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.76);
}

.message-author-title {
    margin: 0 0 6px;
}

.message-body {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.42;
    font-size: 0.92rem;
    font-weight: 400;
}

.image-message-card,
.audio-message-card,
.file-message-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(8, 12, 20, 0.2);
    border: 1px solid rgba(177, 196, 232, 0.16);
}

.image-message-preview {
    display: block;
    width: min(100%, 320px);
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(177, 196, 232, 0.12);
    background: rgba(8, 12, 20, 0.42);
}

.image-message-name,
.image-message-meta,
.audio-message-name,
.audio-message-meta,
.file-message-name,
.file-message-meta {
    margin: 0;
}

.image-message-name,
.audio-message-name,
.file-message-name {
    font-size: 0.9rem;
    font-weight: 560;
    overflow-wrap: anywhere;
}

.image-message-meta,
.audio-message-meta,
.file-message-meta {
    font-size: 0.78rem;
    color: var(--user-text-soft);
    overflow-wrap: anywhere;
}

.media-message-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.message-delete-form {
    margin: 0;
}

.message-delete-button {
    padding: 6px 10px;
    border: 1px solid rgba(255, 138, 138, 0.22);
    border-radius: 10px;
    background: rgba(255, 138, 138, 0.08);
    color: #ffd2d2;
    cursor: pointer;
}

.message-delete-button:hover {
    background: rgba(255, 138, 138, 0.12);
}

.file-message-link {
    align-self: flex-start;
    font-size: 0.82rem;
    color: #dce5ff;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(177, 196, 232, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.message-time {
    display: block;
    text-align: right;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.6);
}

.message-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    color: rgba(201, 212, 255, 0.72);
}

.message-status[data-state="delivered"] {
    color: rgba(211, 223, 255, 0.86);
}

.message-status[data-state="read"] {
    color: #82d6ff;
}

.message-status-icon {
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: -0.08em;
}

.composer {
    padding: 12px 14px;
    border-top: 1px solid var(--user-border);
    align-items: flex-end;
}

.composer-tools {
    flex: 0 0 auto;
}

.composer-message-form {
    flex: 1;
}

.composer-status {
    max-width: 120px;
    font-size: 0.74rem;
    color: var(--user-text-soft);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.composer-status[data-tone="error"] {
    color: #ffb8b8;
}

.composer-status[data-tone="progress"] {
    color: #c9d4ff;
}

.composer-input {
    min-height: 56px;
    resize: none;
}

.composer-button {
    min-width: 84px;
}

.chat-empty-state,
.empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 24px;
}

.login-shell {
    min-height: 100%;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, 100%);
    padding: 28px;
    border: 1px solid var(--user-border);
    border-radius: var(--user-radius-lg);
    background: rgba(15, 22, 33, 0.94);
    box-shadow: var(--user-shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-card h1 {
    margin: 0;
    font-size: 1.3rem;
}

.login-copy {
    margin: 0;
    color: var(--user-text-muted);
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.desktop-inline {
    display: inline;
}

.mobile-inline {
    display: none;
}

.empty-state-list {
    min-height: 90px;
}

.mobile-backlink {
    display: none;
    color: var(--user-accent);
}

body.user-body-workspace {
    overflow: auto;
}

body.user-body-workspace .user-shell {
    height: auto;
    min-height: 100vh;
}

.workspace-layout {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

.workspace-browser {
    border-radius: var(--user-radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.workspace-header-copy {
    min-width: 0;
    max-width: 780px;
}

.workspace-header-copy h2 {
    margin: 6px 0 0;
    font-size: 1.28rem;
    letter-spacing: -0.03em;
}

.workspace-subtitle,
.workspace-helper-text {
    margin: 8px 0 0;
    color: var(--user-text-soft);
    font-size: 0.86rem;
    line-height: 1.45;
}

.workspace-upload-status {
    min-height: 18px;
    color: var(--user-text-soft);
    font-size: 0.78rem;
}

.workspace-upload-status[data-tone="error"] {
    color: #ffb8b8;
}

.workspace-upload-status[data-tone="progress"] {
    color: #c9d4ff;
}

.workspace-project-form,
.workspace-upload-form {
    min-width: min(100%, 460px);
}

.workspace-project-controls,
.workspace-upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workspace-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--user-border);
    border-radius: var(--user-radius-md);
    background: rgba(255, 255, 255, 0.025);
}

.workspace-breadcrumb-link,
.workspace-breadcrumb-current {
    font-size: 0.82rem;
}

.workspace-breadcrumb-link {
    color: var(--user-text-muted);
}

.workspace-breadcrumb-current {
    color: var(--user-text);
    font-weight: 600;
}

.workspace-breadcrumb-link::after {
    content: "/";
    margin-left: 8px;
    color: var(--user-text-soft);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.workspace-section {
    border: 1px solid var(--user-border);
    border-radius: var(--user-radius-md);
    background: rgba(8, 12, 20, 0.34);
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

.workspace-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--user-border);
}

.workspace-section-heading strong {
    font-size: 0.82rem;
    color: var(--user-text-muted);
}

.workspace-list {
    display: flex;
    flex-direction: column;
}

.workspace-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(177, 196, 232, 0.08);
}

.workspace-row:last-child {
    border-bottom: 0;
}

.workspace-folder-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.workspace-row-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.workspace-row-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(123, 144, 255, 0.14);
    border: 1px solid rgba(123, 144, 255, 0.18);
    color: #eef3ff;
    font-size: 0.82rem;
    font-weight: 700;
}

.workspace-row-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workspace-row-copy strong,
.workspace-row-copy span,
.workspace-row-meta {
    overflow-wrap: anywhere;
}

.workspace-row-copy span,
.workspace-row-meta {
    color: var(--user-text-soft);
    font-size: 0.8rem;
}

.workspace-file-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.workspace-download-button {
    white-space: nowrap;
}

.workspace-empty-state {
    flex: 1;
    min-height: 180px;
    padding: 24px;
}

@media (max-width: 980px) {
    body.user-body-messaging {
        overflow: auto;
    }

    body.user-body-messaging .user-shell {
        height: auto;
        min-height: 100vh;
    }

    body.user-body-messaging .user-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    body.user-body-messaging .topbar-controls {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }

    body.user-body-messaging .server-upload-form,
    .session-form-compact {
        min-width: 0;
        justify-content: flex-start;
    }

    .session-select.compact-select {
        width: 100%;
        min-width: 0;
    }

    body.user-body-messaging .messaging-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body.user-body-messaging .conversation-pane.is-hidden-mobile {
        display: none;
    }

    body.user-body-messaging .chat-card,
    body.user-body-messaging .chat-empty-state {
        min-height: calc(100vh - 160px);
    }

    body.user-body-messaging .mobile-backlink {
        display: inline-flex;
    }

    body.user-body-messaging .chat-header-main {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.user-body-messaging .call-screen-shell {
        padding:
            clamp(18px, 3vw, 28px)
            clamp(18px, 4vw, 28px)
            calc(max(18px, env(safe-area-inset-bottom)) + 10px);
    }

    body.user-body-messaging .call-screen-body {
        padding:
            clamp(24px, 6vh, 56px)
            0
            calc(170px + max(18px, env(safe-area-inset-bottom)));
    }

    body.user-body-messaging .call-screen-controls {
        gap: 14px;
    }

    body.user-body-messaging .message-bubble {
        max-width: 88%;
    }

    body.user-body-messaging .composer {
        flex-direction: column;
        align-items: stretch;
    }

    body.user-body-messaging .composer-message-form {
        width: 100%;
    }

    body.user-body-workspace .user-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    body.user-body-workspace .topbar-controls {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-project-controls,
    .workspace-upload-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .workspace-file-actions {
        align-items: flex-start;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    body.user-body-messaging {
        overflow: hidden;
        background:
            radial-gradient(circle at top left, rgba(123, 144, 255, 0.08), transparent 24%),
            var(--user-bg);
    }

    .screen-share-viewer-modal {
        padding: 12px;
    }

    .screen-share-viewer-shell {
        max-height: calc(100vh - 24px);
        padding: 14px;
        border-radius: 18px;
    }

    .screen-share-viewer-header {
        flex-direction: column;
        align-items: stretch;
    }

    .screen-share-viewer-body {
        min-height: 48vh;
    }

    body.user-body-messaging .messaging-layout {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    body.user-body-messaging .conversation-pane.is-hidden-mobile {
        display: none !important;
    }

    body.user-body-messaging .user-shell {
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        gap: 0;
    }

    body.user-body-messaging .user-topbar {
        padding: 14px 16px 10px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid var(--user-border);
        background: rgba(8, 12, 20, 0.94);
        backdrop-filter: blur(16px);
    }

    body.user-body-messaging .user-topbar.is-chat-active {
        display: none;
    }

    body.user-body-messaging .user-kicker,
    body.user-body-messaging .topbar-user-card,
    body.user-body-messaging .surface-home-link,
    body.user-body-messaging .server-upload-form,
    body.user-body-messaging .chat-action-group,
    body.user-body-messaging .conversation-role,
    body.user-body-messaging .chat-card-direct .message-author,
    body.user-body-messaging .chat-card-direct .message-author-title,
    body.user-body-messaging .file-message-meta,
    body.user-body-messaging .desktop-inline {
        display: none;
    }

    body.user-body-messaging .mobile-inline {
        display: inline;
    }

    body.user-body-messaging .topbar-title {
        align-items: center;
        gap: 0;
    }

    body.user-body-messaging .topbar-title h1 {
        font-size: 1.12rem;
    }

    body.user-body-messaging .topbar-controls {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex: 0 0 auto;
    }

    body.user-body-messaging .logout-form .secondary-button {
        min-width: 64px;
        padding: 9px 12px;
        border-radius: 999px;
    }

    body.user-body-messaging .flash-banner {
        margin: 0 12px 8px;
        width: auto;
        border-radius: 18px;
    }

    body.user-body-messaging .messaging-layout {
        display: block;
        flex: 1;
        min-height: 0;
        margin: 0;
    }

    body.user-body-messaging .conversation-pane,
    body.user-body-messaging .chat-pane {
        height: 100%;
        min-height: 0;
    }

    body.user-body-messaging .chat-pane.is-empty {
        display: none;
    }

    body.user-body-messaging .conversation-hub,
    body.user-body-messaging .chat-card,
    body.user-body-messaging .chat-empty-state {
        height: 100%;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        backdrop-filter: none;
    }

    body.user-body-messaging .conversation-hub {
        padding: 0;
    }

    body.user-body-messaging .left-pane-top {
        gap: 10px;
        padding: 10px 16px 10px;
        border-bottom: 0;
    }

    body.user-body-messaging .mini-profile {
        display: none;
    }

    body.user-body-messaging .profile-details {
        padding: 0;
        border: 0;
        background: transparent;
    }

    body.user-body-messaging .profile-details summary {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.76rem;
        color: var(--user-accent);
    }

    body.user-body-messaging .profile-form {
        margin-top: 10px;
        padding: 14px;
        border: 1px solid var(--user-border);
        border-radius: 18px;
        background: rgba(15, 22, 33, 0.82);
    }

    body.user-body-messaging .compact-search .search-input {
        padding: 12px 14px;
        border-radius: 20px;
    }

    body.user-body-messaging .roster-scroll {
        padding: 2px 16px calc(20px + env(safe-area-inset-bottom));
        gap: 18px;
    }

    body.user-body-messaging .list-section {
        gap: 8px;
    }

    body.user-body-messaging .list-section:first-child .list-section-header {
        display: none;
    }

    body.user-body-messaging .pane-kicker {
        font-size: 0.68rem;
        letter-spacing: 0.1em;
        padding: 0 2px;
    }

    body.user-body-messaging .conversation-list {
        gap: 0;
    }

    body.user-body-messaging .conversation-item {
        padding: 11px 0;
        border: 0;
        border-bottom: 1px solid rgba(177, 196, 232, 0.1);
        border-radius: 0;
        background: transparent;
    }

    body.user-body-messaging .conversation-item:hover,
    body.user-body-messaging .conversation-item.is-active {
        border-color: rgba(177, 196, 232, 0.16);
        background: transparent;
    }

    body.user-body-messaging .conversation-item-main {
        align-items: center;
        gap: 12px;
    }

    body.user-body-messaging .conversation-avatar {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 16px;
        font-size: 0.9rem;
    }

    body.user-body-messaging .conversation-copy-top {
        align-items: center;
        gap: 10px;
    }

    body.user-body-messaging .conversation-copy-top strong {
        font-size: 0.93rem;
    }

    body.user-body-messaging .conversation-meta {
        gap: 6px;
        font-size: 0.72rem;
        color: var(--user-text-soft);
        white-space: nowrap;
    }

    body.user-body-messaging .conversation-copy p {
        margin-top: 4px;
        font-size: 0.82rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        overflow: hidden;
    }

    body.user-body-messaging .empty-state-list {
        min-height: 180px;
        border: 1px dashed var(--user-border);
        border-radius: 22px;
        background: rgba(15, 22, 33, 0.72);
    }

    body.user-body-messaging .chat-card {
        display: flex;
        flex-direction: column;
        background: transparent;
    }

    body.user-body-messaging .chat-header {
        padding: 10px 12px 9px;
        background: rgba(8, 12, 20, 0.94);
        border-bottom: 1px solid var(--user-border);
    }

    body.user-body-messaging .chat-header-main {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
    }

    body.user-body-messaging .mobile-backlink {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 999px;
        color: var(--user-text);
        border: 1px solid var(--user-border);
        background: rgba(255, 255, 255, 0.04);
        font-size: 1rem;
        line-height: 1;
    }

    body.user-body-messaging .chat-header-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 14px;
    }

    body.user-body-messaging .chat-header-copy h2 {
        font-size: 0.96rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.user-body-messaging .chat-header-title-row {
        gap: 8px;
    }

    body.user-body-messaging .chat-header-actions {
        width: auto;
        max-width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        flex: 0 0 auto;
        gap: 8px;
    }

    body.user-body-messaging .chat-files-button {
        padding: 6px 9px;
        font-size: 0.72rem;
    }

    body.user-body-messaging .chat-files-count {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
    }

    body.user-body-messaging .chat-files-popover {
        position: fixed;
        top: calc(76px + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: min(58vh, 420px);
    }

    body.user-body-messaging .chat-files-item {
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
    }

    body.user-body-messaging .call-button {
        min-width: 72px;
        border-radius: 999px;
    }

    body.user-body-messaging .chat-subtitle {
        margin-top: 2px;
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.user-body-messaging .chat-action-group,
    body.user-body-messaging .call-button-reason {
        display: none;
    }

    body.user-body-messaging .call-screen-shell {
        padding:
            calc(14px + env(safe-area-inset-top))
            16px
            calc(18px + env(safe-area-inset-bottom));
        gap: 20px;
    }

    body.user-body-messaging .call-screen-topbar {
        align-items: center;
        justify-content: center;
    }

    body.user-body-messaging .call-screen-body {
        padding:
            18px
            0
            calc(154px + env(safe-area-inset-bottom));
    }

    body.user-body-messaging .call-debug-panel {
        left: 16px;
        right: 16px;
        width: auto;
        bottom: calc(182px + env(safe-area-inset-bottom));
    }

    body.user-body-messaging .call-debug-dump {
        max-height: min(30vh, 260px);
        font-size: 0.68rem;
    }

    body.user-body-messaging .call-screen-brand {
        display: none;
    }

    body.user-body-messaging .call-screen-identity {
        gap: 24px;
    }

    body.user-body-messaging .call-screen-avatar {
        width: 138px;
        height: 138px;
        box-shadow:
            0 0 0 12px rgba(255, 255, 255, 0.04),
            0 0 0 24px rgba(255, 255, 255, 0.024),
            0 22px 56px rgba(2, 7, 14, 0.38);
    }

    body.user-body-messaging .call-screen-title {
        font-size: 2.2rem;
    }

    body.user-body-messaging .call-screen-status {
        font-size: 1.06rem;
    }

    body.user-body-messaging .call-screen-status-detail,
    body.user-body-messaging .call-screen-subtitle {
        font-size: 0.9rem;
    }

    body.user-body-messaging .call-screen-footer {
        left: 16px;
        right: 16px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        gap: 14px;
    }

    body.user-body-messaging .call-screen-secondary-actions {
        width: 100%;
        gap: 10px;
    }

    body.user-body-messaging .call-secondary-action {
        flex: 1 1 160px;
    }

    body.user-body-messaging .call-screen-controls {
        width: min(100%, 320px);
        gap: 16px;
    }

    body.user-body-messaging .call-control-button {
        min-width: 88px;
    }

    body.user-body-messaging .call-control-button-face {
        width: 72px;
        height: 72px;
    }

    body.user-body-messaging .call-control-button-label {
        font-size: 0.76rem;
    }

    body.user-body-messaging .call-screen[data-call-ui-mode="incoming"] .call-screen-controls {
        width: min(100%, 256px);
    }

    body.user-body-messaging .call-screen[data-call-ui-mode="active"] .call-screen-controls {
        width: min(100%, 340px);
    }

    body.user-body-messaging .call-screen[data-call-ui-mode="outgoing"] .call-screen-controls {
        width: min(100%, 108px);
    }

    body.user-body-messaging .call-screen[data-call-ui-mode="terminal"] .call-screen-body {
        padding-bottom: 24px;
    }

    body.user-body-messaging .message-timeline {
        padding: 14px 12px 18px;
        gap: 10px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.012), rgba(255, 255, 255, 0)),
            rgba(8, 12, 20, 0.32);
    }

    body.user-body-messaging .message-bubble {
        max-width: 82%;
        padding: 10px 12px 8px;
        border-radius: 18px;
    }

    body.user-body-messaging .message-row.is-received .message-bubble {
        border-top-left-radius: 8px;
    }

    body.user-body-messaging .message-row.is-sent .message-bubble {
        border-top-right-radius: 8px;
    }

    body.user-body-messaging .message-body {
        font-size: 0.91rem;
        line-height: 1.45;
    }

    body.user-body-messaging .image-message-card,
    body.user-body-messaging .audio-message-card,
    body.user-body-messaging .file-message-card {
        gap: 5px;
        padding: 10px;
        border-radius: 16px;
        background: rgba(8, 12, 20, 0.28);
    }

    body.user-body-messaging .image-message-preview {
        width: min(100%, 260px);
        max-height: 220px;
    }

    body.user-body-messaging .file-message-link {
        font-size: 0.78rem;
        padding: 6px 9px;
    }

    body.user-body-messaging .message-time {
        margin-top: 4px;
        font-size: 0.68rem;
    }

    body.user-body-messaging .composer {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--user-border);
        background: rgba(8, 12, 20, 0.96);
        backdrop-filter: blur(14px);
        flex-direction: row;
        align-items: flex-end;
        gap: 8px;
    }

    body.user-body-messaging .composer-tools {
        flex: 0 0 auto;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    body.user-body-messaging .composer-message-form {
        flex: 1;
        width: auto;
        align-items: flex-end;
        gap: 8px;
    }

    body.user-body-messaging .composer-tools .icon-button {
        width: 44px;
        height: 44px;
        border-radius: 999px;
    }

    body.user-body-messaging .composer-input {
        min-height: 46px;
        max-height: 120px;
        padding: 12px 14px;
        border-radius: 24px;
        line-height: 1.35;
    }

    body.user-body-messaging .composer-button {
        min-width: 72px;
        padding: 11px 14px;
        border-radius: 999px;
    }

    body.user-body-messaging .composer-status {
        flex-basis: 100%;
        max-width: none;
        padding-left: 2px;
        font-size: 0.72rem;
    }

    body.user-body-messaging .chat-empty-state {
        padding: 32px 20px;
    }

    body.user-body-workspace .user-shell {
        padding: 0;
        gap: 0;
    }

    body.user-body-workspace .user-topbar {
        padding: 14px 16px 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        border-bottom: 1px solid var(--user-border);
        background: rgba(8, 12, 20, 0.94);
        backdrop-filter: blur(16px);
    }

    body.user-body-workspace .topbar-controls {
        justify-content: space-between;
        gap: 8px;
    }

    body.user-body-workspace .topbar-user-card {
        display: none;
    }

    body.user-body-workspace .workspace-layout {
        margin: 0;
    }

    body.user-body-workspace .flash-banner {
        margin: 10px 12px 0;
        width: auto;
        border-radius: 18px;
    }

    body.user-body-workspace .workspace-browser {
        padding: 12px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        backdrop-filter: none;
    }

    body.user-body-workspace .user-kicker {
        display: none;
    }

    body.user-body-workspace .topbar-title h1 {
        font-size: 1.08rem;
    }

    body.user-body-workspace .user-app-nav {
        gap: 6px;
    }

    body.user-body-workspace .user-app-nav-link {
        min-height: 30px;
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    body.user-body-workspace .workspace-header-copy h2 {
        font-size: 1.08rem;
    }

    body.user-body-workspace .workspace-breadcrumbs,
    body.user-body-workspace .workspace-section,
    body.user-body-workspace .workspace-upload-form {
        border-radius: 18px;
    }

    body.user-body-workspace .workspace-row {
        align-items: flex-start;
        flex-direction: column;
    }

    body.user-body-workspace .workspace-file-actions {
        width: 100%;
    }

    body.user-body-workspace .workspace-download-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 640px) {
    body.user-body-messaging .conversation-copy-top {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    body.user-body-messaging .topbar-title h1 {
        font-size: 1.06rem;
    }

    body.user-body-messaging .logout-form .secondary-button {
        min-width: 64px;
    }
}

@media (min-width: 981px) {
    body.user-body-messaging .user-shell {
        padding: 14px 18px;
    }

    body.user-body-messaging .user-topbar {
        align-items: center;
        margin-bottom: 2px;
    }

    body.user-body-messaging .messaging-layout {
        gap: 14px;
    }

    body.user-body-messaging .conversation-hub,
    body.user-body-messaging .chat-card {
        border-color: rgba(177, 196, 232, 0.14);
        background:
            linear-gradient(180deg, rgba(18, 27, 42, 0.96), rgba(12, 18, 29, 0.96));
    }

    body.user-body-messaging .conversation-hub {
        padding: 14px 12px 14px 14px;
    }

    body.user-body-messaging .left-pane-top {
        gap: 12px;
        padding: 6px 6px 12px 4px;
    }

    body.user-body-messaging .profile-details,
    body.user-body-messaging .search-input,
    body.user-body-messaging .composer-input {
        background: rgba(255, 255, 255, 0.035);
        border-color: rgba(177, 196, 232, 0.14);
    }

    body.user-body-messaging .roster-scroll,
    body.user-body-messaging .message-timeline,
    body.user-body-messaging .chat-files-list {
        scrollbar-gutter: stable;
    }

    body.user-body-messaging .roster-scroll {
        gap: 14px;
        padding: 12px 5px 0 0;
    }

    body.user-body-messaging .list-section {
        gap: 9px;
    }

    body.user-body-messaging .list-section-header {
        padding: 0 4px;
    }

    body.user-body-messaging .conversation-list {
        gap: 6px;
    }

    body.user-body-messaging .conversation-item {
        padding: 10px;
        border-radius: 16px;
        border-color: rgba(177, 196, 232, 0.08);
        background: rgba(255, 255, 255, 0.018);
    }

    body.user-body-messaging .conversation-item:hover {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(177, 196, 232, 0.16);
    }

    body.user-body-messaging .conversation-item.is-active {
        background:
            linear-gradient(135deg, rgba(123, 144, 255, 0.14), rgba(123, 144, 255, 0.06));
        border-color: rgba(123, 144, 255, 0.26);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    body.user-body-messaging .conversation-copy-top strong,
    body.user-body-messaging .conversation-meta,
    body.user-body-messaging .conversation-copy p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.user-body-messaging .conversation-copy-top strong {
        min-width: 0;
    }

    body.user-body-messaging .conversation-meta {
        flex: 0 0 auto;
        max-width: 92px;
    }

    body.user-body-messaging .chat-header {
        padding: 16px 20px;
    }

    body.user-body-messaging .chat-header-actions .secondary-button {
        min-height: 44px;
        min-width: 98px;
    }

    body.user-body-messaging .message-timeline {
        padding: 18px 20px;
        gap: 10px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)),
            rgba(8, 12, 20, 0.44);
    }

    body.user-body-messaging .message-bubble {
        max-width: min(56%, 640px);
        border-radius: 16px;
        padding: 10px 13px;
        box-shadow: 0 10px 24px rgba(2, 7, 14, 0.16);
    }

    body.user-body-messaging .message-row.is-received .message-bubble {
        border-top-left-radius: 8px;
    }

    body.user-body-messaging .message-row.is-sent .message-bubble {
        border-top-right-radius: 8px;
    }

    body.user-body-messaging .composer {
        gap: 12px;
        padding: 14px 20px 18px;
        background: rgba(8, 12, 20, 0.36);
    }

    body.user-body-messaging .composer-tools .icon-button {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    body.user-body-messaging .composer-input {
        min-height: 52px;
        max-height: 118px;
        padding: 14px 16px;
        border-radius: 16px;
        line-height: 1.35;
    }

    body.user-body-messaging .composer-button {
        min-height: 52px;
        min-width: 102px;
        border-radius: 16px;
    }
}
