
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Work+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

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

:root {
    --font: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ease: cubic-bezier(0.33, 0.86, 0.56, 1);
    --bg-primary: #0e0d11;
    --bg-secondary: #14131a;
    --bg-tertiary: #1c1b24;
    --bg-glass: rgba(22, 21, 30, 0.82);
    --bg-message-in: rgba(35, 34, 48, 0.72);
    --bg-message-out: rgba(255, 118, 52, 0.18);
    --accent-primary: #f97316;
    --accent-secondary: #fb923c;
    --accent-glow: rgba(249, 115, 22, 0.42);
    --text-primary: #f4f4f5;
    --text-secondary: #b4b3c0;
    --text-tertiary: #7c7b8a;
    --border-light: rgba(255, 255, 255, 0.065);
    --border-glow: rgba(249, 115, 22, 0.35);
    --shadow-raised: 0 5px 0 rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    --shadow-hover: 0 2px 0 rgba(0, 0, 0, 0.28), 0 12px 24px rgba(0, 0, 0, 0.34);
    --shadow-pressed: 0 0 0 rgba(0, 0, 0, 0);
    --glass-blur: blur(14px);
    --r-card: 14px;
    --r-pill: 999px;
}

body.theme-dark-blue {
    --bg-primary: #070a12;
    --bg-secondary: #0c101c;
    --bg-tertiary: #131a2a;
    --bg-glass: rgba(12, 16, 28, 0.88);
    --bg-message-in: rgba(26, 32, 52, 0.75);
    --bg-message-out: rgba(56, 189, 248, 0.16);
    --accent-primary: #38bdf8;
    --accent-secondary: #7dd3fc;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --border-glow: rgba(56, 189, 248, 0.32);
}

body.theme-light-orange {
    --bg-primary: #f2ede6;
    --bg-secondary: #faf6f1;
    --bg-tertiary: #ebe4db;
    --bg-glass: rgba(255, 252, 248, 0.92);
    --bg-message-in: rgba(255, 255, 255, 0.85);
    --bg-message-out: rgba(234, 88, 12, 0.12);
    --accent-primary: #ea580c;
    --accent-secondary: #f97316;
    --accent-glow: rgba(234, 88, 12, 0.3);
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #71717a;
    --border-light: rgba(0, 0, 0, 0.06);
    --border-glow: rgba(234, 88, 12, 0.28);
    --shadow-raised: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-pressed: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.fl-icon {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.18em;
    display: inline-block;
    object-fit: contain;
}
.fl-icon--md {
    width: 1.35em;
    height: 1.35em;
}
.fl-icon--lg {
    width: 1.5em;
    height: 1.5em;
}
.fl-icon--xl {
    width: 2.25em;
    height: 2.25em;
    display: block;
    margin: 0 auto;
}
.fl-icon--heading {
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.22em;
    margin-right: 0.35em;
    flex-shrink: 0;
}
.fl-heading-with-icon {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.close-modal .fl-icon {
    width: 1.05em;
    height: 1.05em;
    vertical-align: middle;
}
.media-permission-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.input-icon,
.call-btn,
.send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.input-icon .fl-icon,
.call-btn .fl-icon {
    width: 1.35em;
    height: 1.35em;
}
.send-btn .fl-icon {
    width: 1.2em;
    height: 1.2em;
}
.fl-icon--white {
    filter: brightness(0) invert(1);
}
body.theme-light-orange .fl-icon:not(.fl-icon--white):not(.fl-icon--tone-fixed) {
    opacity: 0.95;
    filter: brightness(0.4);
}

.notification-type-icon .fl-icon,
.notification-dismiss .fl-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: middle;
}
.notification-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 95% 55% at 50% -28%, var(--accent-glow), transparent 58%),
        radial-gradient(ellipse 42% 36% at 94% 96%, var(--accent-glow), transparent 42%);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.35s var(--ease), color 0.25s ease;
}

body.theme-light-orange {
    background-image: none;
}

button {
    position: relative;
    font-family: inherit;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: var(--r-pill);
    padding: 0.55rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.14s var(--ease), border-color 0.14s ease, box-shadow 0.14s ease, transform 0.09s linear;
    box-shadow: var(--shadow-raised);
    transform: translateY(-2px);
}

button:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

button:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-pressed);
}

.btn-primary,
.create-post-btn,
.send-btn,
.save-profile-btn,
.friend-action-btn,
.confirm-create-group-btn,
#joinGroupByInviteBtn,
#submitCommentBtn,
#doLoginBtn,
#registerBtn {
    background: var(--accent-primary);
    border-color: rgba(0, 0, 0, 0.12);
    color: #fff;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22), 0 0 16px var(--accent-glow);
}

.btn-primary:hover,
.create-post-btn:hover,
.send-btn:hover,
.save-profile-btn:hover,
.friend-action-btn:hover,
.confirm-create-group-btn:hover,
#joinGroupByInviteBtn:hover,
#submitCommentBtn:hover,
#doLoginBtn:hover,
#registerBtn:hover {
    background: var(--accent-secondary);
    filter: brightness(1.05);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22), 0 0 22px var(--accent-glow);
    transform: translateY(-3px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.modal .modal-content {
    pointer-events: auto;
}

#authModal.auth-screen {
    pointer-events: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#authModal .auth-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(160deg, rgba(15, 23, 42, 0.72) 0%, rgba(30, 58, 138, 0.45) 45%, rgba(15, 23, 42, 0.8) 100%),
        radial-gradient(ellipse 90% 60% at 50% 0%, rgba(56, 189, 248, 0.15), transparent 55%),
        linear-gradient(165deg, #0c1018 0%, #1a1520 50%, #0c1018 100%);
}

#authModal .auth-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
}

#authModal .auth-login-box {
    position: relative;
    z-index: 10;
    width: min(420px, 100%);
    padding: 2.5rem 2.25rem 2rem;
    font-family: "Poppins", var(--font);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    max-height: none;
    overflow: visible;
}

#authModal .auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.75rem;
}

#authModal .auth-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.45);
}

#authModal .auth-brand-name {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

#authModal .auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    padding: 4px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
}

#authModal .auth-theme-picker {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: -4px 0 16px;
}

#authModal .auth-theme-picker .theme-btn {
    width: 30px;
    height: 30px;
}

#authModal .tab-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px !important;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    letter-spacing: 0.02em;
}

#authModal .tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06) !important;
    transform: none !important;
    box-shadow: none !important;
}

#authModal .tab-btn.active {
    color: #fff;
    font-weight: 600;
    background: rgba(14, 165, 233, 0.35) !important;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25) !important;
}

#authModal .tab-btn.active::after {
    display: none;
}

#authModal .auth-title {
    margin: 0 0 6px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#authModal .auth-subtitle {
    margin: 0 0 1.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

#authModal .auth-input-group {
    position: relative;
    margin-bottom: 1.75rem;
}

