: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;
}

* {
    box-sizing: border-box;
}

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;
}

.incoming-call-banner {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--user-radius-md);
    border: 1px solid rgba(123, 144, 255, 0.22);
    background: rgba(22, 34, 53, 0.94);
    box-shadow: var(--user-shadow);
}

.incoming-call-banner.is-hidden,
.voice-call-panel.is-hidden {
    display: none;
}

.incoming-call-copy,
.voice-call-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.incoming-call-copy strong,
.voice-call-copy strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.incoming-call-copy span,
.voice-call-copy span,
.voice-call-note,
.call-button-reason,
.voice-call-presence {
    color: var(--user-text-soft);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

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

.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,
.profile-details,
.chat-subtitle,
.message-author-title,
.conversation-copy p,
.conversation-copy-top span {
    color: var(--user-text-soft);
    font-size: 0.79rem;
    font-weight: 400;
}

.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);
}

.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-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;
}

.voice-call-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--user-border);
    background: rgba(12, 18, 28, 0.88);
}

.voice-call-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.voice-call-presence {
    padding: 7px 10px;
    border: 1px solid var(--user-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.voice-call-presence[data-remote-state="connected"] {
    color: #dff9ee;
    border-color: rgba(96, 209, 153, 0.28);
}

.voice-call-note {
    margin: 0;
    flex-basis: 100%;
}

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

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

.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;
}

.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);
}

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

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

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

.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-time {
    display: block;
    margin-top: 6px;
    text-align: right;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.6);
}

.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 .incoming-call-banner,
    body.user-body-messaging .voice-call-panel {
        flex-direction: column;
        align-items: stretch;
    }

    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);
    }

    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 .incoming-call-banner {
        margin: 10px 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-actions {
        width: auto;
        max-width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        flex: 0 0 auto;
        gap: 8px;
    }

    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 .voice-call-panel {
        padding: 10px 12px;
    }

    body.user-body-messaging .voice-call-actions {
        justify-content: flex-start;
    }

    body.user-body-messaging .incoming-call-actions {
        width: 100%;
    }

    body.user-body-messaging .incoming-call-actions .primary-button,
    body.user-body-messaging .incoming-call-actions .secondary-button {
        flex: 1;
        border-radius: 999px;
    }

    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 .file-message-card {
        gap: 5px;
        padding: 10px;
        border-radius: 16px;
        background: rgba(8, 12, 20, 0.28);
    }

    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;
    }
}
