.app-loading {
    position: absolute;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #005970;
    background: rgba(231, 240, 242, .96);
}

.app-loading .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: #ff6600;
}

.pwa-prompt {
    position: fixed;
    z-index: 6000;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px));
    left: max(14px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 13px 14px;
    color: #082d38;
    border: 1px solid #ffd1b3;
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 50px rgba(6, 39, 52, .28);
    backdrop-filter: blur(15px);
}

.pwa-prompt.d-none {
    display: none;
}

.pwa-prompt.is-update {
    border-color: #9fc4cc;
}

.pwa-prompt img {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

.pwa-prompt-copy {
    min-width: 0;
}

.pwa-prompt-copy strong,
.pwa-prompt-copy span {
    display: block;
}

.pwa-prompt-copy strong {
    color: #062734;
    font-size: 13px;
    font-weight: 900;
}

.pwa-prompt-copy span {
    margin-top: 3px;
    color: #66828c;
    font-size: 11px;
    line-height: 1.35;
}

.pwa-prompt-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pwa-prompt-actions .btn {
    white-space: nowrap;
    font-weight: 800;
}

.pwa-prompt-actions .btn-link {
    color: #66828c;
    text-decoration: none;
}

html[dir="rtl"] .pwa-prompt {
    direction: rtl;
}

.auth-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--page);
}

.auth-topbar {
    padding-top: max(8px, env(safe-area-inset-top));
}

.auth-app-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 0;
    object-fit: contain;
}

.auth-language-control {
    max-width: 150px;
    height: 36px;
    margin: 0;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 18px;
    color: #fff;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.auth-language-control span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-language-chevron {
    font-size: 10px;
}

.auth-language-screen .search-panel {
    display: block;
}

.auth-language-list {
    margin-top: 0;
}

.auth-language-choice .row-sub {
    text-transform: uppercase;
    letter-spacing: .06em;
}

#authLanguageSearch {
    direction: auto;
}

.auth-scroll {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.auth-card-body {
    padding: 18px 16px;
}

.auth-intro {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.auth-card .form-control,
.auth-card .form-select {
    min-height: 48px;
    border-radius: 8px;
    border-color: var(--line);
}

.auth-card .btn-kom {
    min-height: 46px;
}

.privacy-note {
    color: #66828c;
    font-size: 12px;
    line-height: 1.45;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-error {
    font-size: 13px;
}

.msg-tools {
    margin-top: 4px;
    text-align: right;
}

.msg-tools button {
    border: 0;
    padding: 0 3px;
    color: #66828c;
    background: transparent;
    font-size: 11px;
}

.reply-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: #005970;
    background: #fff7f0;
    border-top: 1px solid #ffd1b3;
    font-size: 12px;
}

.runtime-actions {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: #f7fbfc;
    border-bottom: 1px solid #c4d7dc;
    overflow-x: auto;
}

.runtime-actions .btn {
    white-space: nowrap;
}

.search-result-section {
    padding: 8px 10px 2px;
    color: #66828c;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.call-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: #062734;
}

.call-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(150px, 1fr);
    gap: 8px;
    padding: 8px;
    overflow-y: auto;
}

.video-tile {
    position: relative;
    min-height: 150px;
    overflow: hidden;
    border-radius: 16px;
    background: #0b4554;
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #041d25;
}

.video-label {
    position: absolute;
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,.55);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 10px calc(14px + env(safe-area-inset-bottom));
    background: #053744;
}

.call-control {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #005970;
    font-size: 21px;
}

.call-control.off,
.call-control.hangup {
    background: #dc3545;
}

.whiteboard-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #eef5f6;
}

.whiteboard-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid #c4d7dc;
}

.whiteboard-stage {
    flex: 1;
    min-height: 0;
    padding: 8px;
}

.whiteboard-toolbar input[type="color"] {
    width: 42px;
    height: 34px;
    padding: 2px;
    border: 1px solid #c4d7dc;
    border-radius: 8px;
}

.whiteboard-stage {
    flex: 1;
    min-height: 0;
    padding: 8px;
}

#whiteboardCanvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    background: #fff;
    border-radius: 12px;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    border: 1px solid #c4d7dc;
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 520px) {
    .call-grid { grid-template-columns: 1fr; }
    .pwa-prompt { grid-template-columns: 46px minmax(0, 1fr); gap: 9px 11px; padding: 12px; border-radius: 16px; }
    .pwa-prompt img { width: 46px; height: 46px; border-radius: 12px; }
    .pwa-prompt-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