#authModal .auth-input-group .auth-field-icon {
    position: absolute;
    left: 0;
    top: 14px;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#authModal .auth-input-group input {
    width: 100%;
    padding: 12px 6px 12px 30px;
    margin-bottom: 0;
    font-size: 15px;
    color: #fff;
    background: transparent !important;
    border: none !important;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.38) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none;
    transition: border-color 0.25s ease;
}

#authModal .auth-input-group input:focus {
    border-bottom-color: var(--accent-primary) !important;
    box-shadow: none !important;
}

#authModal .auth-input-group label {
    position: absolute;
    top: 12px;
    left: 30px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    font-weight: 400;
    pointer-events: none;
    transition: 0.25s ease;
}

#authModal .auth-input-group input:focus ~ label,
#authModal .auth-input-group input:valid ~ label {
    top: -16px;
    left: 0;
    font-size: 11px;
    color: var(--accent-primary);
    font-weight: 500;
}

#authModal .auth-input-group input:focus ~ .auth-field-icon,
#authModal .auth-input-group input:valid ~ .auth-field-icon {
    opacity: 1;
}

#authModal .auth-login-btn,
#authModal #doLoginBtn,
#authModal #registerBtn,
#authModal #verifyEmailBtn {
    width: 100%;
    margin-top: 0.35rem;
    padding: 14px;
    background: #0ea5e9 !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.35) !important;
    transform: none !important;
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease !important;
}

#authModal .auth-login-btn:hover,
#authModal #doLoginBtn:hover,
#authModal #registerBtn:hover,
#authModal #verifyEmailBtn:hover {
    background: #0284c7 !important;
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.45) !important;
    transform: translateY(-1px) !important;
    filter: none !important;
}

#authModal .auth-login-btn:active,
#authModal #doLoginBtn:active,
#authModal #registerBtn:active {
    transform: translateY(0) !important;
}

#authModal .auth-login-btn.is-loading {
    opacity: 0.85;
    pointer-events: none;
}

#authModal .auth-secondary-btn,
#authModal #clearStorageBtn,
#authModal #registerBackBtn,
#authModal #refreshCaptchaBtn {
    width: 100%;
    margin-top: 12px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 13px;
    font-weight: 500;
    box-shadow: none !important;
    transform: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#authModal .auth-secondary-btn:hover,
#authModal #clearStorageBtn:hover,
#authModal #registerBackBtn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    transform: none !important;
    box-shadow: none !important;
}

#authModal .auth-secondary-btn--inline {
    width: auto;
    margin-top: 8px;
    padding: 8px 14px;
    font-size: 12px;
}

#authModal .auth-switch-hint {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

#authModal .auth-link-btn {
    background: none !important;
    border: none !important;
    padding: 0 4px !important;
    margin: 0 !important;
    color: #38bdf8 !important;
    font-weight: 600;
    font-size: inherit;
    text-decoration: none;
    box-shadow: none !important;
    transform: none !important;
    display: inline;
    width: auto;
    letter-spacing: normal;
    text-transform: none;
}

#authModal .auth-link-btn:hover {
    color: #7dd3fc !important;
    text-decoration: underline;
    transform: none !important;
    box-shadow: none !important;
}

#authModal .auth-captcha {
    margin-bottom: 1rem;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#authModal .auth-captcha-q {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    line-height: 1.4;
}

#authModal .username-status {
    margin-top: -10px;
    margin-bottom: 14px;
    border-radius: 8px;
}

#authModal .register-verify-intro {
    color: rgba(255, 255, 255, 0.8);
}

#authModal .register-verify-intro strong {
    color: #7dd3fc;
}

@media (max-width: 480px) {
    #authModal .auth-login-box {
        padding: 2rem 1.35rem 1.5rem;
        border-radius: 16px;
    }
}

#videoCircleModal.modal,
#callModal.modal {
    pointer-events: auto;
}

#callModal .call-controls {
    flex-wrap: wrap;
    align-items: center;
}

#callModal #answerCallBtn,
#callModal #hangupCallBtn {
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.modal-content {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 18px 20px 16px 18px;
    padding: 1.35rem 1.5rem 1.5rem;
    max-width: 28rem;
    width: 90%;
    border: 1px solid var(--border-light);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    max-height: 85vh;
    overflow-y: auto;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
}

.tab-btn {
    flex: 1;
    padding: 14px;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: none !important;
    transform: none !important;
}

.tab-btn.active {
    color: var(--accent-primary);
    font-weight: 600;
    position: relative;
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-primary);
    opacity: 0.9;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.35rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.auth-form input {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 15px;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

#doLoginBtn,
#registerBtn {
    width: 100%;
    margin-top: 10px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

#clearStorageBtn {
    background: var(--bg-tertiary);
    margin-top: 10px;
    width: 100%;
}

.username-status {
    font-size: 13px;
    margin-top: -10px;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 10px;
}

.username-status.available {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.username-status.unavailable {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.08);
}

input, textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.chats-panel {
    width: 22rem;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-light);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.28s var(--ease);
    overflow: hidden;
}

.chats-panel.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 15px;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.profile-click-area {
    display: flex;
    align-items: center;
    gap: 13px;
    flex: 1;
    cursor: pointer;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-glow);
}

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

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 3px;
}

.profile-fullname {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-coins {
    font-size: 12px;
    color: var(--accent-primary);
    margin-top: 4px;
}

.panel-buttons {
    display: flex;
    gap: 8px;
}

.toggle-panel-btn, .logout-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.show-panel-btn {
    position: fixed;
    left: 16px;
    top: 80px;
    z-index: 90;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 18px;
    padding: 11px 15px;
    border-radius: 13px;
    cursor: pointer;
    box-shadow: var(--shadow-raised);
    transform: translateY(-2px);
    transition: transform 0.15s var(--ease), box-shadow 0.15s ease;
    display: none;
}

.show-panel-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.show-panel-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.chats-panel.collapsed ~ .show-panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-tabs {
    display: flex;
    padding: 12px;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.nav-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    border-radius: 40px;
    box-shadow: none;
    transform: none;
}

.nav-tab:hover {
    background: var(--bg-tertiary);
    transform: none;
    box-shadow: none;
}

.nav-tab.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
    font-weight: 600;
}

.page-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px;
}

.page-content.active {
    display: block;
}

.create-post {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--r-card);
    padding: 1.05rem 1.1rem 1.15rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-light);
}

.create-post textarea {
    width: 100%;
    margin-bottom: 14px;
    resize: vertical;
}

.post-visibility-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.post-visibility-row--profile {
    margin-bottom: 8px;
}

.profile-hint-text {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
    margin: 0;
}

.post-visibility-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.post-visibility-option input {
    accent-color: var(--accent-primary);
}

