* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --secondary-color: #FFC107;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --error: #F44336;
    --success: #4CAF50;
}

/* Incoming call overlay (above all screens) */
.incoming-call-overlay {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    box-sizing: border-box;
}

.incoming-call-overlay.is-visible {
    display: flex;
}

.incoming-call-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 30, 55, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.incoming-call-card {
    position: relative;
    z-index: 1;
    max-width: 22rem;
    width: 100%;
    background: linear-gradient(165deg, #ffffff 0%, #f0f6ff 100%);
    border-radius: 24px;
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(25, 50, 90, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    animation: incoming-pulse 2.2s ease-in-out infinite;
}

@keyframes incoming-pulse {
    0%, 100% { box-shadow: 0 20px 50px rgba(25, 50, 90, 0.2), 0 0 0 0 rgba(33, 150, 243, 0.35); }
    50% { box-shadow: 0 24px 58px rgba(25, 50, 90, 0.28), 0 0 0 10px rgba(33, 150, 243, 0.12); }
}

.incoming-call-avatar {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 0.75rem;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.incoming-call-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--text-primary);
    word-break: break-word;
}

.incoming-call-label {
    font-size: 0.9rem;
    color: #5c7a9a;
    margin: 0 0 0.2rem;
}

.incoming-call-type-label {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin: 0 0 1.25rem;
}

.incoming-call-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 0.25rem;
}

.incoming-call-btn {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s;
}

.incoming-call-btn:hover {
    transform: scale(1.06);
}

.incoming-call-btn-reject {
    background: #ffebee;
    color: #c62828;
}

.incoming-call-btn-accept {
    background: #e8f5e9;
    color: #2e7d32;
}

.message-toast {
    --toast-bg: rgba(28, 38, 50, 0.72);
    --toast-border: rgba(255, 255, 255, 0.14);
    --toast-glow: rgba(120, 180, 255, 0.18);
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    z-index: 25000;
    max-width: min(92%, 24rem);
    width: max-content;
    min-width: 10rem;
    background: var(--toast-bg);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    color: #f0f4fa;
    padding: 0.9rem 1.15rem 0.9rem 1.25rem;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.4;
    border: 1px solid var(--toast-border);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.06) inset,
        0 8px 32px rgba(0, 10, 25, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.12),
        0 0 40px var(--toast-glow);
    transform: translateX(-50%) translateY(20px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity, filter;
    transition:
        opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.35s ease;
    filter: blur(0);
}

.message-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: blur(0);
    pointer-events: auto;
    animation: message-toast-ambient 0.5s ease-out 1;
}

.message-toast:not(.is-visible) {
    transition:
        opacity 0.3s ease-in,
        transform 0.35s ease-in,
        filter 0.25s ease;
}

@keyframes message-toast-ambient {
    0% {
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.06) inset,
            0 8px 32px rgba(0, 10, 25, 0.3),
            0 0 0 rgba(120, 200, 255, 0);
    }
    100% {
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.06) inset,
            0 8px 32px rgba(0, 10, 25, 0.35),
            0 0 32px var(--toast-glow);
    }
}

