/* NetPro Chat — glassmorphism + #2563EB accent, mobile-first */
#messenger-root {
    --nc-brand: #2563EB;
    --nc-brand-dark: #1D4ED8;
    --nc-brand-light: #EFF6FF;
    --nc-bg: rgba(255, 255, 255, 0.42);
    --nc-bg-soft: rgba(255, 255, 255, 0.55);
    --nc-bg-chat: rgba(241, 245, 249, 0.35);
    --nc-text: #0f172a;
    --nc-text-muted: #64748B;
    --nc-text-hint: #94A3B8;
    --nc-border: rgba(255, 255, 255, 0.72);
    --nc-glass-border: rgba(255, 255, 255, 0.85);
    --nc-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    --nc-glass-shadow: 0 8px 32px rgba(37, 99, 235, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
    --nc-glass-blur: blur(18px) saturate(165%);
    --nc-bubble-out: rgba(37, 99, 235, 0.88);
    --nc-bubble-in: rgba(255, 255, 255, 0.72);
    --nc-online: #22C55E;
    --nc-radius: 1.15rem;
    --nc-radius-sm: 0.75rem;
    --nc-shadow: var(--nc-glass-shadow);
    font-family: 'Vazirmatn', 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--nc-text);
    height: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 70% at 15% 0%, rgba(37, 99, 235, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 70% 55% at 95% 15%, rgba(99, 102, 241, 0.16) 0%, transparent 50%),
        radial-gradient(ellipse 60% 45% at 50% 100%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
        linear-gradient(165deg, rgba(239, 246, 255, 0.95) 0%, rgba(248, 250, 252, 0.88) 45%, rgba(241, 245, 249, 0.92) 100%);
}

#messenger-root::before,
#messenger-root::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
    opacity: 0.55;
}

#messenger-root::before {
    width: 12rem;
    height: 12rem;
    top: -3rem;
    inset-inline-start: -2rem;
    background: rgba(37, 99, 235, 0.35);
}

#messenger-root::after {
    width: 10rem;
    height: 10rem;
    bottom: 4rem;
    inset-inline-end: -1.5rem;
    background: rgba(139, 92, 246, 0.22);
}

.nc-app {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: min(28rem, calc(100dvh - 8rem));
    height: 100%;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: var(--nc-glass-blur);
    -webkit-backdrop-filter: var(--nc-glass-blur);
    border-radius: var(--nc-radius);
    overflow: hidden;
    border: 1px solid var(--nc-glass-border);
    box-shadow: var(--nc-glass-shadow), var(--nc-glass-highlight);
    position: relative;
    z-index: 1;
}

.nc-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: ncFadeIn 0.28s ease;
}

@keyframes ncFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* Splash / legacy screens */
.nc-splash {
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, rgba(239, 246, 255, 0.85), rgba(255, 255, 255, 0.45));
    gap: 1rem;
    padding: 2rem;
}
.nc-splash__title { font-size: 1.35rem; font-weight: 800; color: var(--nc-brand); margin: 0; }
.nc-splash__dots { display: flex; gap: 0.35rem; }
.nc-splash__dots span {
    width: 0.45rem; height: 0.45rem; border-radius: 999px; background: var(--nc-brand);
    animation: ncDot 1.2s infinite ease-in-out;
}
.nc-splash__dots span:nth-child(2) { animation-delay: 0.15s; }
.nc-splash__dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ncDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.nc-welcome {
    position: relative;
    overflow: hidden;
    background: rgba(239, 246, 255, 0.55);
    justify-content: flex-end;
    padding: 1.5rem;
}
.nc-welcome__float {
    position: absolute;
    width: 2.75rem; height: 2.75rem;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.85rem;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
    backdrop-filter: blur(8px);
}
.nc-welcome__float--1 { top: 12%; left: 8%; }
.nc-welcome__float--2 { top: 22%; right: 12%; }
.nc-welcome__float--3 { top: 45%; left: 18%; }
.nc-welcome__float--4 { top: 8%; right: 35%; }
.nc-welcome__float--5 { top: 38%; right: 8%; }
.nc-welcome__float--6 { top: 55%; left: 45%; }
.nc-welcome__body {
    position: relative; z-index: 1;
    background: var(--nc-bg-soft);
    backdrop-filter: var(--nc-glass-blur);
    -webkit-backdrop-filter: var(--nc-glass-blur);
    border: 1px solid var(--nc-glass-border);
    border-radius: var(--nc-radius);
    padding: 1.5rem;
    box-shadow: var(--nc-glass-shadow), var(--nc-glass-highlight);
    text-align: center;
}
.nc-welcome__body h1 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.nc-welcome__body p { margin: 0 0 1rem; color: var(--nc-text-muted); font-size: 0.82rem; line-height: 1.6; }