.create-post-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.fl-attach-photo-btn {
    --fl-attach-text: hsla(28, 90%, 92%, 1);
    --fl-attach-shadow: hsla(24, 85%, 45%, 0.42);
    --fl-attach-bg: hsl(24, 90%, 48%);
    --fl-attach-bg-inner: hsl(24, 88%, 42%);
    position: relative;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    background: linear-gradient(145deg, var(--fl-attach-bg), var(--fl-attach-bg-inner));
    box-shadow: var(--fl-attach-shadow) 0 4px 22px, inset 0 1px 0 rgba(255, 255, 255, 0.12);
    z-index: 0;
    overflow: hidden;
}

.fl-attach-photo-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent-primary), var(--fl-attach-shadow) 0 4px 22px;
}

.fl-attach-photo-btn__inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.fl-attach-photo-btn__inner .fl-icon {
    width: 22px;
    height: 22px;
    opacity: 0.95;
}

.fl-attach-photo-btn__left,
.fl-attach-photo-btn__right {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    border-radius: 50%;
    z-index: 1;
}

.fl-attach-photo-btn__left {
    clip-path: inset(0 50% 0 0);
}

.fl-attach-photo-btn__right {
    clip-path: inset(0 0 0 50%);
}

.fl-attach-photo-btn__right::after {
    content: '';
    position: absolute;
    width: 160%;
    height: 160%;
    left: -30%;
    top: -30%;
    border-radius: 50%;
    background: conic-gradient(from 180deg at 50% 50%, transparent 0deg, rgba(20, 18, 24, 0.92) 120deg, transparent 200deg);
    opacity: 0.85;
    transform: rotate(-18deg) scale(0.92);
    transition: transform 0.38s ease-out, opacity 0.25s ease;
    pointer-events: none;
}

.fl-attach-photo-btn:hover .fl-attach-photo-btn__right::after {
    transform: rotate(6deg) scale(1.02);
    opacity: 0.72;
}

.fl-attach-photo-btn .fl-attach-photo-btn__left:hover ~ .fl-attach-photo-btn__right::after {
    transform: rotate(-14deg) scale(1.05);
}

.fl-attach-photo-btn::before {
    content: '';
    pointer-events: none;
    opacity: 0.55;
    background:
        radial-gradient(circle at 22% 32%, transparent 0, transparent 2px, var(--fl-attach-text) 3px, var(--fl-attach-text) 4px, transparent 4px),
        radial-gradient(circle at 72% 38%, transparent 0, transparent 2px, var(--fl-attach-text) 3px, var(--fl-attach-text) 4px, transparent 4px),
        radial-gradient(circle at 48% 58%, transparent 0, transparent 3px, var(--fl-attach-text) 4px, var(--fl-attach-text) 5px, transparent 5px);
    width: 100%;
    height: 280%;
    top: 0;
    left: 0;
    position: absolute;
    z-index: 0;
    animation: fl-attach-bubbles 5s linear infinite both;
}

@keyframes fl-attach-bubbles {
    from { transform: translateY(0); }
    to { transform: translateY(-42%); }
}

.fl-post-visibility {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.9;
}

.fl-post-visibility .fl-icon {
    width: 15px;
    height: 15px;
}

.feed-sort {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.sort-btn {
    padding: 8px 20px;
    border-radius: 40px;
}

.sort-btn.active {
    background: var(--accent-primary);
    color: white;
}

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-bottom: 20px;
}

.post-card {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 13px 16px 14px 15px;
    padding: 1rem 1.05rem 1.1rem;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: transform 0.14s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    border-color: var(--border-glow);
}

.post-card:active {
    transform: scale(0.995);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 13px;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.post-author {
    font-weight: 600;
    font-size: 15px;
}

.fl-user-badges {
    display: inline-flex;
    gap: 4px;
    vertical-align: middle;
    margin-left: 4px;
}

.fl-user-badges .fl-icon {
    width: 14px;
    height: 14px;
}

.post-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 3px;
}

.post-content {
    margin-bottom: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.post-image {
    max-width: 100%;
    border-radius: 16px;
    margin-bottom: 14px;
}

.post-actions {
    display: flex;
    gap: 22px;
    margin-bottom: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border-light);
}

.post-action-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
    transform: none;
}

.post-action-btn:hover {
    background: var(--bg-tertiary);
    transform: none;
    box-shadow: none;
}

.post-action-btn.liked {
    color: var(--accent-primary);
}

.delete-post-btn {
    background: transparent;
    border: 1px solid #EF4444;
    color: #EF4444;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 12px;
    box-shadow: none;
    transform: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.delete-post-btn:hover {
    background: #EF4444;
    color: white;
}

.search-bar {
    padding: 14px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.search-bar input {
    width: 100%;
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 14px;
    gap: 14px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}

.chat-item:hover {
    background: var(--bg-tertiary);
}

.chat-item.active {
    background: var(--bg-glass);
    border-left: 3px solid var(--accent-primary);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.chat-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-last-message {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    text-align: right;
}

.chat-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.unread-badge {
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 30px;
}

.create-group-btn-container {
    margin-bottom: 22px;
}

.create-group-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
    max-height: none;
    overflow-y: visible;
}

.group-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid var(--border-light);
}

.group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

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

.group-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.group-member-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.group-member-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.group-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.group-member-name {
    flex: 1;
    min-width: 0;
}

.group-info {
    flex: 1;
}

.group-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.group-description {
    font-size: 13px;
    color: var(--text-secondary);
}

.group-meta {
    font-size: 12px;
    color: var(--accent-primary);
    margin-top: 4px;
}

.join-group-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.join-group-section h3 {
    font-size: 15px;
    margin-bottom: 14px;
    font-weight: 500;
}

.join-group-input {
    display: flex;
    gap: 12px;
}

.join-group-input input {
    flex: 1;
}

.friend-requests-section, .friends-section, .search-friends-section {
    margin-bottom: 28px;
}

.friend-requests-section h3, .friends-section h3, .search-friends-section h3 {
    font-size: 16px;
    margin-bottom: 14px;
    font-weight: 500;
}

.friend-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border-radius: 18px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    flex: 1;
}

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
}

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

.friend-name {
    font-weight: 500;
}