.message-toast strong {
    display: block;
    font-weight: 650;
    color: #e2ecf9;
    letter-spacing: 0.01em;
    margin-bottom: 0.15rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body {
    font-family: Inter, Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loading-spinner.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Call screen specific styling */
#call-screen.screen.active {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #E0E0E0;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #D0D0D0;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.error-message {
    color: var(--error);
    margin-top: 1rem;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* App Screen */
header {
    background: var(--surface);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
}

header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.menu-toggle:hover {
    opacity: 0.7;
}

.app-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    margin-top: -0.25rem;
    font-weight: normal;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.notification-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.notification-status.enabled {
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.notification-status.disabled {
    color: var(--text-secondary);
    background: rgba(117, 117, 117, 0.1);
    text-decoration: underline;
}

.notification-status.disabled:hover {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.language-switcher {
    display: flex;
    align-items: center;
}

.language-switcher select {
    padding: 0.5rem;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s;
}

.language-switcher select:hover {
    border-color: var(--primary-color);
}

.language-switcher select:focus {
    outline: none;
    border-color: var(--primary-color);
}

main {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.chat-layout {
    display: block;
    min-height: 70vh;
}

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

.chat-panel {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 65vh;
    overflow: hidden;
}

.chat-panel-header {
    padding: 0.9rem 1.1rem;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.chat-back-btn {
    border: none;
    background: #eef5ff;
    color: #2b8de8;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.15rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.chat-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.chat-status-text {
    margin: 0;
    font-size: 0.82rem;
    color: #7f93ad;
}

.chat-status-text.online {
    color: #73aee9;
}

.contact-item-pinned {
    border: 1px solid rgba(43, 141, 232, 0.25);
    background: linear-gradient(90deg, #f0f8ff 0%, #fff 100%);
    border-radius: 10px;
    margin-bottom: 0.35rem;
    box-shadow: 0 1px 6px rgba(43, 120, 200, 0.1);
}

.chat-bubble-sender-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #5a7a9a;
    margin: 0 0 0.2rem 0.05rem;
    line-height: 1.1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f4f8ff 100%);
}

.chat-message {
    max-width: 75%;
    padding: 0.62rem 0.9rem;
    border-radius: 16px;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.15rem;
}

.chat-message.mine {
    align-self: flex-end;
    background: #d8f7d5;
    border-bottom-right-radius: 8px;
}

.chat-message.pending {
    opacity: 0.72;
}

.chat-message.theirs {
    align-self: flex-start;
    background: #ffffff;
    border-bottom-left-radius: 8px;
}

.chat-message-time {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem;
    background: #ffffff;
}

#chat-input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #d9e3ef;
    padding: 0.75rem 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

#chat-input:focus {
    outline: none;
    border-color: #8fc0ef;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #56a8f5 0%, #2b8de8 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(43, 141, 232, 0.35);
}

.chat-send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.chat-send-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.contact-item .chat-open-btn {
    color: #2b8de8;
    position: relative;
}

.contact-item .chat-open-btn.has-unread::after {
    content: attr(data-unread-count);
    position: absolute;
    top: -0.25rem;
    right: -0.3rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.22rem;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    border: 1px solid #fff;
}

#app-screen.chat-view-list .chat-panel {
    display: none;
}

#app-screen.chat-view-list .chat-sidebar {
    display: block;
}

#app-screen.chat-view-dialog .chat-panel {
    display: flex;
    min-height: calc(100vh - 170px);
}

#app-screen.chat-view-dialog .chat-sidebar {
    display: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.25rem;
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item {
    background: var(--surface);
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.contact-info {
    width: 100%;
}

.contact-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.contact-name {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 1rem;
    line-height: 1.4;
}

.status-indicator {
    font-size: 1rem;
    display: inline-block;
    line-height: 1;
    flex-shrink: 0;
    padding: 0.25rem;
}

.status-indicator.online {
    opacity: 1;
}

.status-indicator.offline {
    opacity: 0.4;
}

.push-indicator {
    font-size: 1rem;
    display: inline-block;
    opacity: 0.7;
    line-height: 1;
    flex-shrink: 0;
    padding: 0.25rem;
}

.contact-actions {
    display: flex;
    gap: 0.15rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.contact-actions .btn-icon {
    font-size: 1rem;
    padding: 0.3rem;
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

/* Pending Invites Section */
.pending-invites-section {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.invites-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invite-item {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.invite-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.invite-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.invite-name {
    font-weight: 500;
    color: var(--text-primary);
}

.invite-link-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    word-break: break-all;
    font-family: monospace;
}

.invite-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-actions .btn {
    flex: 1;
}

.invite-link-container {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.invite-link-container input {
    flex: 1;
}

/* Call Screen */
.call-container {
    position: relative;
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #000;
    overflow: hidden;
}

.video-container {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-remote-solo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

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

.group-remote-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    gap: 0;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    z-index: 1;
}

.group-remote-grid.grid-3plus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.group-remote-grid[hidden] {
    display: none !important;
}

.group-remote-tile {
    position: relative;
    min-height: 0;
    background: #111;
    border-radius: 0;
    overflow: hidden;
    border: none;
    box-shadow: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.group-remote-tile.speaking {
    border-color: rgba(100, 220, 150, 0.65);
    box-shadow: 0 0 0 1px rgba(100, 220, 150, 0.35), 0 6px 28px rgba(0, 0, 0, 0.5);
}

.group-remote-tile video {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: #0a0a0a;
}

.group-tile-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.2rem 0.45rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: #000;
}

#local-video {
    position: absolute;
    bottom: 96px;
    right: 14px;
    width: 30vw;
    max-width: 170px;
    min-width: 110px;
    aspect-ratio: 3 / 4;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid white;
    background: #000;
    cursor: move;
    touch-action: none;
    z-index: 10;
    user-select: none;
    display: block;
    visibility: visible;
    transform: scaleX(-1);
}

.call-controls {
    position: absolute;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    z-index: 30;
}

.call-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-output-container {
    position: relative;
}

.audio-output-menu {
    display: none;
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border-radius: 12px;
    min-width: 250px;
    max-width: 300px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.audio-output-header {
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    text-align: center;
}

.audio-output-list {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

.audio-output-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: background 0.2s;
}

.audio-output-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.audio-output-item.active {
    background: rgba(33, 150, 243, 0.3);
}

.audio-output-item.active:hover {
    background: rgba(33, 150, 243, 0.4);
}

.audio-output-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.audio-output-label {
    flex: 1;
    font-size: 0.9rem;
    word-break: break-word;
}

.call-btn.end-call {
    background: var(--error);
}

.call-info {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 25;
    pointer-events: none;
}

.install-prompt {
    margin-top: 2rem;
    padding: 1rem;
    background: #E3F2FD;
    border-radius: 8px;
    text-align: center;
}

body.native-app .install-prompt,
body.native-app #install-app-prompt {
    display: none !important;
}

.prompt-banner {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.prompt-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.prompt-content span {
    flex: 1;
    font-weight: 500;
    min-width: 0;
    word-break: break-word;
}

.prompt-content .btn-small {
    flex-shrink: 0;
}

.prompt-content .btn-icon {
    flex-shrink: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.prompt-content .btn-icon {
    color: white;
    font-size: 1.5rem;
    padding: 0;
    min-width: auto;
}

.invite-message {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.invite-message p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
}

/* Mobile Menu */
.mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--surface);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #E0E0E0;
}

.mobile-menu-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.menu-close:hover {
    opacity: 0.7;
}

.mobile-menu-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-item label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.mobile-menu-item select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
}

.mobile-menu-item .btn {
    width: 100%;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    header {
        padding: 0.75rem;
    }
    
    header h2 {
        font-size: 1.25rem;
    }
    
    .mobile-menu {
        width: 260px;
    }

    .chat-panel {
        min-height: 50vh;
    }

    #app-screen.chat-view-dialog .chat-panel {
        min-height: calc(100vh - 140px);
    }
    
    .contact-item {
        padding: 0.6rem;
        gap: 0.4rem;
    }
    
    .contact-name {
        font-size: 0.95rem;
    }
    
    .status-indicator,
    .push-indicator {
        font-size: 0.9rem;
        padding: 0.2rem;
    }
    
    .contact-actions {
        gap: 0.1rem;
    }
    
    .contact-actions .btn-icon {
        font-size: 0.9rem;
        padding: 0.25rem;
        min-width: 1.75rem;
        height: 1.75rem;
    }
    
    .prompt-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .prompt-content span {
        width: 100%;
    }
    
    .prompt-content .btn-small {
        width: 100%;
    }
    
    .prompt-content .btn-icon {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .prompt-banner {
        position: relative;
    }
    
    #local-video {
        width: 120px;
        height: 160px;
    }
}