/* Top bars — frosted glass */
.nc-auth__head, .nc-topbar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.nc-topbar--brand {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.82) 0%, rgba(59, 130, 246, 0.72) 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.nc-topbar--brand h1 { flex: 1; margin: 0; font-size: 1rem; font-weight: 700; text-align: center; letter-spacing: -0.01em; }
.nc-auth__head h2 { flex: 1; margin: 0; font-size: 1rem; }
.nc-spacer { width: 2.25rem; }

.nc-form { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; overflow-y: auto; }
.nc-form--pad { flex: 1; }
.nc-field { display: flex; flex-direction: column; gap: 0.25rem; }
.nc-field span { font-size: 0.68rem; font-weight: 700; color: var(--nc-text-muted); }
.nc-field input, .nc-field textarea {
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--nc-radius-sm);
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.nc-form__label { font-size: 0.72rem; font-weight: 700; color: var(--nc-text-muted); margin: 0.25rem 0 0; }

.nc-profile-upload {
    padding: 2rem 1rem;
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.nc-profile-upload__ring { cursor: pointer; text-align: center; }
.nc-profile-upload__preview {
    width: 6.5rem; height: 6.5rem;
    border-radius: 999px;
    border: 3px solid rgba(37, 99, 235, 0.65);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    margin: 0 auto 0.5rem;
    background: rgba(239, 246, 255, 0.75);
    backdrop-filter: blur(12px);
}
.nc-profile-upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.nc-profile-upload__hint { font-size: 0.75rem; color: var(--nc-text-muted); }

.nc-success, .nc-home-welcome, .nc-empty {
    align-items: center; justify-content: center;
    text-align: center; padding: 2rem; gap: 0.75rem;
}
.nc-success__icon { font-size: 2.5rem; }

/* Buttons */
.nc-btn {
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--nc-radius-sm);
    padding: 0.7rem 1.1rem;
    font-family: inherit; font-weight: 700; font-size: 0.85rem;
    cursor: pointer; transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.nc-btn:active { transform: scale(0.98); }
.nc-btn--primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.92));
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.nc-btn--primary:hover { background: linear-gradient(135deg, rgba(29, 78, 216, 0.98), rgba(30, 64, 175, 0.95)); }
.nc-btn--ghost {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    color: var(--nc-text);
}
.nc-btn--danger { background: rgba(254, 226, 226, 0.85); color: #B91C1C; border-color: rgba(254, 202, 202, 0.8); }
.nc-btn--block { width: 100%; }

.nc-icon-btn {
    width: 2.25rem; height: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 1.25rem; line-height: 1;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.nc-icon-btn--light {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Chat list */
.nc-search {
    padding: 0.65rem 0.85rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.nc-search input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    padding: 0.6rem 0.9rem;
    font-family: inherit;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 10px rgba(37, 99, 235, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nc-search input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.nc-chat-list, .nc-contact-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0.45rem 0.65rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nc-chat-item, .nc-contact-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--nc-radius-sm);
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(14px) saturate(155%);
    -webkit-backdrop-filter: blur(14px) saturate(155%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.nc-chat-item:hover, .nc-contact-item:hover {
    background: rgba(255, 255, 255, 0.68);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.nc-chat-item:active, .nc-contact-item:active { transform: scale(0.99); }

.nc-chat-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.nc-chat-item__row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.nc-chat-item__row strong { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-chat-item__row time { font-size: 0.62rem; color: var(--nc-text-hint); flex-shrink: 0; }
.nc-chat-item__preview { font-size: 0.72rem; color: var(--nc-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nc-badge {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.9));
    color: #fff;
    font-size: 0.62rem; font-weight: 700;
    min-width: 1.15rem; height: 1.15rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.nc-fab {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    width: 3.15rem;
    height: 3.15rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.88));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    box-shadow:
        0 10px 28px rgba(37, 99, 235, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    z-index: 5;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nc-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.nc-fab:active { transform: scale(0.96); }

.nc-pick-actions { padding: 0.35rem 0.75rem 0.5rem; }
.nc-pick-btn {
    width: 100%;
    border: 1px dashed rgba(37, 99, 235, 0.45);
    background: rgba(239, 246, 255, 0.65);
    backdrop-filter: blur(10px);
    color: var(--nc-brand);
    border-radius: var(--nc-radius-sm);
    padding: 0.65rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.nc-empty-hint {
    padding: 1.5rem;
    text-align: center;
    color: var(--nc-text-muted);
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: var(--nc-radius-sm);
    backdrop-filter: blur(10px);
}

/* Avatar */
.nc-avatar {
    position: relative;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    overflow: visible;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.nc-avatar--sm { width: 2.35rem; height: 2.35rem; font-size: 0.68rem; }
.nc-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.nc-avatar__online {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    width: 0.55rem;
    height: 0.55rem;
    background: var(--nc-online);
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}
.nc-avatar--feed, .nc-avatar--group {
    background: rgba(239, 246, 255, 0.85);
    backdrop-filter: blur(8px);
    color: var(--nc-brand);
}

/* Conversation */
.nc-chat-view {
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
        rgba(241, 245, 249, 0.28);
}
.nc-chat-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.82) 0%, rgba(59, 130, 246, 0.72) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #fff;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.nc-chat-header__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nc-chat-header__info strong { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-chat-header__info small { font-size: 0.62rem; opacity: 0.88; }
.nc-chat-header__info--btn {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: inherit;
    text-align: right;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}
.nc-chat-header__info--btn:hover small { opacity: 1; }

/* Group info */
.nc-group-info__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 0.85rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(12px);
}
.nc-group-info__head strong { display: block; font-size: 0.95rem; }
.nc-group-info__head small { color: var(--nc-text-muted); font-size: 0.72rem; }
.nc-group-info__icon { width: 3rem; height: 3rem; font-size: 1.25rem; }
.nc-group-info__actions { padding: 0.65rem 0.85rem 0.35rem; }

.nc-member-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0.45rem 0.65rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.nc-member-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--nc-radius-sm);
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(14px) saturate(155%);
    -webkit-backdrop-filter: blur(14px) saturate(155%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
.nc-member-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.nc-member-item__body strong { font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-member-item__body small { font-size: 0.65rem; color: var(--nc-text-hint); direction: ltr; text-align: right; }
.nc-member-item__meta { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.nc-member-badge {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--nc-brand);
}
.nc-member-badge--you { background: rgba(100, 116, 139, 0.12); color: var(--nc-text-muted); }
.nc-member-remove {
    border: 1px solid rgba(254, 202, 202, 0.8);
    background: rgba(254, 226, 226, 0.75);
    color: #B91C1C;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
}
.nc-member-remove:hover { background: rgba(254, 202, 202, 0.9); }

.nc-check-item--member {
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--nc-radius-sm);
    background: rgba(255, 255, 255, 0.42);
}
.nc-check-list--members { max-height: none; flex: 1; }

.nc-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0.85rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.nc-msg { display: flex; max-width: 85%; }
.nc-msg--out { align-self: flex-start; margin-inline-start: auto; }
.nc-msg--in { align-self: flex-end; }
.nc-msg--sys {
    align-self: center;
    font-size: 0.65rem;
    color: var(--nc-text-hint);
    padding: 0.35rem 0.65rem;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.nc-bubble {
    padding: 0.6rem 0.75rem;
    border-radius: 1.05rem;
    font-size: 0.82rem;
    line-height: 1.55;
    word-break: break-word;
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}
.nc-msg--out .nc-bubble {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.85));
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
    border-bottom-left-radius: 0.3rem;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.nc-msg--in .nc-bubble {
    background: rgba(255, 255, 255, 0.72);
    color: var(--nc-text);
    border-color: rgba(255, 255, 255, 0.88);
    border-bottom-right-radius: 0.3rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.nc-bubble__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
    margin-top: 0.2rem;
    font-size: 0.58rem;
    opacity: 0.88;
}
.nc-tick { letter-spacing: -0.15em; }
.nc-tick--read { color: #BFDBFE; }
.nc-typing {
    font-size: 0.68rem;
    color: var(--nc-text-muted);
    padding: 0.35rem 0.65rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    align-self: flex-end;
    backdrop-filter: blur(8px);
}

.nc-compose {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(165%);
    -webkit-backdrop-filter: blur(18px) saturate(165%);
    border-top: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}
.nc-compose__input {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    padding: 0.6rem 0.9rem;
    font-family: inherit;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.nc-compose__input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.nc-compose__send {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.9));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.nc-feed-note {
    text-align: center;
    font-size: 0.68rem;
    color: var(--nc-text-muted);
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
}

/* Settings / overlay */
.nc-settings { flex: 1; overflow-y: auto; padding: 0.75rem; }
.nc-settings__block {
    background: rgba(255, 255, 255, 0.52);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--nc-radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.65rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.nc-settings__block h3 { margin: 0 0 0.5rem; font-size: 0.78rem; color: var(--nc-text-muted); }
.nc-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    font-size: 0.82rem;
}
.nc-check-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 12rem; overflow-y: auto; }
.nc-check-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; padding: 0.35rem 0; }

.nc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    z-index: 20;
}
.nc-sheet {
    width: 100%;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--nc-radius) var(--nc-radius) 0 0;
    padding: 0.5rem 0 1rem;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.nc-sheet__item {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.85rem 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    text-align: center;
    cursor: pointer;
}
.nc-sheet__item--danger { color: #B91C1C; }

/* Tab viewport sizing */
.messenger-tab-viewport #messenger-root .nc-app {
    min-height: min(32rem, calc(100dvh - var(--app-header-height, 3.75rem) - var(--mobile-nav-height, 4.25rem) - 0.5rem));
}

/* Dark mode */
html.dark #messenger-root {
    --nc-bg: rgba(30, 41, 59, 0.55);
    --nc-bg-soft: rgba(30, 41, 59, 0.68);
    --nc-bg-chat: rgba(15, 23, 42, 0.42);
    --nc-text: #f1f5f9;
    --nc-text-muted: #94a3b8;
    --nc-text-hint: #64748b;
    --nc-border: rgba(148, 163, 184, 0.22);
    --nc-glass-border: rgba(148, 163, 184, 0.28);
    --nc-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --nc-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    --nc-bubble-in: rgba(30, 41, 59, 0.78);
    background:
        radial-gradient(ellipse 90% 70% at 15% 0%, rgba(37, 99, 235, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 70% 55% at 95% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        linear-gradient(165deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.92) 100%);
}

html.dark #messenger-root::before { background: rgba(37, 99, 235, 0.22); opacity: 0.45; }
html.dark #messenger-root::after { background: rgba(139, 92, 246, 0.15); opacity: 0.4; }

html.dark .nc-app {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(148, 163, 184, 0.22);
}

html.dark .nc-topbar,
html.dark .nc-auth__head {
    background: rgba(30, 41, 59, 0.62);
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

html.dark .nc-topbar--brand,
html.dark .nc-chat-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.72) 0%, rgba(29, 78, 216, 0.62) 100%);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

html.dark .nc-search { background: rgba(15, 23, 42, 0.35); }
html.dark .nc-search input,
html.dark .nc-field input,
html.dark .nc-field textarea,
html.dark .nc-compose__input {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.25);
    color: #f1f5f9;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html.dark .nc-chat-item,
html.dark .nc-contact-item {
    background: rgba(30, 41, 59, 0.58);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), var(--nc-glass-highlight);
}
html.dark .nc-chat-item:hover,
html.dark .nc-contact-item:hover {
    background: rgba(51, 65, 85, 0.62);
}

html.dark .nc-icon-btn {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.25);
    color: #f1f5f9;
}

html.dark .nc-msg--in .nc-bubble {
    background: rgba(30, 41, 59, 0.82);
    border-color: rgba(148, 163, 184, 0.22);
    color: #f1f5f9;
}

html.dark .nc-compose,
html.dark .nc-feed-note {
    background: rgba(15, 23, 42, 0.62);
    border-top-color: rgba(148, 163, 184, 0.18);
}

html.dark .nc-empty-hint {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
}

html.dark .nc-member-item {
    background: rgba(30, 41, 59, 0.58);
    border-color: rgba(148, 163, 184, 0.22);
}
html.dark .nc-group-info__head {
    background: rgba(15, 23, 42, 0.35);
    border-bottom-color: rgba(148, 163, 184, 0.18);
}
html.dark .nc-check-item--member {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(148, 163, 184, 0.22);
}

html.dark .nc-sheet {
    background: rgba(30, 41, 59, 0.88);
    border-color: rgba(148, 163, 184, 0.25);
}

@media (min-width: 1024px) {
    .nc-fab { bottom: 1.25rem; left: 1.25rem; }
}