.accept-friend-btn {
    background: #10b981;
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    color: white;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 17px 12px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.chat-header-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.theme-switcher {
    display: flex;
    gap: 5px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 40px;
    border: 1px solid var(--border-light);
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 40px;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0;
    box-shadow: none;
    transform: none;
}

.theme-btn.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.theme-dark-orange { background: linear-gradient(135deg, #0a0a0f, #ff7a32); }
.theme-dark-blue { background: linear-gradient(135deg, #000, #2AABEE); }
.theme-light-orange { background: linear-gradient(135deg, #f5f0eb, #ff8c42); }
.theme-violet { background: linear-gradient(135deg, #09090b, #7c3aed); }

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.contact-info {
    min-width: 0;
}

.contact-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-status {
    font-size: 12px;
    color: var(--text-tertiary);
}

.call-btn, .group-info-btn, .invite-btn {
    padding: 8px 14px;
    font-size: 13px;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.no-chat-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding-bottom: 110px;
}

.message {
    display: flex;
    margin-bottom: 10px;
    max-width: 100%;
}

.message.outgoing { justify-content: flex-end; }
.message.incoming { justify-content: flex-start; }

.message-bubble {
    max-width: 75%;
    padding: 0.55rem 0.85rem 0.65rem;
    border-radius: 17px 17px 5px 17px;
    font-size: 0.92rem;
    line-height: 1.5;
    word-wrap: break-word;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.message.outgoing .message-bubble {
    background: var(--bg-message-out);
    border: 1px solid var(--border-light);
    border-radius: 17px 17px 6px 17px;
}

.message.incoming .message-bubble {
    background: var(--bg-message-in);
    border: 1px solid var(--border-light);
    border-radius: 17px 17px 17px 6px;
}

.message-sender {
    font-size: 12px;
    color: var(--accent-primary);
    margin-bottom: 4px;
    font-weight: 600;
    cursor: pointer;
}

.message-time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-align: right;
}

.message-media {
    max-width: 250px;
    max-height: 250px;
    border-radius: 16px;
    cursor: pointer;
    object-fit: cover;
    margin-top: 8px;
}

.message-video {
    max-width: 280px;
    max-height: 250px;
    border-radius: 16px;
    display: block;
    margin-top: 8px;
}

.message-video-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    display: block;
    margin-top: 8px;
    border: 2px solid var(--accent-primary);
    background: #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.message-audio {
    max-width: 230px;
    height: 40px;
    border-radius: 20px;
    margin-top: 8px;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 14px;
    cursor: pointer;
    margin-top: 8px;
    border: 1px solid var(--border-light);
}

.message-file:hover { background: rgba(255, 255, 255, 0.1); }
.file-icon { font-size: 24px; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 12px; font-weight: 500; word-break: break-all; }
.file-size { font-size: 10px; opacity: 0.7; }

.msg-delete-btn {
    opacity: 0.5;
    transition: opacity 0.2s;
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    padding: 0 5px;
    box-shadow: none;
    transform: none;
}

.msg-delete-btn:hover { opacity: 1; }

.message-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px 12px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    width: 100%;
}

.message-input-area #messageInput {
    font-size: 16px;
    flex: 1;
    padding: 12px 16px;
    border-radius: 22px;
    min-width: 0;
    min-height: 46px;
    max-height: 130px;
    resize: none;
    line-height: 1.35;
    overflow-y: auto;
}

.input-icon {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transform: none;
}

.input-icon:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    transform: none;
    box-shadow: none;
}

.send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding: 0;
}

.profile-avatar-large {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 8px 24px var(--accent-glow);
}

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

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    text-align: center;
    font-size: 22px;
    padding: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-avatar-large:hover .avatar-overlay { opacity: 1; }

.profile-field { text-align: left; margin-bottom: 18px; }
.profile-field label { display: block; font-size: 13px; color: var(--text-tertiary); margin-bottom: 6px; font-weight: 500; }
.profile-field span { display: block; font-size: 16px; padding: 8px 0; }
.profile-field input, .profile-field textarea { width: 100%; }
.change-avatar-btn, .save-profile-btn { width: 100%; padding: 12px; }

.storage-upgrade-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.storage-btn { background: var(--bg-tertiary); padding: 10px 14px; font-size: 13px; }

.wave-container { display: flex; align-items: center; justify-content: center; gap: 5px; height: 50px; }
.wave-bar { width: 5px; height: 24px; background: var(--accent-primary); border-radius: 3px; box-shadow: 0 0 10px var(--accent-glow); transition: height 0.1s ease; }

@keyframes wave {
    0% { height: 12px; }
    50% { height: 36px; }
    100% { height: 12px; }
}

.wave-bar { animation: wave 0.8s ease infinite alternate; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }

#notificationContainer {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    left: auto;
    max-width: min(420px, calc(100vw - 24px));
    z-index: 1100;
    pointer-events: none;
}
#notificationContainer .notification { pointer-events: auto; }

.notification {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    padding: 14px 36px 14px 16px;
    border-radius: 18px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    touch-action: pan-y;
    user-select: none;
}
.notification .notification-body {
    display: flex;
    align-items: center;
    gap: 10px;
}
.notification-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.notification-dismiss:hover { background: rgba(0, 0, 0, 0.25); }
.notification.swipe-out {
    opacity: 0;
    transform: translateX(110%);
    transition: opacity 0.2s ease, transform 0.25s ease;
}

.media-permission-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-glow);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
.media-permission-text {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    flex: 1 1 200px;
}
.media-permission-grant {
    background: var(--accent-primary) !important;
    color: white !important;
    border: none !important;
    padding: 10px 18px !important;
    border-radius: 24px !important;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: none !important;
    transform: none !important;
}
.media-permission-dismiss {
    background: transparent !important;
    border: none !important;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px !important;
    box-shadow: none !important;
    transform: none !important;
}

@media (max-width: 768px) {
    .media-permission-bar {
        bottom: 72px;
    }
}

.register-verify-step .register-verify-intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 16px;
}
.register-verify-step input {
    width: 100%;
    text-align: center;
    font-size: 20px;
    letter-spacing: 0.2em;
    font-weight: 600;
}
.register-back-btn {
    width: 100%;
    margin-top: 14px;
    background: transparent !important;
    border: 1px solid var(--border-light) !important;
    color: var(--text-secondary) !important;
    padding: 12px !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: pointer;
    font-size: 14px;
}

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 99;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 22px;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 95;
}


@media (max-width: 768px) {
    body {
        overflow: hidden; 
        width: 100%;
        height: 100vh;
        height: 100dvh;
    }
    
    .app-container {
        height: 100vh;
        height: 100dvh;
        position: relative;
        overflow: hidden;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .chats-panel {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 100;
        width: 86%;
        max-width: 20rem;
        transition: left 0.28s var(--ease);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
    }
    
    .chats-panel.open {
        left: 0;
    }
    
    .overlay.active {
        display: block;
    }
    
    .show-panel-btn {
        display: none !important;
    }
    
    .chat-header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px 14px;
        flex-shrink: 0;
        z-index: 10;
    }
    
    .chat-header-left {
        flex: 1;
        min-width: 0;
    }
    
    .chat-header-right {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .chat-panel {
        width: 100%;
        height: 100vh;
        height: 100dvh;
    }
    
    .messages-area {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }

    .messages-container {
        padding-bottom: 160px;
    }
    
    .message-input-area {
        position: relative;
        z-index: 10;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    
    .groups-list {
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .join-group-section {
        position: sticky;
        bottom: 0;
        background: var(--bg-glass);
        backdrop-filter: var(--glass-blur);
        padding: 15px;
        margin-top: 20px;
        border-top: 1px solid var(--border-light);
        border-radius: 20px 20px 0 0;
    }
    
    .join-group-input { flex-direction: column; gap: 8px; }
    .join-group-input input, .join-group-input button { width: 100%; }
    
    .theme-btn { width: 28px; height: 28px; }
    
    .call-btn, .group-info-btn, .invite-btn { padding: 8px 12px; font-size: 14px; white-space: nowrap; }
    
    .message-bubble { max-width: 85%; padding: 9px 13px; }
    .message-media { max-width: 200px; max-height: 200px; }
    .message-video-circle { width: 140px; height: 140px; }
    
    .post-avatar, .friend-avatar, .contact-avatar { width: 38px; height: 38px; }
    .chat-avatar, .group-avatar { width: 42px; height: 42px; }
    
    .message-input-area {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }
    .message-input-area #messageInput {
        order: -1;
        flex: 1 1 100%;
        width: 100% !important;
        min-width: 0;
        min-height: 52px;
        font-size: 17px;
        padding: 14px 18px;
        border-radius: 22px;
        margin-bottom: 4px;
    }
    .message-input-area .input-icon {
        width: 44px;
        height: 44px;
    }
    .message-input-area .send-btn {
        flex-shrink: 0;
        position: sticky;
        bottom: max(2px, env(safe-area-inset-bottom));
        z-index: 3;
        box-shadow: 0 8px 20px rgba(42, 171, 238, 0.35);
    }
}

@media (max-width: 480px) {
    .chat-header { flex-direction: column; align-items: stretch; }
    .chat-header-left { width: 100%; justify-content: space-between; }
    .chat-header-right { width: 100%; justify-content: flex-end; margin-top: 8px; }
    .call-btn, .group-info-btn, .invite-btn { padding: 6px 10px; font-size: 12px; }
    
    .message-input-area { flex-wrap: wrap; padding: 10px 12px; }
    .message-input-area #messageInput { order: -1; width: 100%; margin-bottom: 8px; }
    .send-btn { margin-left: auto; }
    .message-video-circle { width: 120px; height: 120px; }
}

@media (max-width: 380px) {
    .chat-header-right { flex-wrap: wrap; justify-content: flex-end; }
    .call-btn, .group-info-btn, .invite-btn { padding: 5px 8px; font-size: 11px; }
}

@supports (padding: max(0px)) {
    .chat-header {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-left: max(18px, env(safe-area-inset-left));
        padding-right: max(18px, env(safe-area-inset-right));
    }
    
    .message-input-area {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .messages-container {
        padding-bottom: max(160px, calc(120px + env(safe-area-inset-bottom)));
    }
    
    .mobile-menu-btn {
        top: max(14px, env(safe-area-inset-top));
        left: max(14px, env(safe-area-inset-left));
    }
    
    .show-panel-btn {
        top: max(80px, calc(env(safe-area-inset-top) + 60px));
        left: max(16px, env(safe-area-inset-left));
    }
    
    .profile-header { padding-top: max(18px, env(safe-area-inset-top)); }
}

.permission-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    font-size: 14px;
    z-index: 2000;
    animation: fadeInOut 3s ease;
    max-width: 90%;
    white-space: normal;
    text-align: center;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    90% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.draw-guess-modal .draw-guess-content {
    max-width: 480px;
    width: 94%;
    text-align: left;
}

.draw-guess-hint {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0 0 16px;
}

.draw-guess-secret-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.draw-guess-label {
    font-size: 13px;
    color: var(--text-tertiary);
    width: 100%;
}

.draw-guess-word {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
}

.draw-guess-secondary-btn {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-light) !important;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: pointer;
    color: var(--text-primary);
}

.draw-guess-canvas-wrap {
    background: #fafafa;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border-light);
    margin-bottom: 14px;
    touch-action: none;
}

body.theme-dark-orange .draw-guess-canvas-wrap,
body.theme-dark-blue .draw-guess-canvas-wrap {
    background: #2a2a38;
}

.draw-guess-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 45vh;
    cursor: crosshair;
}

.draw-guess-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.draw-guess-color-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.draw-guess-color-label input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

@keyframes flSpotShimmer {
    0%, 100% { box-shadow: 0 0 18px color-mix(in srgb, var(--fl-spot, #f97316) 55%, transparent), 0 0 2px rgba(255,255,255,0.08) inset; }
    50% { box-shadow: 0 0 28px color-mix(in srgb, var(--fl-spot, #f97316) 85%, transparent), 0 0 2px rgba(255,255,255,0.12) inset; }
}

.fl-post-spotlight {
    --fl-spot: #f97316;
    border-radius: 16px;
    animation: flSpotShimmer 2.4s ease-in-out infinite;
    border: 1px solid color-mix(in srgb, var(--fl-spot) 40%, transparent);
}

.fl-spotlight-nick {
    background: linear-gradient(
        90deg,
        #ff6b6b,
        #feca57,
        #48dbfb,
        #ff9ff3,
        #54a0ff,
        #5f27cd,
        #ff6b6b
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: flNickShine 2.8s linear infinite;
    font-weight: 700;
}
.username-display {
    font-weight: 600;
}

@keyframes flNickShine {
    to { background-position: 300% center; }
}

.post-author .fl-spotlight-nick,
.fl-spotlight-nick.username-display--verified {
    display: inline;
}

.fl-user-age {
    font-size: 0.85em;
    color: var(--text-tertiary);
    font-weight: 500;
}

.fl-gender .fl-icon,
.fl-gender img {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

.fl-profile-flair {
    margin-top: 6px;
    font-size: 14px;
}

.msg-reply-quote {
    font-size: 12px;
    opacity: 0.85;
    border-left: 3px solid var(--accent-primary);
    padding: 6px 8px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.msg-reply-btn {
    background: none;
    border: none;
    color: var(--accent-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    margin-right: 4px;
    vertical-align: middle;
}

.message-reply-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}

.message-reply-bar button {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

#flindPulseCard {
    display: none;
    margin: 10px 12px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(99, 102, 241, 0.12));
    border: 1px solid var(--border-glow);
    font-size: 13px;
}

.fl-pulse-title {
    font-weight: 700;
    color: var(--accent-secondary);
    margin-bottom: 4px;
}

.fl-pulse-text {
    color: var(--text-secondary);
    line-height: 1.35;
}

.sidebar-weather-line {
    display: none;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding: 0 4px;
}

#callShareScreenBtn {
    display: none;
    align-items: center;
    gap: 6px;
    background: #1f2937;
    color: #fbbf24;
    border: 1px solid #fbbf24;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}

@font-face {
    font-family: "Geist Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-sans@latest/latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Geist Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-sans@latest/latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Geist Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-sans@latest/latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Geist Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-sans@latest/latin-700-normal.woff2") format("woff2");
}

body.theme-violet {
    --font: "Source Sans 3", "Geist Sans", "Roboto", system-ui, sans-serif;
    --font-display: "Bitter", Georgia, "Times New Roman", serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --bg-primary: hsl(240 10% 3.9%);
    --bg-secondary: hsl(240 6% 6%);
    --bg-tertiary: hsl(240 3.7% 15.9%);
    --bg-glass: hsl(240 6% 8% / 0.94);
    --bg-message-in: hsl(240 3.7% 12%);
    --bg-message-out: hsl(262.1 83.3% 57.8% / 0.16);
    --accent-primary: hsl(262.1 83.3% 57.8%);
    --accent-secondary: hsl(262 75% 68%);
    --accent-glow: hsl(262.1 83.3% 57.8% / 0.32);
    --accent-muted: hsl(265 18% 42%);
    --text-primary: hsl(0 0% 98%);
    --text-secondary: hsl(240 5% 64.9%);
    --text-tertiary: hsl(240 4% 48%);
    --border-light: hsl(240 3.7% 18%);
    --border-glow: hsl(262.1 83.3% 57.8% / 0.4);
    --shadow-raised: 0 1px 2px 0 rgb(0 0 0 / 0.35);
    --shadow-hover: 0 4px 12px -2px rgb(0 0 0 / 0.45);
    --shadow-pressed: 0 1px 2px 0 rgb(0 0 0 / 0.25);
    --glass-blur: blur(8px);
    --r-card: 14px;
    --r-pill: 11px;
    --r-btn: 11px;
    --fl-elev-1: 0 1px 6px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.22);
    --fl-elev-2: 0 3px 14px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.22);
    --fl-elev-3: 0 18px 48px rgba(0, 0, 0, 0.55);
    --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", monospace;
    letter-spacing: 0.01em;
    background-image: none;
    background-color: var(--bg-primary);
}

body.theme-violet .contact-name,
body.theme-violet .no-chat-selected h3,
body.theme-violet .fl-heading-with-icon,
body.theme-violet .modal-content h2,
body.theme-violet .profile-modal-header h2 {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

body.theme-violet .no-chat-selected {
    background: transparent;
}

body.theme-violet .no-chat-selected h3 {
    color: hsl(0 0% 98%);
    font-weight: 650;
}

body.theme-violet .no-chat-selected p {
    color: hsl(240 5% 64.9%);
    font-size: 15px;
    line-height: 1.45;
}

body.theme-violet #chatMainPanel .fl-letter-pool,
body.theme-violet #chatMainPanel .fl-temp-letter-pool {
    z-index: 0;
}

body.theme-violet #chatMainPanel .chat-header,
body.theme-violet #chatMainPanel .no-chat-selected,
body.theme-violet #chatMainPanel .messages-area,
body.theme-violet #chatMainPanel .message-reply-bar,
body.theme-violet #chatMainPanel .message-input-area {
    position: relative;
    z-index: 1;
}

body.theme-violet #chatMainPanel .fl-letter-overlay {
    z-index: 4;
}

body.theme-violet button {
    transform: none !important;
    border-radius: var(--r-btn) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: var(--shadow-raised) !important;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light) !important;
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
}

body.theme-violet button:hover {
    transform: translate(-1px, -1px) !important;
    background: hsl(240 3.7% 20%);
    border-color: hsl(262.1 83.3% 57.8% / 0.35) !important;
    box-shadow: var(--shadow-hover) !important;
}

body.theme-violet button:active {
    transform: translate(1px, 2px) !important;
    box-shadow: var(--shadow-pressed) !important;
}

body.theme-violet button:focus-visible {
    outline: 2px dashed hsl(262.1 83.3% 57.8%);
    outline-offset: 3px;
}

body.theme-violet .theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: 2px solid transparent !important;
    background: inherit !important;
}

body.theme-violet .theme-btn:hover,
body.theme-violet .theme-btn:active {
    box-shadow: none !important;
    transform: none !important;
    filter: brightness(1.08);
}

body.theme-violet .theme-btn.active {
    border-color: hsl(262.1 83.3% 57.8%) !important;
    box-shadow: 0 0 0 1px var(--accent-glow) !important;
}

body.theme-violet .tab-btn {
    background: hsl(240 6% 10% / 0.65) !important;
    border: 2px dashed hsl(240 3.7% 28%) !important;
    box-shadow: none !important;
    border-radius: var(--r-btn) !important;
}

body.theme-violet .tab-btn:hover {
    background: hsl(240 3.7% 16%) !important;
    border-color: hsl(262.1 83.3% 57.8% / 0.4) !important;
}

body.theme-violet .message-reply-bar button {
    background: hsl(240 3.7% 16%) !important;
    border: 2px solid hsl(240 3.7% 26%) !important;
    box-shadow: var(--shadow-raised) !important;
    border-radius: var(--r-btn) !important;
}

body.theme-violet .input-icon,
body.theme-violet .call-btn,
body.theme-violet .group-info-btn,
body.theme-violet .invite-btn {
    border-radius: var(--r-btn) !important;
    background: hsl(240 3.7% 16%) !important;
    border: 2px solid hsl(240 3.7% 26%) !important;
    box-shadow: var(--shadow-raised) !important;
}

body.theme-violet .input-icon:hover,
body.theme-violet .call-btn:hover {
    background: hsl(240 3.7% 20%) !important;
    border-color: hsl(262.1 83.3% 57.8% / 0.55) !important;
}

body.theme-violet .send-btn {
    border-radius: var(--r-btn) !important;
    background: hsl(262.1 83.3% 52%) !important;
    border: 2px solid hsl(262.1 70% 32%) !important;
    color: hsl(0 0% 99%) !important;
    box-shadow: var(--shadow-raised) !important;
}

body.theme-violet .send-btn:hover {
    filter: none !important;
    background: hsl(262.1 83.3% 58%) !important;
    box-shadow: var(--shadow-hover) !important;
}

body.theme-violet .btn-primary,
body.theme-violet .create-post-btn,
body.theme-violet .save-profile-btn,
body.theme-violet .friend-action-btn,
body.theme-violet .confirm-create-group-btn,
body.theme-violet #joinGroupByInviteBtn,
body.theme-violet #submitCommentBtn,
body.theme-violet #doLoginBtn,
body.theme-violet #registerBtn {
    background: hsl(262.1 83.3% 52%) !important;
    border: 2px solid hsl(262.1 70% 30%) !important;
    color: hsl(0 0% 99%) !important;
    box-shadow: var(--shadow-raised) !important;
    filter: none !important;
}

body.theme-violet .btn-primary:hover,
body.theme-violet .create-post-btn:hover,
body.theme-violet .save-profile-btn:hover,
body.theme-violet .friend-action-btn:hover,
body.theme-violet .confirm-create-group-btn:hover,
body.theme-violet #joinGroupByInviteBtn:hover,
body.theme-violet #submitCommentBtn:hover,
body.theme-violet #doLoginBtn:hover,
body.theme-violet #registerBtn:hover {
    background: hsl(262.1 83.3% 56%) !important;
    box-shadow: var(--shadow-hover) !important;
    transform: translate(-1px, -1px) !important;
    filter: none !important;
}

body.theme-violet .nav-tab {
    border-radius: var(--r-btn) !important;
    font-weight: 600;
    border: 2px solid transparent !important;
}

body.theme-violet .nav-tab.active {
    box-shadow: var(--shadow-raised) !important;
    border: 2px solid hsl(262.1 83.3% 57.8% / 0.55) !important;
    background: hsl(240 3.7% 14%) !important;
}

body.theme-violet .nav-tab:not(.active):hover {
    background: hsl(240 3.7% 14%) !important;
    border-color: hsl(240 3.7% 24%) !important;
}

body.theme-violet .post-card,
body.theme-violet .create-post,
body.theme-violet .modal-content,
body.theme-violet .chats-panel,
body.theme-violet .chat-header,
body.theme-violet .message-input-area {
    border-radius: var(--r-card) !important;
}

body.theme-violet .post-card {
    border-radius: var(--r-card) !important;
    box-shadow: var(--fl-elev-1);
}

body.theme-violet .post-card:hover {
    box-shadow: var(--fl-elev-2);
    border-color: hsl(262.1 83.3% 57.8% / 0.28);
}

body.theme-violet .modal-content {
    border-radius: var(--r-card) !important;
    box-shadow: var(--fl-elev-3) !important;
}

body.theme-violet input,
body.theme-violet textarea {
    border-radius: var(--r-btn) !important;
    border: 2px solid var(--border-light) !important;
    background: var(--bg-primary) !important;
    box-shadow: inset 0 2px 0 hsl(0 0% 0% / 0.25);
}

body.theme-violet input:focus,
body.theme-violet textarea:focus {
    outline: none;
    border-color: hsl(262.1 83.3% 57.8%) !important;
    box-shadow: 0 0 0 2px hsl(262.1 83.3% 57.8% / 0.22) !important;
}

body.theme-violet .message-input-area input {
    border-radius: var(--r-btn) !important;
    background: var(--bg-primary) !important;
}

body.theme-violet .messages-area {
    background: transparent;
}

body.theme-violet .sort-btn.active {
    box-shadow: var(--shadow-raised);
}

body.theme-violet .tab-btn.active::after {
    background: hsl(262.1 83.3% 57.8%);
}

body.theme-violet .draw-guess-canvas-wrap {
    background: hsl(240 4% 12%);
    border-radius: var(--r-card);
}

body.theme-violet .fl-post-spotlight {
    --fl-spot: hsl(262.1 83.3% 57.8%);
}

body.theme-violet #flindPulseCard {
    background: linear-gradient(135deg, hsl(262.1 83.3% 57.8% / 0.12), hsl(240 40% 35% / 0.12));
    border-color: hsl(262.1 83.3% 57.8% / 0.28);
}

body.theme-violet .post-action-btn {
    border-radius: var(--r-pill) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.theme-violet .show-panel-btn {
    border-radius: var(--r-pill) !important;
}

body.theme-violet ::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
body.theme-violet ::-webkit-scrollbar-track {
    background: hsl(240 6% 9%);
}
body.theme-violet ::-webkit-scrollbar-thumb {
    background: hsl(240 4% 38%);
    border-radius: 0;
}
body.theme-violet ::-webkit-scrollbar-thumb:hover {
    background: hsl(262.1 83.3% 57.8% / 0.45);
}

body.theme-violet .message-bubble {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: var(--fl-elev-1);
}

body.theme-violet .message-input-area {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.42) !important;
    border-top-color: hsl(240 4% 16%) !important;
}

body.theme-violet .chats-panel {
    box-shadow: var(--fl-elev-1);
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-mono@latest/latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-mono@latest/latin-600-normal.woff2") format("woff2");
}

body.theme-violet .draw-guess-content textarea,
body.theme-violet .draw-guess-content input[type="text"],
body.theme-violet code,
body.theme-violet pre {
    font-family: var(--font-mono) !important;
}

.messages-area {
    position: relative;
}

body:not(.theme-violet) .fl-letter-pool,
body:not(.theme-violet) .fl-temp-letter-pool,
body:not(.theme-violet) .fl-letter-overlay {
    display: none !important;
}

.fl-letter-pool,
.fl-temp-letter-pool {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    backface-visibility: hidden;
}

.fl-letter-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    z-index: 3;
    pointer-events: none;
}

body.theme-violet .messages-container {
    position: relative;
    z-index: 2;
}

.pool-letter,
.temp-letter {
    position: absolute;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1;
    color: hsl(240 5% 28% / 0.45);
}

body.theme-violet .pool-letter,
body.theme-violet .temp-letter {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    color: hsl(220 12% 58% / 0.62);
    text-shadow: 0 0 18px hsl(228 20% 6% / 0.5);
    will-change: transform, left, top;
}

.fl-overlay-letter {
    position: absolute;
    font-weight: 400;
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1;
    color: hsl(220 10% 68% / 0.88);
    transition: left 1.55s cubic-bezier(0.4, 0, 0.2, 1), top 1.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

.fl-overlay-letter.in-flight {
    animation: fl-pulse-letter 1s ease-in-out;
}

.fl-invisible {
    opacity: 0 !important;
}

@keyframes fl-pulse-letter {
    from,
    to {
        color: hsl(220 10% 72% / 0.85);
    }
    50% {
        color: hsl(262.1 83.3% 68%);
    }
}

body.theme-violet .message-input-area.send-enabled .send-btn {
    filter: saturate(1.08);
}

body.theme-violet .message-input-area {
    align-items: center;
    gap: 10px;
}

body.theme-violet .message-input-area .input-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    box-shadow: var(--shadow-raised) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

body.theme-violet .message-input-area #messageInput {
    font-weight: 400;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-raised) !important;
}

body.theme-violet .send-btn {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

body.theme-violet .call-btn,
body.theme-violet .group-info-btn,
body.theme-violet .invite-btn {
    box-shadow: var(--shadow-raised) !important;
    min-height: 40px;
}

/* --- auth-reset / register verify visibility --- */
#resetPasswordPanel.flind-reset-visible {
    display: block !important;
    visibility: visible !important;
}
#loginForm.flind-reset-active #loginFormFields,
#loginForm.flind-reset-active #loginFormMain,
#loginForm.flind-reset-active > .auth-switch-hint,
#loginForm.flind-reset-active #clearStorageBtn {
    display: none !important;
}
#loginForm.flind-reset-active #resetPasswordPanel {
    display: block !important;
    visibility: visible !important;
}
#resetStepCode.flind-reset-visible {
    display: block !important;
}
#resetStepEmail.flind-reset-hidden {
    display: none !important;
}
#loginForm.flind-reset-active {
    scroll-margin-top: 12px;
}
#resetPasswordPanel {
    margin-top: 4px;
}
#registerStepVerify {
    scroll-margin-top: 12px;
}

.auth-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 15px 0 18px;
    font-size: 13px;
    color: var(--text-secondary, #b4b3c0);
    line-height: 1.45;
}
.auth-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent-primary, #f97316);
    cursor: pointer;
}
.auth-checkbox-group label a {
    color: var(--accent-primary, #f97316);
    text-decoration: none;
}
.auth-checkbox-group label a:hover {
    text-decoration: underline;
}
.auth-legal-footer {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
}
.auth-legal-footer a {
    color: var(--text-secondary, #b4b3c0);
    text-decoration: none;
}
.auth-legal-footer a:hover {
    color: var(--accent-primary, #f97316);
    text-decoration: underline;
}
.auth-legal-footer--global {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-login-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.delete-account-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1) !important;
    color: #EF4444 !important;
    border: 1px solid #EF4444 !important;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.delete-account-btn:hover {
    background: #EF4444 !important;
    color: #fff !important;
}
.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    vertical-align: middle;
    color: #3b82f6;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    cursor: help;
}
.admin-badge::before {
    content: "✓";
}
.username-display--verified {
    font-weight: 600;
}
.friend-subname {
    font-size: 11px;
    color: var(--text-secondary, #7c7b8a);
    margin-top: 2px;
}
.friend-name .username-display,
.chat-name .username-display,
.group-member-name .username-display,
#chatContactName .username-display {
    font-weight: 600;
}
.profile-privacy-link {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 12px;
}
.profile-privacy-link a {
    color: var(--text-secondary, #b4b3c0);
    text-decoration: none;
}
.profile-privacy-link a:hover {
    color: var(--accent-primary, #f97316);
    text-decoration: underline;
}

.admin-online {
    margin: 18px 0 22px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.22);
}
.admin-online h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 6px;
}
.admin-online-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: admin-online-pulse 1.8s infinite;
    flex-shrink: 0;
}
@keyframes admin-online-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.admin-online-count {
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 10px;
    border-radius: 999px;
}
.admin-online-hint {
    font-size: 11px;
    color: var(--text-secondary, #7c7b8a);
    margin-bottom: 10px;
}
.admin-online-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
}
.admin-online-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.admin-online-chip:hover {
    background: rgba(16, 185, 129, 0.12);
}
.admin-online-chip .admin-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}
.admin-online-empty {
    font-size: 13px;
    color: var(--text-secondary, #7c7b8a);
    padding: 8px 4px;
}
.admin-user-status {
    font-size: 11px;
    margin-top: 4px;
}
.admin-user-status--online {
    color: #10b981;
}
.admin-user-status--offline {
    color: #7c7b8a;
}

[data-fl-action] > * {
    pointer-events: none;
}
[data-fl-action] {
    pointer-events: auto;
    touch-action: manipulation;
    cursor: pointer;
}
.chat-item[data-fl-action] {
    -webkit-tap-highlight-color: rgba(42, 171, 238, 0.2);
}
.modal.flind-modal-open,
.modal[style*="display: flex"],
.modal[style*="display:flex"] {
    pointer-events: auto;
}
.group-avatar-edit-section {
    border-top: 1px solid var(--border-light);
    padding-top: 15px;
    margin-top: 15px;
}
.auth-input-group .auth-field-icon {
    width: 1.2em;
    height: 1.2em;
    opacity: 0.75;
}
body.theme-light-orange .auth-input-group .auth-field-icon {
    filter: brightness(0.4);
    opacity: 0.9;
}
body.theme-violet .auth-input-group .auth-field-icon {
    opacity: 0.85;
}

html.flind-android-app {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
html.flind-android-app body.flind-chat-open .mobile-menu-btn {
    display: none !important;
}
html.flind-android-app .modal.flind-modal-open,
html.flind-android-app .modal[style*="display: flex"],
html.flind-android-app .modal[style*="display:flex"] {
    pointer-events: auto;
}
html.flind-android-app .message-input-area,
html.flind-android-app .chat-header {
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}
html.flind-android-app .auth-container {
    padding-top: max(16px, env(safe-area-inset-top, 0px));
}

/* ——— Политика конфиденциальности (та же тема, что в приложении) ——— */
html.flind-privacy-root,
html.flind-privacy-root body.flind-privacy-page {
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
}
body.flind-privacy-page {
    padding: 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}
.flind-privacy-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-glass);
    border-radius: var(--r-card);
    padding: 40px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-raised);
}
.flind-privacy-title {
    color: var(--accent-primary);
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}
.flind-privacy-date {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}
.flind-privacy-page h2 {
    color: var(--accent-secondary);
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
}
.flind-privacy-page p,
.flind-privacy-page ul {
    margin-bottom: 15px;
    color: var(--text-secondary);
}
.flind-privacy-page ul {
    padding-left: 25px;
}
.flind-privacy-page li {
    margin-bottom: 5px;
}
.flind-privacy-page a {
    color: var(--accent-primary);
    text-decoration: none;
}
.flind-privacy-page a:hover {
    text-decoration: underline;
}
.flind-privacy-hr {
    border: none;
    height: 1px;
    background: var(--border-light);
    margin: 30px 0;
}
.flind-privacy-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 30px;
}
.flind-privacy-back {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--accent-primary);
    text-decoration: none;
}
.flind-privacy-back:hover {
    text-decoration: underline;
}
@media (max-width: 600px) {
    .flind-privacy-container { padding: 20px; }
    .flind-privacy-title { font-size: 22px; }
}

/* ——— Слабые / старые устройства: тот же вид, меньше нагрузки ——— */
html.flind-lowperf {
    --glass-blur: none;
}
html.flind-lowperf * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html.flind-lowperf .admin-online-pulse {
    animation: none !important;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.45);
}
html.flind-lowperf .notification,
html.flind-lowperf button,
html.flind-lowperf .modal-content,
html.flind-lowperf .chat-item,
html.flind-lowperf .post-card {
    transition-duration: 0.12s !important;
}
html.flind-lowperf .messages-area {
    content-visibility: auto;
    contain-intrinsic-size: 480px;
}
@media (prefers-reduced-motion: reduce) {
    html:not(.flind-lowperf) {
        --glass-blur: none;
    }
    html:not(.flind-lowperf) * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.12s !important;
    }
    html:not(.flind-lowperf) .admin-online-pulse {
        animation: none !important;
    }
}


/* FLIND — доработка вёрстки для ПК (поверх стилей приложения) */
@media (min-width: 769px) {
    .app-container {
        display: flex;
        flex-direction: row;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        width: 100%;
    }

    .chats-panel {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 22rem !important;
        max-width: 22rem !important;
        min-width: 0;
        flex-shrink: 0;
        z-index: 2;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }

    .chats-panel.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        border-right: none !important;
        overflow: hidden !important;
    }

    .chat-panel {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }

    .page-content {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .page-content.active {
        display: block !important;
    }

    .show-panel-btn {
        display: flex !important;
    }

    .mobile-menu-btn,
    .mobile-menu-btn-inline {
        display: none !important;
    }

    .overlay {
        display: none !important;
        pointer-events: none !important;
    }

    .messages-area {
        flex: 1;
        min-height: 0;
    }

    .nav-tabs {
        flex-shrink: 0;
    }

    .page-content.active {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .chats-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .no-chat-selected {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}
