/* ============================================================
   MyFEAP - Design System
   Facebook-inspired academic social network
   ============================================================ */
/* cache-bust: 2026-02-24 profile layout sync */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    /* Primary palette */
    --primary: #1877f2;
    --primary-rgb: 24, 119, 242;
    --primary-hover: #166fe5;
    --primary-light: rgba(24, 119, 242, 0.1);
    --primary-gradient: linear-gradient(135deg, #1877f2, #0d47a1);

    /* Light theme (Premium Facebook-style) */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e4e6eb;
    --bg-hover: #f2f2f2;
    --bg-card: #ffffff;

    /* Text */
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --text-tertiary: #8a8d91;
    --text-link: #1877f2;
    --text-accent: #0064d1;

    /* Borders */
    --border-color: #dddfe2;
    --border-light: rgba(0, 0, 0, 0.05);

    /* Status */
    --success: #42b72a;
    --danger: #fa3e3e;
    --warning: #f7b928;
    --info: #1877f2;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition: all .2s ease;
    --transition-slow: all .4s ease;

    /* Sizes */
    --navbar-height: 92px;
    --top-strip-height: 0px;
    --header-stack-height: calc(var(--navbar-height) + var(--top-strip-height));
    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;

    /* Online indicator */
    --online-color: #31a24c;
    --fab-chat-keyboard-offset: 0px;
    --fab-chat-mobile-height: 100dvh;
    --chat-surface: #f8fbff;
    --chat-surface-strong: #ffffff;
    --chat-border-soft: #dbe5f3;
    --chat-border-strong: #c6d5ea;
    --chat-text-dim: #64748b;
    --chat-accent: #0f5fd7;
    --chat-accent-rgb: 15, 95, 215;
}

/* ============================================================
   PWA INSTALL PROMPT
   ============================================================ */
.pwa-install {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #c7d8f5;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(18, 53, 105, 0.18);
}

.pwa-install__text {
    font-size: 13px;
    color: #274676;
    font-weight: 600;
}

.pwa-install__actions {
    display: inline-flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install__btn {
    border: none;
    border-radius: 9px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.pwa-install__btn--primary {
    background: #1a67d8;
    color: #fff;
}

.pwa-install__btn--secondary {
    background: #eef3fd;
    color: #325a97;
    border: 1px solid #d1dff6;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body.app-auth {
    padding-top: var(--header-stack-height);
}

body.has-top-birthday-strip {
    --top-strip-height: 56px;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
}

.u-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================================
   GLOBAL BIRTHDAY STRIP (ABOVE HEADER)
   ============================================================ */
.top-birthday-strip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 52px;
    z-index: 120;
    background: linear-gradient(120deg, #0f2f61 0%, #18498f 45%, #1f6fd9 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(7, 18, 43, 0.22);
}

.top-birthday-strip__inner {
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px clamp(10px, 1.8vw, 24px);
}

.top-birthday-strip__summary {
    display: grid;
    gap: 1px;
    min-width: max-content;
    color: #f5f9ff;
}

.top-birthday-strip__title {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.top-birthday-strip__subtitle {
    font-size: 12px;
    color: rgba(238, 245, 255, 0.9);
    font-weight: 600;
}

.top-birthday-strip__rail-wrap {
    min-width: 0;
}

.top-birthday-strip__rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(199, 217, 246, 0.65) transparent;
    padding: 2px 0;
    will-change: scroll-position;
}

.top-birthday-strip__rail::-webkit-scrollbar {
    height: 6px;
}

.top-birthday-strip__rail::-webkit-scrollbar-thumb {
    background: rgba(199, 217, 246, 0.65);
    border-radius: 999px;
}

.top-birthday-strip__rail::-webkit-scrollbar-track {
    background: transparent;
}

.top-birthday-chip {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
    min-width: 215px;
    max-width: 250px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #f5f9ff;
    text-decoration: none;
    padding: 5px 10px 5px 6px;
    transition: var(--transition);
}

.top-birthday-chip:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.45);
}

.top-birthday-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.top-birthday-chip__icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(174, 206, 255, 0.78);
    background: rgba(97, 154, 247, 0.45);
    font-size: 14px;
    line-height: 1;
}

.top-birthday-chip--notice {
    border-color: rgba(160, 195, 250, 0.62);
    background: rgba(85, 146, 243, 0.3);
}

.top-birthday-chip--notice:hover {
    border-color: rgba(185, 214, 255, 0.78);
    background: rgba(113, 166, 245, 0.42);
}

.top-birthday-chip__name {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-birthday-chip__meta {
    font-size: 11px;
    color: rgba(234, 243, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-birthday-strip__empty {
    color: rgba(234, 243, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 2px;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: fixed;
    top: var(--top-strip-height);
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 clamp(10px, 1.8vw, 28px);
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 24px rgba(0, 0, 0, 0.03);
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(24, 119, 242, 0.18) 20%, rgba(24, 119, 242, 0.25) 50%, rgba(24, 119, 242, 0.18) 80%, transparent 100%);
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
}

.navbar__brand-logo {
    height: 42px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(24, 119, 242, 0.18));
    transition: filter 0.3s ease;
}

.navbar__brand:hover .navbar__brand-logo {
    filter: drop-shadow(0 2px 12px rgba(24, 119, 242, 0.32));
}

.navbar__brand span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar__search {
    flex: 1;
    max-width: 540px;
    margin: 0 8px;
    position: relative;
}

.navbar__search input {
    width: 100%;
    height: 44px;
    padding: 10px 16px 10px 42px;
    background: rgba(238, 242, 248, 0.7);
    border: 1px solid rgba(217, 226, 239, 0.6);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar__search input::placeholder {
    color: var(--text-tertiary);
}

.navbar__search input:focus {
    background: #fff;
    border-color: rgba(24, 119, 242, 0.35);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12), 0 4px 16px rgba(24, 119, 242, 0.08);
}

.navbar__search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
}

.navbar__toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
}

.navbar__search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-lg);
}

.navbar__search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.navbar__nav {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    flex: 1;
    /* Allow to grow and fill gap */
}

.navbar__nav-caption {
    display: none;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 800;
    white-space: nowrap;
}

.navbar__nav-spacer {
    flex: 1 1 auto;
    min-width: 0;
}

.navbar__nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar__nav-tools {
    display: none;
    align-items: center;
    gap: 8px;
}

.navbar__nav-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(217, 226, 239, 0.65);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.navbar__nav-tool:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(24, 119, 242, 0.25);
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.12);
}

.navbar__nav-tool-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #ff3b30;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

.navbar__nav-tool-pulse {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
}

.navbar__nav-tool--updates.has-new {
    color: #0b57d0;
    border-color: rgba(24, 119, 242, 0.28);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(234, 244, 255, 0.92) 100%);
    box-shadow: 0 10px 24px rgba(24, 119, 242, 0.16);
}

.navbar__nav-tool--updates.has-new .navbar__nav-tool-pulse {
    opacity: 1;
    animation: updatesPulse 1.3s ease-in-out infinite;
    background: radial-gradient(circle at 40% 30%, rgba(24, 119, 242, 0.22), rgba(24, 119, 242, 0) 60%);
}

@keyframes updatesPulse {
    0% {
        transform: scale(0.96);
        opacity: 0.45;
    }

    55% {
        transform: scale(1.06);
        opacity: 0.85;
    }

    100% {
        transform: scale(0.96);
        opacity: 0.45;
    }
}

.navbar__nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(217, 226, 239, 0.65);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.navbar__nav a img {
    height: 22px !important;
    transition: transform 0.25s ease;
}

.navbar__nav-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.navbar__nav-link--site {
    color: var(--primary);
}

.navbar__nav-link--instagram {
    color: #c13584;
}

.navbar__nav-link--facebook {
    color: #1877f2;
}

.navbar__nav-link--whatsapp {
    color: #25d366;
}

.navbar__nav-link--disabled {
    opacity: 0.45;
    color: #8da0b9 !important;
    cursor: not-allowed;
}

.navbar__site-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 1;
    color: var(--primary);
}

.navbar__nav a:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(24, 119, 242, 0.25);
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.12);
}

.navbar__nav a:hover img {
    transform: scale(1.08);
}

/* ============================================================
   MOBILE: UPDATES MODAL (Avisos + Online)
   ============================================================ */
.updates-modal {
    display: grid;
    gap: 12px;
}

.updates-modal__tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(217, 226, 239, 0.8);
    background: rgba(245, 248, 254, 0.9);
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.updates-modal__tab {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.updates-modal__tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.updates-modal__panel {
    min-height: 120px;
}

.updates-modal__panel[hidden] {
    display: none !important;
}

.updates-modal__list {
    display: grid;
    gap: 10px;
    max-height: min(62vh, 560px);
    overflow: auto;
    padding-right: 2px;
}

.navbar__nav a.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    border-radius: 0;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.navbar__user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: linear-gradient(135deg, rgba(238, 242, 248, 0.9) 0%, rgba(228, 236, 250, 0.9) 100%);
    border: 1px solid rgba(217, 226, 239, 0.7);
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar__user:hover {
    background: linear-gradient(135deg, #fff 0%, #f0f4ff 100%);
    border-color: rgba(24, 119, 242, 0.22);
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.08);
    transform: translateY(-1px);
}

.navbar__user img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.navbar__user span {
    font-size: 13px;
    font-weight: 600;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    margin-top: 0;
    min-height: calc(100vh - var(--header-stack-height));
    overflow-x: clip;
}

.sidebar-left {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-stack-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 16px 8px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

.sidebar-right {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-stack-height);
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 16px 8px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-width);
    /* Restored */
    padding: 20px;
    max-width: 100%;
}

.main-content--full {
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-width);
    /* Restored */
    flex: 1;
    padding: 20px;
}

.main-content--center {
    max-width: 680px;
    margin: 0 auto;
}

.main-content--wide {
    max-width: 1400px;
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-width);
}

/* ============================================================
   SIDEBAR ITEMS
   ============================================================ */
.sidebar-nav {
    list-style: none;
}

.sidebar-nav__item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-nav__item a:hover {
    background: linear-gradient(90deg, rgba(24, 119, 242, 0.04) 0%, rgba(24, 119, 242, 0.01) 100%);
    color: var(--primary);
}

.sidebar-nav__item a.active {
    background: linear-gradient(90deg, rgba(24, 119, 242, 0.08) 0%, rgba(24, 119, 242, 0.02) 100%);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav__item .nav-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.sidebar-section {
    padding: 12px 8px;
    margin-top: 8px;
}

.sidebar-section__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    padding: 0 12px;
}

.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-right .sidebar-section {
    padding: 0;
    margin-top: 0;
}

.sidebar-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sidebar-panel .sidebar-section__title {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

/* Online users */
.online-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.online-user:hover {
    background: var(--bg-hover);
}

.online-user img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.online-user .name {
    font-size: 13px;
    font-weight: 500;
}

.online-user .dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--online-color);
    margin-left: auto;
}

#onlineUsers {
    padding: 8px;
}

.online-empty {
    padding: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.card--hover:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card__header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card__header--post {
    border-bottom: none;
    padding: 20px 20px 10px;
}

.card__body {
    padding: 16px;
}

.card__footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
    margin-bottom: 24px;
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
    overflow: hidden;
}

.post-card__author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-card__author img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    cursor: pointer;
}

.post-card__author-info .name {
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.post-card__author-info .name:hover {
    text-decoration: underline;
}

.post-card__author-info .meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.post-card__actions-menu {
    margin-left: auto;
    position: relative;
}

.post-card__actions-menu .btn--icon {
    width: 32px;
    height: 32px;
    background: #f0f2f5;
    border: none;
    border-radius: 50%;
    color: #65676b;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 8px;
    /* Offset dots slightly */
}

.post-card__actions-menu .btn--icon:hover {
    background: #e4e6eb;
}

.post-card__content {
    padding: 0 20px 16px;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-card__image {
    width: 100% !important;
    display: block;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    max-height: none;
    object-fit: cover;
    cursor: pointer;
}

.post-card__stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.post-card__stats--new {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0 20px;
    padding: 16px 0;
}

.post-card__buttons {
    display: flex;
    border-top: 1px solid var(--border-color);
}

.post-card__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    background: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.post-card__btn:hover {
    background: var(--bg-hover);
}

.post-card__btn.liked {
    color: var(--primary);
}

/* Comments */
.post-comments {
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    display: none;
}

.post-comments.show {
    display: block;
}

.comment-item {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.comment-item img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.comment-bubble {
    background: var(--bg-tertiary);
    border-radius: 18px;
    padding: 8px 14px;
    max-width: 80%;
}

.comment-bubble .name {
    font-size: 12px;
    font-weight: 700;
}

.comment-bubble .text {
    font-size: 13px;
}

.comment-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    margin-left: 42px;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.comment-input-wrapper img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.comment-input-wrapper input {
    flex: 1;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 13px;
}

.comment-input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

/* ============================================================
   POST COMPOSER
   ============================================================ */
.post-composer {
    margin-bottom: 16px;
}

.post-composer__title {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 900;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.post-composer__top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.post-composer__top img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.post-composer__input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.post-composer__input:hover {
    background: var(--bg-hover);
}

.post-composer__form {
    display: none;
    padding: 16px;
}

.post-composer__form.show {
    display: block;
}

.post-composer__textarea {
    width: 100%;
    min-height: 100px;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    resize: vertical;
    border: none;
}

.post-composer__textarea::placeholder {
    color: var(--text-tertiary);
}

.post-composer__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.post-composer__upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--success);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.post-composer__upload-btn:hover {
    background: var(--bg-hover);
}

.post-composer__preview {
    padding: 8px 16px;
    display: none;
}

.post-composer__preview.show {
    display: block;
}

.post-composer__preview img {
    max-height: 200px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(24, 119, 242, .4);
    transform: translateY(-1px);
    color: #fff;
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn--secondary:hover {
    background: var(--bg-hover);
}

.btn--success {
    background: var(--success);
    color: #fff;
}

.btn--success:hover {
    filter: brightness(1.1);
}

.btn--danger {
    background: var(--danger);
    color: #fff;
}

.btn--danger:hover {
    filter: brightness(1.1);
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn--outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn--sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn--lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn--full {
    width: 100%;
}

.btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .2);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-cover {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #1a237e, #0d47a1, #1565c0);
    background-size: cover;
    background-position: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-cover__edit {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
}

.profile-cover__edit .btn {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.8);
    color: #1c1e21;
    border: none;
    box-shadow: var(--shadow-md);
}

.profile-cover__edit .btn:hover {
    background: #ffffff;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
    margin-top: -80px;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-full);
    border: 5px solid var(--bg-secondary);
    overflow: hidden;
    background: var(--bg-tertiary);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar__edit {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.profile-info {
    flex: 1;
    padding-bottom: 16px;
}

.profile-info__name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-info__details {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-info__details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 16px;
    margin-left: auto;
    min-width: fit-content;
    /* Ensure buttons don't shrink */
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin: 16px 0;
    padding: 0 24px;
}

.profile-tab {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.profile-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.profile-tab.active {
    color: var(--primary);
    border-color: var(--primary);
}

.profile-content {
    padding: 0 24px;
}

.profile-bio-card {
    margin-bottom: 16px;
}

.profile-bio-card .bio-label {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-layout {
    display: flex;
    height: calc(100vh - var(--header-stack-height));
    margin-left: var(--sidebar-width);
}

.chat-sidebar {
    width: 340px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg-secondary);
}

.chat-sidebar__header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-sidebar__header h2 {
    font-size: 20px;
    font-weight: 800;
}

.chat-sidebar__search {
    padding: 8px 16px;
}

.chat-sidebar__search input {
    width: 100%;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 13px;
}

.chat-sidebar__list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chat-conversation {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-conversation:hover {
    background: var(--bg-hover);
}

.chat-conversation.active {
    background: var(--primary-light);
}

.chat-conversation__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.chat-conversation__info {
    flex: 1;
    min-width: 0;
}

.chat-conversation__name {
    font-weight: 600;
    font-size: 14px;
}

.chat-conversation__preview {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conversation__time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
}

.chat-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.chat-header__name {
    font-weight: 700;
    font-size: 15px;
}

.chat-header__status {
    font-size: 12px;
    color: var(--text-tertiary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chat-message {
    display: flex;
    gap: 8px;
    max-width: 65%;
    animation: msgIn .3s ease;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message--mine {
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-message__avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 4px;
}

.chat-message__bubble {
    background: var(--bg-tertiary);
    border-radius: 18px 18px 18px 4px;
    padding: 10px 14px;
}

.chat-message--mine .chat-message__bubble {
    background: var(--primary);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}

.chat-message__sender {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-accent);
}

.chat-message__text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message__time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
    text-align: right;
}

.chat-message--mine .chat-message__time {
    color: rgba(255, 255, 255, .6);
}

.chat-message__image {
    max-width: 250px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.chat-input {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--bg-secondary);
}

.chat-input__attach {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    border: none;
}

.chat-input__attach:hover {
    background: var(--primary);
    color: #fff;
}

.chat-input__text {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    max-height: 100px;
    overflow-y: auto;
    resize: none;
}

.chat-input__send {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.chat-input__send:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.chat-empty__icon {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: .5;
}

.chat-empty__text {
    font-size: 18px;
    font-weight: 600;
}

/* ============================================================
   GROUPS
   ============================================================ */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.group-card {
    cursor: pointer;
}

.group-card__header {
    padding: 20px;
    background: linear-gradient(135deg, #1a237e44, #0d47a144);
}

.group-card__name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.group-card__course {
    font-size: 13px;
    color: var(--text-accent);
}

.group-card__stats {
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.group-card__actions {
    padding: 12px 20px;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.project-card__image {
    height: 180px;
    background: linear-gradient(135deg, #1a237e33, #0d47a133);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
}

.project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card__body {
    padding: 16px;
}

.project-card__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.project-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.project-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.project-card__meta img {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

/* ============================================================
   ANNOUNCEMENTS SIDEBAR
   ============================================================ */
.announcement-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.announcement-item:last-child {
    border: none;
}

.announcement-item--selected {
    border-radius: 10px;
    border: 1px solid #b9cff8;
    background: linear-gradient(180deg, #f6f9ff 0%, #edf3ff 100%);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.12);
}

.announcement-item__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--warning);
}

.announcement-item__icon {
    font-size: 14px;
    line-height: 1;
}

.announcement-item__text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.announcement-item__scopes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.announcement-target-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.announcement-target-badge--course {
    color: #1f4ea5;
    background: #edf3ff;
    border-color: #c9dafb;
}

.announcement-target-badge--general {
    color: #4a4a4a;
    background: #f5f6f8;
    border-color: #dde1e7;
}

.announcement-item__time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.announcement-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-tertiary);
}

#announcementsList {
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#announcementsList::-webkit-scrollbar {
    width: 6px;
}

#announcementsList::-webkit-scrollbar-thumb {
    background: #c6ccd5;
    border-radius: 999px;
}

#announcementsList::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card__icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-card__value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.stat-card__label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.admin-table th {
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .5px;
}

.admin-table tr:hover td {
    background: var(--bg-hover);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(.9);
    transition: var(--transition-slow);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal__title {
    font-size: 18px;
    font-weight: 700;
}

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    border: none;
    transition: var(--transition);
}

.modal__close:hover {
    background: var(--bg-hover);
}

.modal__body {
    padding: 20px;
}

.modal__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================================
   PLATFORM TOUR
   ============================================================ */
body.platform-tour-lock {
    overflow: hidden;
}

.platform-tour {
    position: fixed;
    inset: 0;
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s cubic-bezier(.4, 0, .2, 1), visibility .3s cubic-bezier(.4, 0, .2, 1);
}

.platform-tour.show {
    opacity: 1;
    visibility: visible;
}

.platform-tour__veil {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.08);
    pointer-events: auto;
}

/* ── Spotlight ── */
.platform-tour__spotlight {
    position: fixed;
    border-radius: 14px;
    pointer-events: none;
    z-index: 1412;
    box-shadow:
        0 0 0 2px rgba(99, 179, 255, 0.55),
        0 0 20px 4px rgba(59, 130, 246, 0.15);
    transition: all .32s cubic-bezier(.4, 0, .2, 1);
    animation: tourSpotlightPulse 2.4s ease-in-out infinite;
}

@keyframes tourSpotlightPulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(99, 179, 255, 0.55), 0 0 20px 4px rgba(59, 130, 246, 0.15);
    }

    50% {
        box-shadow: 0 0 0 2px rgba(99, 179, 255, 0.75), 0 0 28px 8px rgba(59, 130, 246, 0.22);
    }
}

.platform-tour__spotlight.is-hidden {
    opacity: 0;
    animation: none;
}

.platform-tour-target {
    position: relative !important;
    z-index: 1411 !important;
    isolation: isolate;
}

/* ── Card ── */
.platform-tour__card {
    position: fixed;
    z-index: 1414;
    pointer-events: auto;
    width: min(380px, calc(100vw - 24px));
    max-height: min(72vh, 540px);
    overflow-y: auto;
    border-radius: 18px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #dce9f8;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    color: #102f57;
    animation: tourCardEntry .35s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes tourCardEntry {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Arrow ── */
.platform-tour__arrow {
    position: fixed;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: 1px solid #dce9f8;
    z-index: 1415;
    transform: rotate(45deg);
    display: none;
    pointer-events: none;
}

.platform-tour__arrow.is-visible {
    display: block;
}

.platform-tour__arrow--top {
    border-bottom: none;
    border-right: none;
}

.platform-tour__arrow--bottom {
    border-top: none;
    border-left: none;
}

.platform-tour__arrow--left {
    border-top: none;
    border-right: none;
}

.platform-tour__arrow--right {
    border-bottom: none;
    border-left: none;
}

/* ── Header ── */
.platform-tour__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.platform-tour__tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.platform-tour__skip {
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}

.platform-tour__skip:hover {
    background: #e2e8f0;
    color: #475569;
}

/* ── Content ── */
.platform-tour__meta {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #3b82f6;
    font-weight: 700;
    letter-spacing: .01em;
}

.platform-tour__title {
    margin-top: 8px;
    font-size: 20px;
    line-height: 1.25;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -.01em;
}

.platform-tour__text {
    margin-top: 8px;
    font-size: 14px;
    color: #475569;
    line-height: 1.55;
    font-weight: 400;
}

/* ── Tips ── */
.platform-tour__tips {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    color: #334155;
    display: grid;
    gap: 6px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    list-style: none;
}

.platform-tour__tips li {
    position: relative;
    padding-left: 16px;
}

.platform-tour__tips li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #63b3ff 100%);
}

/* ── Progress ── */
.platform-tour__progress {
    width: 100%;
    height: 4px;
    margin-top: 16px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}

.platform-tour__progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    transition: width .35s cubic-bezier(.4, 0, .2, 1);
}

.platform-tour__progress-text {
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: .02em;
}

/* ── Actions ── */
.platform-tour__actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.platform-tour__actions .btn--secondary {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s ease;
}

.platform-tour__actions .btn--secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.platform-tour__actions .btn--primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: all .15s ease;
}

.platform-tour__actions .btn--primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

/* ── Mobile ── */
@media (max-width: 720px) {
    .platform-tour__card {
        width: calc(100vw - 16px);
        padding: 16px;
        border-radius: 16px;
        max-height: min(78vh, 580px);
    }

    .platform-tour__title {
        font-size: 18px;
    }

    .platform-tour__text {
        font-size: 13px;
    }
}

/* ============================================================
   MODAL THEME: UPDATES (Avisos e Online)
   ============================================================ */
.modal-overlay--updates {
    background:
        radial-gradient(900px 520px at 12% -10%, rgba(53, 110, 214, 0.5), transparent 62%),
        rgba(5, 16, 38, 0.76);
}

.modal-overlay--updates .modal {
    width: min(94vw, 700px);
    max-width: 700px;
    border-radius: 18px;
    border: 1px solid #8fb2ef;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    box-shadow: 0 28px 70px rgba(5, 14, 33, 0.42);
}

.modal-overlay--updates .modal__header {
    background: linear-gradient(135deg, #0f4aa8 0%, #1260d2 55%, #2d7ef6 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    padding: 16px 18px;
}

.modal-overlay--updates .modal__title {
    color: #f7fbff;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.modal-overlay--updates .modal__close {
    background: rgba(255, 255, 255, 0.2);
    color: #f7fbff;
    border: 1px solid rgba(255, 255, 255, 0.36);
}

.modal-overlay--updates .modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.52);
}

.modal-overlay--updates .modal__body {
    padding: 14px;
}

.modal-overlay--updates .updates-modal {
    gap: 14px;
}

.modal-overlay--updates .updates-modal__tabs {
    border: 1px solid #9cb8eb;
    background: linear-gradient(180deg, #c9daf8 0%, #bbcff0 100%);
    border-radius: 16px;
    padding: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 18px rgba(27, 78, 160, 0.18);
}

.modal-overlay--updates .updates-modal__tab {
    color: #355277;
    font-weight: 800;
    border-radius: 12px;
}

.modal-overlay--updates .updates-modal__tab:hover {
    background: rgba(255, 255, 255, 0.62);
    color: #1d4f96;
}

.modal-overlay--updates .updates-modal__tab.active {
    background: linear-gradient(135deg, #0b4cae 0%, #1f69de 58%, #3688ff 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(20, 73, 160, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.modal-overlay--updates .updates-modal__list {
    gap: 12px;
    padding-right: 4px;
}

.modal-overlay--updates .updates-modal .announcement-item {
    position: relative;
    overflow: hidden;
    border: 1px solid #d4e0f5;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(13, 29, 63, 0.1);
    padding: 13px 14px 13px 16px;
}

.modal-overlay--updates .updates-modal .announcement-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3d86f4 0%, #1d61ce 100%);
    opacity: 0.75;
}

.modal-overlay--updates .updates-modal .announcement-item:hover {
    border-color: #b4caf0;
    box-shadow: 0 14px 28px rgba(16, 47, 97, 0.14);
}

.modal-overlay--updates .updates-modal .announcement-item--selected {
    border-color: #6498ea;
    background: linear-gradient(180deg, #f2f7ff 0%, #e4efff 100%);
    box-shadow: 0 0 0 3px rgba(34, 112, 231, 0.28), 0 16px 30px rgba(20, 74, 161, 0.22);
    transform: translateY(-1px);
}

.modal-overlay--updates .updates-modal .announcement-item--selected::before {
    width: 6px;
    opacity: 1;
    background: linear-gradient(180deg, #4da2ff 0%, #1c65da 100%);
}

.modal-overlay--updates .updates-modal .announcement-item__title {
    color: #124893;
    margin-bottom: 6px;
    font-weight: 800;
}

.modal-overlay--updates .updates-modal .announcement-item__icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: linear-gradient(180deg, rgba(247, 185, 40, 0.32) 0%, rgba(247, 185, 40, 0.2) 100%);
    color: #9b6b00;
}

.modal-overlay--updates .updates-modal .announcement-item__text {
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
}

.modal-overlay--updates .updates-modal .announcement-target-badge--general {
    background: #eef2f8;
    border-color: #d4deea;
    color: #3f4f64;
}

.modal-overlay--updates .updates-modal .announcement-target-badge--course {
    background: #e7f0ff;
    border-color: #bfd3f6;
    color: #1c4fa2;
}

.modal-overlay--updates .updates-modal .announcement-item__time {
    color: #61748f;
    font-weight: 600;
}

.modal-overlay--updates .updates-modal .online-user {
    border: 1px solid #d4e0f5;
    border-radius: 12px;
    background: #fff;
    padding: 10px 11px;
    box-shadow: 0 8px 16px rgba(13, 29, 63, 0.08);
}

.modal-overlay--updates .updates-modal .online-user:hover {
    background: #f3f8ff;
    border-color: #b8cdf1;
    box-shadow: 0 12px 22px rgba(16, 47, 97, 0.14);
}

.modal-overlay--updates .updates-modal .online-user .dot {
    box-shadow: 0 0 0 4px rgba(49, 162, 76, 0.18);
}

.modal-overlay--updates .updates-modal .announcement-empty,
.modal-overlay--updates .updates-modal .online-empty {
    border: 1px dashed #b9cbeb;
    border-radius: 12px;
    background: #f4f8ff;
    color: #5b6f8c;
}

.modal-overlay--updates .updates-modal__list::-webkit-scrollbar {
    width: 8px;
}

.modal-overlay--updates .updates-modal__list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #9db9ec, #7fa4e2);
    border-radius: 999px;
}

/* ============================================================
   MODAL THEME: CHAT IMAGE (Transparent)
   ============================================================ */
.modal-overlay--chat-image {
    background: rgba(7, 17, 38, 0.34);
    backdrop-filter: blur(2px);
}

.modal-overlay--chat-image .modal {
    width: min(96vw, 1100px);
    max-width: 1100px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.modal-overlay--chat-image .modal__header {
    padding: 8px 6px 10px;
    border-bottom: none;
    background: transparent;
}

.modal-overlay--chat-image .modal__title {
    color: #f5f9ff;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.modal-overlay--chat-image .modal__close {
    background: rgba(7, 18, 41, 0.55);
    color: #f5f9ff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.modal-overlay--chat-image .modal__close:hover {
    background: rgba(7, 18, 41, 0.75);
}

.modal-overlay--chat-image .modal__body {
    padding: 0;
}

.modal-overlay--chat-image .fab-chat-image-viewer__img {
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 18px 36px rgba(4, 10, 24, 0.45);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    animation: toastIn .3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast--success {
    border-left: 4px solid var(--success);
}

.toast--error {
    border-left: 4px solid var(--danger);
}

.toast--info {
    border-left: 4px solid var(--info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast__icon {
    font-size: 20px;
}

.toast__text {
    font-size: 14px;
    flex: 1;
}

/* ============================================================
   COURSES PAGE
   ============================================================ */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.course-card__banner {
    height: 100px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.course-card__body {
    padding: 16px;
}

.course-card__name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.course-card__slug {
    font-size: 12px;
    color: var(--text-tertiary);
}

.course-card__count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.badge--primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge--success {
    background: rgba(66, 183, 42, .15);
    color: var(--success);
}

.badge--danger {
    background: rgba(250, 62, 62, .15);
    color: var(--danger);
}

.badge--warning {
    background: rgba(255, 167, 38, .15);
    color: var(--warning);
}

/* ============================================================
   404 PAGE
   ============================================================ */
.page-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.page-404 h1 {
    font-size: 100px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.page-404 p {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 16px 0 24px;
}



/* ============================================================
   BANNER SLIDER (Feed)
   ============================================================ */
.banner-slider {
    position: relative;
    height: auto;
    aspect-ratio: 16 / 9;
    margin-bottom: 24px;
    overflow: hidden;
    background: #09121f;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(9, 18, 31, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.banner-slider__track {
    width: 100%;
    height: 100%;
    position: relative;
}

.banner-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    padding: 0 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s;
    z-index: 1;
    overflow: hidden;
}

.banner-slide__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 0;
    border: 0;
    pointer-events: none;
}

.banner-slide__video--iframe {
    border: 0;
    overflow: hidden;
    object-fit: cover;
    background: transparent;
}

.banner-slide__video--interactive {
    pointer-events: auto;
}

.banner-slide__audio-toggle {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 11;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(9, 18, 31, 0.55);
    color: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.banner-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            rgba(9, 18, 31, 0.20) 0%,
            rgba(9, 18, 31, 0.12) 46%,
            rgba(9, 18, 31, 0.00) 100%);
    z-index: 1;
    pointer-events: none;
}

.banner-slide::after {
    content: none;
}

.banner-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.banner-slide__content {
    position: relative;
    z-index: 3;
    max-width: 560px;
    color: #fff;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    background: rgba(9, 18, 31, 0.18);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(2px);
    transform: translateY(12px);
    transition: transform 0.6s ease;
}

.banner-slide.active .banner-slide__content {
    transform: translateY(0);
}

.banner-slide__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.banner-slide__title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 14px;
    color: #fff;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.banner-slide__text {
    font-size: 16px;
    margin-bottom: 24px;
    opacity: 0.92;
    max-width: 52ch;
}

.banner-slide__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Navigation Dots */
.banner-slider__nav {
    position: absolute;
    bottom: 16px;
    left: 24px;
    display: flex;
    gap: 8px;
    z-index: 10;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.banner-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-slider__dot.active {
    background: #fff;
    width: 22px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

/* Stats in banner */
.banner-slider__stats {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.banner-slider__stat {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: right;
}

.banner-slider__stat .value {
    display: block;
    font-size: 20px;
    font-weight: 800;
}

.banner-slider__stat .label {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .banner-slider {
        aspect-ratio: 4 / 3;
        /* More vertical space on mobile */
    }

    .banner-slide {
        padding: 0 20px;
        align-items: flex-start;
        padding-top: 26px;
    }

    .banner-slide__content {
        padding: 18px 16px 16px;
        border-radius: 14px;
        max-width: 100%;
        /* Ensure it doesn't overflow */
    }

    .banner-slide__title {
        font-size: 24px;
    }

    .banner-slider__nav {
        left: 16px;
        bottom: 12px;
    }

    .banner-slider__stats {
        display: none;
    }

    .banner-slide__actions {
        flex-direction: column;
    }
}

@media (max-width: 900px) {

    /* Full-bleed no mobile/tablet pequeno para o banner encostar nas bordas do layout */
    .feed-page .feed-shell>.banner-slider {
        width: calc(100% + 28px);
        margin-left: -14px;
        margin-right: -14px;
        border-radius: 0;
    }
}

@media (max-width: 700px) {
    .feed-page .feed-shell>.banner-slider {
        width: calc(100% + 20px);
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
    }
}

/* ============================================================
   FEED (Premium / Instagram-style)
   ============================================================ */
.feed-page {
    padding: 14px 0 28px;
}

@media (max-width: 900px) {

    /* Avoid the floating chat button covering the last cards */
    .feed-page {
        padding-bottom: 120px;
    }
}

.feed-page .feed-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (max-width: 700px) {
    .feed-page .feed-shell {
        padding: 0 10px;
    }
}

.feed-new {
    margin: 10px 0 14px;
    display: flex;
    justify-content: center;
}

.feed-new__btn {
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.feed-new__btn:hover {
    background: rgba(var(--primary-rgb), 0.14);
    transform: translateY(-1px);
}

.post-composer--feed {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(217, 226, 239, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}

.post-composer--feed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: 3px 3px 0 0;
}

.post-composer--feed .post-composer__top {
    padding: 14px 16px 16px;
}

.post-composer--feed #composerAvatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(24, 119, 242, 0.15);
}

.post-composer--feed .post-composer__input {
    flex: 1;
    text-align: left;
    background: rgba(238, 242, 248, 0.7);
    border: 1px solid rgba(217, 226, 239, 0.6);
    padding: 12px 14px;
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-composer--feed .post-composer__input:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(24, 119, 242, 0.2);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.06);
}

.feed-stream {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(217, 226, 239, 0.5);
}

@media (max-width: 900px) {
    .feed-stream {
        padding: 14px;
    }
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.feed-discovery {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(217, 226, 239, 0.5);
    margin-bottom: 16px;
}

.feed-discovery__row {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 14px;
    align-items: end;
}

@media (max-width: 700px) {
    .feed-discovery__row {
        grid-template-columns: 1fr;
    }
}

.feed-discovery label {
    display: block;
    font-size: 11px;
    font-weight: 900;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
}

.feed-discovery__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

@media (max-width: 700px) {
    .feed-discovery__filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}

.feed-filter {
    border: 1px solid rgba(217, 226, 239, 0.7);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
    font-weight: 900;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.feed-filter:hover {
    transform: translateY(-2px);
    border-color: rgba(24, 119, 242, 0.3);
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(16, 44, 90, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.feed-filter.active {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(24, 119, 242, 0.12) 0%, rgba(13, 71, 161, 0.08) 100%);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(24, 119, 242, 0.3);
}

.feed-discovery__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.feed-stat {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(217, 226, 239, 0.6);
    border-left: 3px solid rgba(24, 119, 242, 0.3);
    border-radius: 14px;
    padding: 10px 12px;
    display: grid;
    gap: 2px;
    backdrop-filter: blur(4px);
    transition: all 0.25s ease;
}

.feed-stat:hover {
    border-left-color: var(--primary);
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.08);
}

.feed-stat span {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
}

.feed-stat small {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 700px) {
    .feed-discovery__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.feed-create__row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.feed-create__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.feed-create__who {
    font-weight: 800;
    color: var(--text-secondary);
}

.feed-create__media input[type="file"] {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(var(--primary-rgb), 0.35);
    background: rgba(var(--primary-rgb), 0.06);
}

.feed-create__preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 520px) {
    .feed-create__preview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.feed-create__preview img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f4f6f8;
}

.feed-create__hint {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
}

.feed-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.25);
    transition: var(--transition);
    word-break: break-word;
}

.feed-link:hover {
    border-bottom-color: rgba(var(--primary-rgb), 0.55);
    color: rgba(var(--primary-rgb), 1);
}

.feed-pill {
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    margin: 0 1px;
    transition: var(--transition);
}

.feed-pill:hover {
    background: rgba(var(--primary-rgb), 0.10);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.feed-pill--mention {
    color: rgba(var(--primary-rgb), 1);
}

.ig-post {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(217, 226, 239, 0.5);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow .3s ease, border-color .3s ease;
}

.ig-post:hover {
    transform: translateY(-3px);
    border-color: rgba(24, 119, 242, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(24, 119, 242, 0.08);
}

.ig-post--birthday {
    border-color: rgba(244, 114, 182, 0.46);
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(245, 158, 11, 0.28), rgba(20, 20, 20, 0) 52%),
        radial-gradient(120% 130% at 0% 100%, rgba(59, 130, 246, 0.2), rgba(20, 20, 20, 0) 55%),
        linear-gradient(180deg, rgba(29, 10, 45, 0.98) 0%, rgba(56, 18, 76, 0.98) 100%);
    box-shadow: 0 14px 36px rgba(236, 72, 153, 0.16), 0 20px 44px rgba(59, 130, 246, 0.14);
}

.ig-post--birthday:hover {
    border-color: rgba(251, 146, 60, 0.56);
    box-shadow: 0 18px 42px rgba(236, 72, 153, 0.22), 0 24px 52px rgba(59, 130, 246, 0.2);
}

.ig-post--birthday .ig-post__actions {
    border-top-color: rgba(250, 204, 21, 0.26);
}

.ig-post--birthday .ig-post__avatar img {
    border-color: rgba(250, 204, 21, 0.45);
}

.ig-post--birthday .ig-post__name {
    color: #f8fafc;
}

.ig-post--birthday .ig-post__line2,
.ig-post--birthday .ig-post__handle,
.ig-post--birthday .ig-post__time {
    color: #cbd5e1;
}

.ig-post--birthday .ig-post__chip {
    color: #fef3c7;
    background: rgba(15, 23, 42, 0.35);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.36);
}

.ig-post--birthday .ig-post__menu {
    color: #f8fafc;
    border-color: rgba(147, 197, 253, 0.35);
    background: rgba(15, 23, 42, 0.42);
}

.ig-post--birthday .ig-post__menu:hover {
    color: #fef3c7;
    border-color: rgba(250, 204, 21, 0.44);
    box-shadow: 0 6px 14px rgba(250, 204, 21, 0.16);
}

.ig-post--birthday .ig-post__text {
    color: #f8fafc;
}

.ig-post--birthday .ig-count {
    color: #e2e8f0;
}

.ig-post--birthday .ig-count:hover {
    color: #ffffff;
}

.ig-post--birthday .ig-count--ghost {
    color: #cbd5e1;
}

.ig-birthday-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(250, 204, 21, 0.28);
    border-radius: 16px;
    padding: 14px 14px 14px;
    margin: 2px 0 10px;
    background-image:
        linear-gradient(135deg, rgba(23, 8, 41, 0.72) 0%, rgba(67, 20, 96, 0.64) 44%, rgba(127, 29, 29, 0.62) 100%),
        url("../img/birthday-card-bg.svg");
    background-size: cover, cover;
    background-position: center center, center center;
    background-repeat: no-repeat, no-repeat;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 32px rgba(13, 7, 25, 0.42);
}

.ig-birthday-hero::before,
.ig-birthday-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.ig-birthday-hero::before {
    width: 220px;
    height: 220px;
    right: -120px;
    top: -120px;
    background: radial-gradient(circle at center, rgba(250, 204, 21, 0.35), rgba(250, 204, 21, 0) 70%);
    animation: birthdayHaloShift 6s ease-in-out infinite;
}

.ig-birthday-hero::after {
    width: 180px;
    height: 180px;
    left: -90px;
    bottom: -100px;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.3), rgba(56, 189, 248, 0) 70%);
    animation: birthdayHaloShift 6s ease-in-out infinite reverse;
}

.ig-birthday-hero__top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ig-birthday-hero__top-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ig-birthday-hero__ribbon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fef3c7;
    border: 1px solid rgba(250, 204, 21, 0.35);
    background: rgba(74, 20, 140, 0.38);
    backdrop-filter: blur(6px);
}

.ig-birthday-hero__day {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #fef3c7;
    background: rgba(30, 41, 59, 0.42);
    border: 1px solid rgba(147, 197, 253, 0.4);
    backdrop-filter: blur(6px);
}

.ig-birthday-hero__main {
    position: relative;
    z-index: 2;
    margin-top: 10px;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    align-items: center;
}

.ig-birthday-hero__portrait-wrap {
    position: relative;
    width: 92px;
    height: 92px;
}

.ig-birthday-hero__portrait {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.32);
}

.ig-birthday-hero__portrait-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(250, 204, 21, 0.75);
    box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.35), 0 0 18px rgba(250, 204, 21, 0.45);
    pointer-events: none;
}

.ig-birthday-hero__copy {
    display: grid;
    gap: 2px;
}

.ig-birthday-hero__title {
    position: relative;
    z-index: 2;
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.ig-birthday-hero__who {
    position: relative;
    z-index: 2;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
    color: #f9a8d4;
    opacity: 1;
}

.ig-birthday-hero__text {
    position: relative;
    z-index: 2;
    margin: 0;
    color: #f8fafc;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.45;
    max-width: 38ch;
}

.ig-birthday-hero__chips {
    position: relative;
    z-index: 2;
    margin-top: 10px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.ig-birthday-hero__chips span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 800;
    color: #fef3c7;
    border: 1px solid rgba(250, 204, 21, 0.42);
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
}

.ig-birthday-hero--clean {
    border-color: rgba(147, 197, 253, 0.34);
    background-image: linear-gradient(145deg, rgba(248, 252, 255, 0.97) 0%, rgba(241, 247, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 7px 16px rgba(59, 130, 246, 0.08);
}

.ig-birthday-hero--clean::before {
    background: radial-gradient(circle at center, rgba(147, 197, 253, 0.18), rgba(147, 197, 253, 0) 70%);
}

.ig-birthday-hero--clean::after {
    background: radial-gradient(circle at center, rgba(191, 219, 254, 0.2), rgba(191, 219, 254, 0) 70%);
}

.ig-birthday-hero--clean .ig-birthday-hero__ribbon {
    color: #1d4ed8;
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(239, 246, 255, 0.9);
    backdrop-filter: none;
}

.ig-birthday-hero--clean .ig-birthday-hero__day {
    color: #1e3a8a;
    border-color: rgba(147, 197, 253, 0.45);
    background: rgba(239, 246, 255, 0.88);
    backdrop-filter: none;
}

.ig-birthday-hero--clean .ig-birthday-hero__title {
    color: #0f172a;
    text-shadow: none;
}

.ig-birthday-hero--clean .ig-birthday-hero__who {
    color: #2563eb;
}

.ig-birthday-hero--clean .ig-birthday-hero__text {
    color: #334155;
}

.ig-birthday-hero--clean .ig-birthday-hero__portrait {
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 14px rgba(30, 64, 175, 0.15);
}

.ig-birthday-hero--clean .ig-birthday-hero__portrait-ring {
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 0 2px rgba(191, 219, 254, 0.35);
}

.ig-birthday-hero--clean .ig-birthday-hero__chips span {
    color: #1d4ed8;
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(239, 246, 255, 0.9);
    backdrop-filter: none;
}

.ig-birthday-hero--clean .ig-birthday-hero__confetti {
    opacity: 0.5;
    filter: saturate(0.65);
}

.ig-birthday-hero__confetti {
    position: relative;
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    font-size: 18px;
    z-index: 2;
    pointer-events: none;
}

.ig-birthday-hero__confetti span {
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
}

.ig-birthday-hero__confetti .is-a {
    animation: birthdayFloatTiny 2.8s ease-in-out infinite;
}

.ig-birthday-hero__confetti .is-b {
    animation: birthdayFloatTiny 3.1s ease-in-out infinite 0.15s;
}

.ig-birthday-hero__confetti .is-c {
    animation: birthdayFloatTiny 2.6s ease-in-out infinite 0.3s;
}

.ig-birthday-hero__confetti .is-d {
    animation: birthdayFloatTiny 3.2s ease-in-out infinite 0.45s;
}

@keyframes birthdayFloatTiny {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(-3deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes birthdayHaloShift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.9;
    }

    50% {
        transform: translate3d(8px, 6px, 0) scale(1.05);
        opacity: 1;
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ig-birthday-hero::before,
    .ig-birthday-hero::after,
    .ig-birthday-hero__confetti .is-a,
    .ig-birthday-hero__confetti .is-b,
    .ig-birthday-hero__confetti .is-c,
    .ig-birthday-hero__confetti .is-d {
        animation: none !important;
    }
}

.ig-post__header {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 14px 10px;
}

.ig-post__avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(24, 119, 242, 0.12);
    transition: border-color 0.3s ease;
}

.ig-post:hover .ig-post__avatar img {
    border-color: rgba(24, 119, 242, 0.3);
}

.ig-post__line1 {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.ig-post__name {
    font-weight: 800;
    color: var(--text-primary);
}

.ig-post__chip {
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 10px;
    border: none;
    background: linear-gradient(135deg, rgba(24, 119, 242, 0.1) 0%, rgba(13, 71, 161, 0.06) 100%);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(24, 119, 242, 0.15);
}

.ig-post__line2 {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 12px;
    margin-top: 2px;
}

.ig-post__handle {
    color: var(--text-secondary);
    font-weight: 700;
}

.ig-post__menu {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(217, 226, 239, 0.6);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ig-post__menu:hover {
    border-color: rgba(24, 119, 242, 0.25);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.1);
}

.ig-post__body {
    padding: 0 14px 12px;
}

.ig-post__text {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    margin: 2px 0 12px;
}

.ig-post__media {
    border-radius: 14px;
    overflow: hidden;
    background: #f4f6f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.ig-media__img {
    width: 100%;
    height: auto;
    display: block;
}

.ig-post__media--carousel .ig-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.ig-carousel__item {
    min-width: 100%;
    scroll-snap-align: start;
}

.ig-carousel__dots {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    display: flex;
    gap: 6px;
    z-index: 3;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.ig-post__media--carousel {
    position: relative;
}

.ig-carousel__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.ig-carousel__dot.active {
    width: 18px;
    background: rgba(255, 255, 255, 0.92);
}

.ig-post__meta {
    padding: 0 14px 10px;
}

.ig-post__counts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    /* center on desktop */
    color: var(--text-tertiary);
    font-size: 12px;
}

.ig-count {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.ig-count:hover {
    color: var(--text-secondary);
}

.ig-count--ghost {
    cursor: default;
}

.ig-post__actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ig-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(217, 226, 239, 0.65);
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 10px 10px;
    min-height: 44px;
    font-weight: 800;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ig-action__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    /* avoid baseline pushing icons off-center */
}

.ig-action__icon svg {
    width: 18px;
    height: 18px;
    display: block;
    /* avoid inline-SVG baseline quirks */
    transition: transform 0.2s ease;
}

.ig-action:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(24, 119, 242, 0.3);
    color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 244, 255, 0.9) 100%);
    box-shadow: 0 8px 24px rgba(16, 44, 90, 0.1);
}

.ig-action:hover .ig-action__icon svg {
    transform: scale(1.1);
}

.ig-action.is-on {
    border-color: rgba(24, 119, 242, 0.35);
    background: linear-gradient(135deg, rgba(24, 119, 242, 0.1) 0%, rgba(13, 71, 161, 0.06) 100%);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(24, 119, 242, 0.1);
}

@media (max-width: 430px) {
    .ig-action {
        gap: 0;
        padding: 10px 8px;
    }

    .ig-action__label {
        display: none;
    }

    .ig-birthday-hero__title {
        font-size: 18px;
    }

    .ig-birthday-hero__day {
        font-size: 10px;
        padding: 3px 8px;
    }

    .ig-birthday-hero__top-right {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .ig-birthday-hero__main {
        grid-template-columns: 72px 1fr;
        gap: 10px;
        align-items: start;
    }

    .ig-birthday-hero__portrait-wrap,
    .ig-birthday-hero__portrait {
        width: 72px;
        height: 72px;
    }

    .ig-birthday-hero__text {
        font-size: 12px;
    }

    .ig-birthday-hero__confetti {
        font-size: 16px;
    }
}

.ig-post--liked-pop .ig-action--like {
    transform: translateY(-1px) scale(1.03);
}

.ig-comments {
    display: none;
    padding: 0 14px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ig-comments.show {
    display: block;
}

.ig-comments__list {
    padding-top: 12px;
}

.ig-comments__loading,
.ig-comments__empty {
    padding: 14px 0 6px;
    color: var(--text-tertiary);
    font-weight: 700;
    font-size: 13px;
}

.ig-comments__reply {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text-secondary);
    font-weight: 700;
}

.ig-comments__reply button {
    border: none;
    background: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 900;
}

.ig-comments__composer {
    display: grid;
    grid-template-columns: 34px 1fr auto auto;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.ig-comments__me {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.ig-comments__input {
    height: 40px;
    border-radius: 999px;
    border: 1px solid #d9e2ef;
    background: #eef2f8;
    padding: 10px 12px;
    font-size: 14px;
}

.ig-comments__input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.35);
}

.ig-comments__emoji {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #d9e2ef;
    background: #fff;
    cursor: pointer;
}

.ig-comments__send {
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    background: rgba(var(--primary-rgb), 0.10);
    color: var(--primary);
    font-weight: 900;
    cursor: pointer;
    padding: 0 12px;
}

.ig-comment {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    margin-bottom: 10px;
    margin-left: calc(var(--depth, 0) * 14px);
}

.ig-comment__avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.ig-comment__bubble {
    background: #eef2f8;
    border: 1px solid #d9e2ef;
    border-radius: 14px;
    padding: 10px 12px;
}

.ig-comment__name {
    font-weight: 900;
    color: var(--text-primary);
    margin-right: 6px;
}

.ig-comment__pill {
    display: inline-flex;
    align-items: center;
    margin: 0 6px 0 0;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
}

.ig-comment__text {
    color: var(--text-primary);
}

.ig-comment__meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 6px 2px 0;
}

.ig-comment__reply {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--primary);
    font-weight: 900;
}

.feed-skeleton {
    padding: 16px;
    border-radius: 16px;
}

.sk-row {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
}

.sk-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(90deg, #eaf0f9, #f7f9fd, #eaf0f9);
    background-size: 200% 100%;
    animation: sk 1.5s ease-in-out infinite;
}

.sk-lines .sk-line {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #eaf0f9, #f7f9fd, #eaf0f9);
    background-size: 200% 100%;
    animation: sk 1.5s ease-in-out infinite;
    margin-bottom: 8px;
}

.sk-line--w40 {
    width: 42%;
}

.sk-line--w28 {
    width: 28%;
}

.sk-line--w90 {
    width: 90%;
    height: 14px;
}

.sk-line--w75 {
    width: 75%;
}

.sk-media {
    height: 240px;
    border-radius: 16px;
    margin-top: 14px;
    background: linear-gradient(90deg, #eaf0f9, #f7f9fd, #eaf0f9);
    background-size: 200% 100%;
    animation: sk 1.5s ease-in-out infinite;
}

.sk-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.sk-pill {
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(90deg, #e7edf6, #f4f7fc, #e7edf6);
    background-size: 200% 100%;
    animation: sk 1.2s ease-in-out infinite;
}

@keyframes sk {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: -200% 0%;
    }
}

.feed-emoji {
    position: fixed;
    z-index: 9999;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid #d9e2ef;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.feed-emoji__btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #f7faff;
    cursor: pointer;
}

.feed-emoji__btn:hover {
    border-color: rgba(var(--primary-rgb), 0.35);
    background: rgba(var(--primary-rgb), 0.08);
}

.share-sheet__url {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #f5f7fb;
    border: 1px solid #d9e2ef;
    padding: 10px 12px;
    border-radius: 12px;
    word-break: break-all;
    color: var(--text-secondary);
}

.share-sheet__actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.feed-post.feed-post--hidden {
    display: none;
}

.feed-post.feed-post--focused {
    border-color: rgba(var(--primary-rgb), 0.5) !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.18), var(--shadow-lg);
    animation: feedPostFocus 2.2s ease;
}

@keyframes feedPostFocus {
    0% {
        transform: translateY(0);
    }

    35% {
        transform: translateY(-2px);
    }

    100% {
        transform: translateY(0);
    }
}

/* ============================================================
   FAB CHAT (Quick Chat)
   ============================================================ */
body.fab-chat-lock {
    overflow: hidden;
}

.fab-chat {
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;
    left: auto !important;
    top: auto !important;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(140deg, #105ddc 0%, #3189ff 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(21, 98, 227, 0.44);
    z-index: 120;
    transition: transform .16s ease, box-shadow .2s ease, filter .2s ease;
}

.fab-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(21, 98, 227, 0.5);
    filter: brightness(1.05);
}

.fab-chat:disabled {
    opacity: .5;
    cursor: wait;
    transform: none;
}

.fab-chat__pulse {
    position: absolute;
    inset: -7px;
    border-radius: 22px;
    border: 2px solid rgba(49, 137, 255, 0.28);
    animation: fabPulse 2.2s ease-out infinite;
}

.fab-chat__icon {
    width: 26px;
    height: 26px;
    position: relative;
    z-index: 2;
}

@keyframes fabPulse {
    0% {
        transform: scale(0.96);
        opacity: .7;
    }

    70% {
        transform: scale(1.08);
        opacity: .16;
    }

    100% {
        transform: scale(1.14);
        opacity: 0;
    }
}

.fab-chat-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 780px at 12% 18%, rgba(25, 100, 211, 0.2), transparent 62%),
        radial-gradient(900px 620px at 86% 84%, rgba(15, 80, 176, 0.16), transparent 66%),
        rgba(6, 16, 32, 0.56);
    backdrop-filter: blur(10px) saturate(125%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 130;
    padding: 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.fab-chat-overlay.show {
    display: flex;
    animation: fadeIn .2s ease;
}

.fab-chat-overlay.keyboard-open-mobile {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.fab-chat-overlay.keyboard-open-mobile .fab-chat-toolbar,
.fab-chat-overlay.keyboard-open-mobile .fab-chat-thread-header,
.fab-chat-overlay.keyboard-open-mobile .fab-chat-compose {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.fab-chat-panel {
    position: relative;
    width: min(1080px, 96vw);
    height: min(760px, 92vh);
    border-radius: 24px;
    border: 1px solid rgba(214, 227, 244, 0.95);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    box-shadow: 0 28px 90px rgba(3, 10, 24, 0.38);
    animation: chatPanelIn .24s ease;
}

.fab-chat-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(600px 240px at 100% 0%, rgba(255, 255, 255, 0.3), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 28%);
}

@keyframes chatPanelIn {
    from {
        transform: translateY(10px) scale(.985);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.fab-chat-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(23, 66, 140, 0.3);
    background:
        linear-gradient(115deg, #0c4cb1 0%, #0f66d8 44%, #4a98f2 100%);
    color: #fff;
}

.fab-chat-title {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: .015em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}

.fab-chat-top__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fab-chat-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.84);
    margin-top: 2px;
}

.fab-chat-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-menu:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.fab-chat-close {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-close:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.fab-chat-toolbar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #dae5f4;
    background: rgba(248, 251, 255, 0.94);
    backdrop-filter: blur(6px);
}

.fab-chat-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fab-chat-toolbar input {
    width: 100%;
    border: 1px solid var(--chat-border-strong);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    background: #fff;
}

.fab-chat-toolbar input:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 4px rgba(var(--chat-accent-rgb), 0.14);
}

.fab-chat-filters {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.fab-chat-actions-row {
    display: none !important;
}

.fab-chat-action {
    border: 1px solid var(--chat-accent);
    border-radius: 999px;
    background: rgba(var(--chat-accent-rgb), 0.1);
    color: var(--chat-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
    padding: 7px 13px;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-action:hover {
    background: var(--chat-accent);
    color: #fff;
}

.fab-chat-action--ghost {
    border-color: var(--border-color);
    background: #fff;
    color: var(--text-secondary);
}

.fab-chat-action--ghost:hover {
    border-color: var(--chat-accent);
    background: rgba(var(--chat-accent-rgb), 0.1);
    color: var(--chat-accent);
}

.fab-chat-filter {
    border: 1px solid var(--chat-border-soft);
    border-radius: 999px;
    background: #f9fbff;
    color: #54657f;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 11px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.fab-chat-filter:hover {
    border-color: rgba(var(--chat-accent-rgb), 0.5);
    color: var(--chat-accent);
    background: #fff;
}

.fab-chat-filter.active {
    border-color: rgba(var(--chat-accent-rgb), 0.36);
    background: rgba(var(--chat-accent-rgb), 0.14);
    color: var(--chat-accent);
    box-shadow: 0 8px 16px rgba(var(--chat-accent-rgb), 0.18);
}

.fab-chat-body {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(312px, 356px) 1fr;
    background: var(--chat-surface-strong);
}

.fab-chat-list {
    border-right: 1px solid #d7e3f3;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    background:
        linear-gradient(180deg, #f6faff 0%, #eef5ff 30%, #f8fbff 100%);
}

.fab-chat-list-empty {
    margin: 12px;
    padding: 20px 16px;
    border: 1px dashed var(--chat-border-strong);
    border-radius: 14px;
    text-align: center;
    color: var(--chat-text-dim);
    font-size: 13px;
    background: #fff;
}

.fab-chat-conv {
    position: relative;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 10px 10px 10px 12px;
    border-radius: 16px;
    border: 1px solid #dbe6f5;
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.fab-chat-conv::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 5px 5px 0;
    background: transparent;
    transition: var(--transition);
}

.fab-chat-conv:hover {
    background: #f6f9ff;
    border-color: #cfdff4;
    transform: translateY(-1px);
}

.fab-chat-conv.active {
    background: linear-gradient(180deg, rgba(var(--chat-accent-rgb), 0.13) 0%, rgba(var(--chat-accent-rgb), 0.09) 100%);
    border-color: rgba(var(--chat-accent-rgb), 0.35);
    box-shadow: 0 14px 24px rgba(var(--chat-accent-rgb), 0.2);
}

.fab-chat-conv.active::before {
    background: linear-gradient(180deg, #2d7bf2 0%, #0f5fd7 100%);
}

.fab-chat-conv__avatar-wrap {
    position: relative;
}

.fab-chat-conv__avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    object-fit: cover;
    background: #e9eef7;
    border: 1px solid #d8e3f3;
}

.fab-chat-conv__avatar--link {
    cursor: pointer;
}

.fab-chat-conv__avatar--link:hover {
    border-color: rgba(var(--chat-accent-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.16);
}

.fab-chat-conv__active-dot {
    position: absolute;
    right: -2px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #93a7c5;
    transition: var(--transition);
}

.fab-chat-conv.active .fab-chat-conv__active-dot {
    background: #26b25f;
    box-shadow: 0 0 0 4px rgba(38, 178, 95, 0.18);
}

.fab-chat-conv__content {
    min-width: 0;
}

.fab-chat-conv__actions {
    border: 1px solid #d2deef;
    background: #fff;
    color: #4e5f7b;
    border-radius: 11px;
    width: 31px;
    height: 31px;
    padding: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-conv__actions:hover {
    background: #eaf2ff;
    border-color: #acc4ef;
    color: #134d9d;
}

.fab-chat-conv__actions:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.22);
}

.fab-chat-conv.active .fab-chat-conv__actions {
    background: #eff4ff;
    border-color: rgba(var(--chat-accent-rgb), 0.34);
}

.fab-chat-conv__top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}

.fab-chat-conv__name {
    font-weight: 800;
    font-size: 14px;
    color: #1f2d3d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fab-chat-conv__kind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-size: 13px;
    vertical-align: middle;
}

.fab-chat-conv__time {
    font-size: 11px;
    color: #74839c;
    white-space: nowrap;
    font-weight: 600;
}

.fab-chat-conv__preview {
    margin-top: 3px;
    font-size: 12px;
    color: var(--chat-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fab-chat-conv__preview-sender {
    color: #2f3d53;
    font-weight: 700;
    margin-right: 4px;
}

.fab-chat-conv__preview-text {
    color: var(--chat-text-dim);
}

.fab-chat-conv__meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.fab-chat-conv__type {
    display: inline-flex;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6d7e98;
    border: 1px solid #d0ddee;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f8fbff;
}

.fab-chat-section {
    margin-bottom: 14px;
}

.fab-chat-section__title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5f7393;
    padding: 10px 10px 7px;
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(241, 247, 255, 0.96) 0%, rgba(241, 247, 255, 0.82) 72%, rgba(241, 247, 255, 0));
}

.fab-chat-thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(780px 300px at 100% 0%, rgba(111, 163, 240, 0.13), transparent 68%),
        linear-gradient(180deg, #f7faff 0%, #edf3fd 100%);
}

.fab-chat-thread-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid #d9e5f4;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
}

.fab-chat-back {
    display: none;
    border: 1px solid #d5e1f1;
    background: #fff;
    color: #4e5f79;
    border-radius: 10px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.fab-chat-thread-meta-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.fab-chat-thread-meta-wrap.is-profile-link {
    cursor: pointer;
    border-radius: 12px;
    padding: 4px 6px;
    transition: var(--transition);
}

.fab-chat-thread-meta-wrap.is-profile-link:hover {
    background: rgba(var(--chat-accent-rgb), 0.1);
}

.fab-chat-thread-meta-wrap.is-profile-link:focus-visible {
    outline: 2px solid rgba(var(--chat-accent-rgb), 0.35);
    outline-offset: 2px;
}

.fab-chat-thread-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    object-fit: cover;
    border: 1px solid #d6e3f5;
    background: #e9eff9;
    flex: 0 0 42px;
}

.fab-chat-thread-meta {
    min-width: 0;
}

.fab-chat-thread-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.fab-chat-thread-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
    color: #1b2d43;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fab-chat-thread-mute-indicator {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    color: #8b4c00;
    background: rgba(245, 162, 26, 0.2);
    border: 1px solid rgba(245, 162, 26, 0.44);
}

.fab-chat-thread-mute-indicator[hidden] {
    display: none !important;
}

.fab-chat-thread-status {
    font-size: 12px;
    color: #6c7d96;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fab-chat-thread-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--chat-accent);
    background: rgba(var(--chat-accent-rgb), 0.12);
    border: 1px solid rgba(var(--chat-accent-rgb), 0.2);
}

.fab-chat-thread-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fab-chat-thread-action {
    border: 1px solid #d0deef;
    border-radius: 11px;
    background: #fff;
    color: #4f607a;
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-thread-action svg {
    width: 17px;
    height: 17px;
}

.fab-chat-thread-action:hover {
    border-color: var(--chat-accent);
    color: var(--chat-accent);
    background: rgba(var(--chat-accent-rgb), 0.08);
}

.fab-chat-thread-call {
    border-color: rgba(33, 157, 92, 0.35);
    color: #0f7e45;
    background: rgba(33, 157, 92, 0.1);
}

.fab-chat-thread-call:hover {
    border-color: rgba(33, 157, 92, 0.58);
    color: #0b6c3a;
    background: rgba(33, 157, 92, 0.18);
}

.fab-chat-thread-call.is-live {
    border-color: rgba(217, 65, 65, 0.42);
    color: #b92727;
    background: rgba(217, 65, 65, 0.16);
}

.fab-chat-thread-call.is-muted {
    border-color: rgba(245, 162, 26, 0.58);
    color: #b26a00;
    background: rgba(245, 162, 26, 0.2);
    position: relative;
}

.fab-chat-thread-call.is-muted::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #f59f0b;
    box-shadow: 0 0 0 2px #fff;
}

.fab-call-panel {
    display: grid;
    gap: 8px;
    text-align: center;
    align-items: center;
    justify-items: center;
}

.fab-call-panel__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(39, 108, 227, 0.14);
    color: #1a5cc6;
    border: 1px solid rgba(39, 108, 227, 0.3);
}

.fab-call-panel__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(39, 108, 227, 0.38);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
    background: #e8eef8;
}

.fab-call-panel__status {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.fab-call-panel__hint {
    font-size: 12px;
    color: var(--text-tertiary);
}

.fab-call-panel__mute {
    margin-top: 2px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #8b4c00;
    background: rgba(245, 162, 26, 0.2);
    border: 1px solid rgba(245, 162, 26, 0.42);
}

.fab-chat-actions {
    display: grid;
    gap: 10px;
}

.fab-chat-action-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.fab-chat-action-item:hover {
    border-color: var(--chat-accent);
    background: rgba(var(--chat-accent-rgb), 0.08);
}

.fab-chat-action-item.is-primary {
    border-color: rgba(var(--chat-accent-rgb), 0.35);
    background: rgba(var(--chat-accent-rgb), 0.12);
    color: var(--chat-accent);
}

.fab-chat-action-item.is-danger {
    border-color: rgba(235, 77, 77, 0.35);
    background: rgba(235, 77, 77, 0.1);
    color: #b31d1d;
}

.fab-chat-add-members {
    display: grid;
    gap: 10px;
}

.fab-chat-member-results {
    max-height: 320px;
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-right: 2px;
}

.fab-chat-member-empty {
    font-size: 13px;
    color: var(--text-tertiary);
    padding: 10px;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    text-align: center;
}

.fab-chat-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 9px;
    background: #fff;
}

.fab-chat-member-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.fab-chat-member-photo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9eef7;
}

.fab-chat-member-meta {
    min-width: 0;
}

.fab-chat-member-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.fab-chat-member-course {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.fab-chat-member-add {
    border: 1px solid rgba(var(--chat-accent-rgb), 0.35);
    background: rgba(var(--chat-accent-rgb), 0.12);
    color: var(--chat-accent);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-member-add:hover {
    background: var(--chat-accent);
    color: #fff;
    border-color: var(--chat-accent);
}

.fab-chat-member-add.is-done,
.fab-chat-member-add:disabled {
    opacity: 0.75;
    cursor: default;
}

.fab-chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.fab-chat-empty {
    margin: auto;
    text-align: center;
    color: var(--chat-text-dim);
    font-size: 14px;
    max-width: 280px;
}

.fab-chat-msg {
    display: inline-flex;
    align-items: flex-end;
    gap: 9px;
    width: fit-content;
    max-width: min(79%, 720px);
    align-self: flex-start;
}

.fab-chat-msg.mine {
    margin-left: 0;
    justify-content: flex-end;
    align-self: flex-end;
}

.fab-chat-msg--image {
    max-width: min(260px, 52%);
}

.fab-chat-msg__avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    object-fit: cover;
    border: 1px solid #d2dfef;
    background: #e9eff9;
    flex: 0 0 34px;
}

.fab-chat-msg__avatar--link {
    cursor: pointer;
}

.fab-chat-msg__avatar--link:hover {
    border-color: rgba(var(--chat-accent-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.14);
}

.fab-chat-msg__bubble {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    width: fit-content;
    max-width: 100%;
    background: #fff;
    border: 1px solid #d6e2f2;
    border-radius: 16px 16px 16px 6px;
    padding: 10px 46px 10px 12px;
    box-shadow: 0 8px 16px rgba(13, 26, 43, 0.08);
}

.fab-chat-msg__bubble--image {
    padding-right: 12px;
}

.fab-chat-msg__bubble::after {
    content: '';
    position: absolute;
    left: -7px;
    bottom: 8px;
    width: 10px;
    height: 10px;
    border-bottom-right-radius: 10px;
    background: #fff;
    border-left: 1px solid #d6e2f2;
    border-bottom: 1px solid #d6e2f2;
    transform: rotate(45deg);
}

.fab-chat-msg.mine .fab-chat-msg__bubble {
    background: linear-gradient(135deg, #1f6ce6 0%, #1458cd 100%);
    border: none;
    color: #fff;
    border-radius: 16px 16px 6px 16px;
    box-shadow: 0 10px 18px rgba(var(--chat-accent-rgb), 0.28);
}

.fab-chat-msg.mine .fab-chat-msg__bubble::after {
    left: auto;
    right: -7px;
    border-left: none;
    border-bottom: none;
    border-right: 1px solid rgba(20, 88, 205, 0.65);
    border-top: 1px solid rgba(20, 88, 205, 0.65);
    background: #1458cd;
}

.fab-chat-msg__sender {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1d5fcf;
}

.fab-chat-msg__sender--link {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fab-chat-msg__sender--link:focus-visible {
    outline: 2px solid rgba(var(--chat-accent-rgb), 0.35);
    outline-offset: 2px;
    border-radius: 4px;
}

.fab-chat-msg__actions {
    position: absolute;
    top: 7px;
    right: 7px;
    display: inline-flex;
    gap: 4px;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity .18s ease, transform .18s ease;
}

.fab-chat-msg:hover .fab-chat-msg__actions,
.fab-chat-msg:focus-within .fab-chat-msg__actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.fab-chat-msg__action {
    width: 26px;
    height: 26px;
    border: 1px solid #c7d7ec;
    border-radius: 7px;
    background: #f3f8ff;
    color: #5f7190;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-body.mobile-list-mode {
    grid-template-columns: 1fr;
}

.fab-chat-body.mobile-list-mode .fab-chat-thread {
    display: none;
}

.fab-chat-body.mobile-thread-mode {
    grid-template-columns: 1fr;
}

.fab-chat-body.mobile-thread-mode .fab-chat-list {
    display: none;
}

.fab-chat-msg__action:hover {
    background: #e4efff;
    color: #184c99;
    border-color: #adbfdf;
}

.fab-chat-msg.mine .fab-chat-msg__action {
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.fab-chat-msg__text {
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.fab-chat-msg__time {
    margin-top: 5px;
    font-size: 10px;
    color: #7a8aa2;
    text-align: right;
    font-weight: 600;
}

.fab-chat-msg.mine .fab-chat-msg__time {
    color: rgba(255, 255, 255, 0.72);
}

.fab-chat-msg__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 220px;
    max-height: 180px;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 7px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    cursor: zoom-in;
    transition: transform .16s ease, box-shadow .16s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

.fab-chat-msg__image:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.fab-chat-msg__file {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 9px;
    background: #e9f2ff;
    color: #0f58c6;
    text-decoration: none;
    font-size: 12px;
    border: 1px solid #c9dcf6;
    font-weight: 700;
}

.fab-chat-msg__file-actions {
    margin-top: 7px;
    display: inline-grid;
    grid-template-columns: max-content max-content;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
}

.fab-chat-msg__file-name {
    grid-column: 1 / -1;
    max-width: min(44ch, 100%);
    font-size: 12px;
    font-weight: 700;
    color: #334863;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.fab-chat-msg__file--download {
    background: #e7f7ee;
    border-color: #c3e8d2;
    color: #0b7a3a;
}

.fab-chat-msg.mine .fab-chat-msg__file {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.fab-chat-msg.mine .fab-chat-msg__file--download {
    background: rgba(255, 255, 255, 0.26);
}

.fab-chat-msg.mine .fab-chat-msg__file-name {
    color: rgba(255, 255, 255, 0.9);
}

.fab-chat-image-viewer {
    display: grid;
    gap: 12px;
    justify-items: center;
}

.fab-chat-image-viewer__img {
    display: block;
    max-width: min(88vw, 920px);
    max-height: min(72vh, 760px);
    width: auto;
    height: auto;
    border-radius: 12px;
    border: 1px solid #d6e2f2;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
    background: #fff;
}

.fab-chat-image-viewer__download {
    min-width: 150px;
    justify-content: center;
}

.fab-chat-compose {
    border-top: 1px solid #d7e2f2;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(255, 255, 255, 0.97) 100%);
    padding: 12px 14px 13px;
    backdrop-filter: blur(5px);
}

.fab-chat-attach-preview {
    margin-bottom: 8px;
    border: 1px solid #ccd9ec;
    border-radius: 11px;
    background: #f0f6ff;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.fab-chat-attach-preview button {
    border: none;
    background: transparent;
    color: #145fd0;
    font-weight: 700;
    cursor: pointer;
}

.fab-chat-input {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 9px;
    align-items: end;
    padding: 8px;
    border: 1px solid #d1deef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.fab-chat-attach-btn,
.fab-chat-emoji-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid #d3dff0;
    background: #f8fbff;
    color: #586985;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition);
}

.fab-chat-attach-btn:hover,
.fab-chat-emoji-btn:hover {
    border-color: var(--chat-accent);
    color: var(--chat-accent);
    background: #edf4ff;
}

.fab-chat-input textarea {
    width: 100%;
    min-height: 40px;
    max-height: 110px;
    resize: none;
    border: 1px solid #d3deef;
    border-radius: 12px;
    background: #fcfdff;
    padding: 10px 11px;
    line-height: 1.4;
}

.fab-chat-input textarea:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 4px rgba(var(--chat-accent-rgb), 0.13);
}

.fab-chat-input textarea:disabled {
    background: #f2f4f8;
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.fab-chat-send-btn {
    width: auto;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    border: 1px solid #0c56c8;
    border-color: transparent;
    background: linear-gradient(135deg, #0f66da 0%, #0f56c3 100%);
    color: #fff;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 8px 18px rgba(var(--chat-accent-rgb), 0.28);
}

.fab-chat-send-btn:hover {
    background: linear-gradient(135deg, #1d73e8 0%, #0f5bcf 100%);
}

.fab-chat-send-btn:disabled {
    opacity: .6;
    cursor: wait;
}

.fab-chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
}

.fab-chat-emoji-item {
    border: 1px solid #d4e0f0;
    background: #fff;
    border-radius: 11px;
    min-height: 38px;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.fab-chat-emoji-item:hover {
    border-color: var(--chat-accent);
    background: rgba(var(--chat-accent-rgb), 0.08);
}

@media (max-width: 960px) {
    .fab-chat-panel {
        width: 100%;
        height: min(760px, 95vh);
        border-radius: 20px;
    }

    .fab-chat-toolbar {
        grid-template-columns: 1fr;
    }

    .fab-chat-toolbar__right {
        align-items: flex-start;
    }

    .fab-chat-body {
        grid-template-columns: 1fr;
    }

    .fab-chat-list {
        border-right: none;
        border-bottom: 1px solid #d6e2f2;
        max-height: 250px;
    }

    .fab-chat-back {
        display: inline-flex;
    }

    .fab-chat-msg {
        max-width: 88%;
    }

    .fab-chat-msg--image {
        max-width: min(240px, 64%);
    }

    .fab-chat-body.thread-open .fab-chat-list {
        display: none;
    }
}

@media (max-width: 600px) {
    .fab-chat {
        right: 16px;
        bottom: 16px;
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    .fab-chat-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        padding-bottom: 0;
    }

    .fab-chat-panel {
        width: 100vw;
        height: var(--fab-chat-mobile-height);
        max-height: none;
        border-radius: 0;
        border: none;
        background: linear-gradient(180deg, #f5f9ff 0%, #eef5ff 20%, #f8fbff 100%);
    }

    .fab-chat-top {
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
        border-bottom: 1px solid rgba(23, 66, 140, 0.28);
    }

    .fab-chat-title {
        font-size: 16px;
        letter-spacing: .2px;
    }

    .fab-chat-sub {
        font-size: 12px;
    }

    .fab-chat-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        border: 1px solid rgba(21, 67, 146, 0.22);
        font-size: 20px;
        font-weight: 500;
        line-height: 1;
        flex: 0 0 40px;
        background: #fff;
        color: #0f4aa7;
    }

    .fab-chat-toolbar {
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 9px;
        padding-bottom: 8px;
        position: sticky;
        top: 0;
        z-index: 3;
        gap: 8px;
        background: rgba(247, 251, 255, 0.95);
        border-bottom: 1px solid #dfe8f7;
    }

    .fab-chat-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .fab-chat-toolbar input {
        min-height: 42px;
        border-radius: 13px;
        background: #fff;
    }

    .fab-chat-toolbar__right {
        width: 100%;
        gap: 8px;
    }

    .fab-chat-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .fab-chat-filters::-webkit-scrollbar {
        display: none;
    }

    .fab-chat-filter,
    .fab-chat-action {
        min-height: 35px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .fab-chat-actions-row {
        display: none;
    }

    .fab-chat-overlay.thread-open-mobile .fab-chat-toolbar {
        display: none;
    }

    .fab-chat-list {
        max-height: none;
        height: 100%;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
        background: transparent;
    }

    .fab-chat-msg {
        max-width: 90%;
    }

    .fab-chat-msg--image {
        max-width: min(210px, 78%);
    }

    .fab-chat-msg__image {
        max-width: 190px;
        max-height: 150px;
    }

    .fab-chat-thread-header {
        position: sticky;
        top: 0;
        z-index: 4;
        background: rgba(255, 255, 255, 0.95);
    }

    .fab-chat-messages {
        flex: 1;
        min-height: 0;
        padding: 12px 10px calc(110px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }

    .fab-chat-compose {
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(248, 251, 255, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
        box-shadow: 0 -10px 20px rgba(15, 23, 42, 0.08);
    }

    .fab-chat-msg__actions {
        display: none !important;
    }

    .fab-chat-msg__action {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .fab-chat-conv {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        padding: 11px 10px 11px 12px;
        border-radius: 15px;
        background: #fff;
        border: 1px solid #dce5f5;
        box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
        margin-bottom: 8px;
    }

    .fab-chat-conv__avatar {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .fab-chat-conv__name {
        font-size: 15px;
    }

    .fab-chat-conv__preview {
        margin-top: 3px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.28;
    }

    .fab-chat-conv__time {
        font-size: 12px;
    }

    .fab-chat-conv__type {
        background: #f6f8fd;
        border-color: #d9e3f4;
    }

    .fab-chat-back {
        min-height: 34px;
        padding: 7px 11px;
    }

    .fab-chat-thread-header {
        padding: 10px 11px;
        gap: 8px;
    }

    .fab-chat-thread-avatar {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        flex-basis: 38px;
    }

    .fab-chat-thread-name {
        font-size: 14px;
    }

    .fab-chat-thread-status {
        font-size: 11px;
    }

    .fab-chat-msg__avatar {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        flex-basis: 30px;
    }

    .fab-chat-input {
        grid-template-columns: auto auto 1fr auto;
        gap: 8px;
        padding: 8px;
        border-radius: 14px;
        align-items: center;
    }

    .fab-chat-input textarea {
        min-height: 44px;
        max-height: 124px;
        padding: 11px 12px;
    }

    .fab-chat-attach-btn,
    .fab-chat-emoji-btn {
        width: 36px;
        height: 36px;
    }

    .fab-chat-send-btn {
        min-height: 40px;
        min-width: 84px;
        padding: 0 13px;
        border-radius: 12px;
    }

    .fab-chat-emoji-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {

    /* Right sidebar is visible above 1200px. Below that, we hide it or move it. */
    .sidebar-right {
        display: none;
    }

    .main-content,
    .main-content--full,
    .main-content--wide {
        margin-right: 0 !important;
    }
}

@media (max-width: 900px) {
    :root {
        --navbar-height: 162px;
    }

    .app-layout {
        flex-direction: column;
    }

    /* Bring right sidebar widgets (Avisos/Online) into the scroll on mobile */
    .sidebar-right {
        display: flex;
        position: static;
        width: 100%;
        padding: 0 14px 18px;
        background: transparent;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    #announcementsList {
        max-height: 260px;
    }

    .sidebar-left {
        position: fixed;
        top: 0;
        left: -280px;
        bottom: 0;
        width: 280px;
        z-index: 1001;
        background: var(--bg-secondary);
        transition: transform 0.3s ease;
        border-radius: 0;
        margin: 0;
        box-shadow: var(--shadow-lg);
        display: block;
        /* Overriding display:none */
    }

    .sidebar-left.show {
        transform: translateX(280px);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content,
    .main-content--full,
    .main-content--wide {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
        padding: 18px 14px;
    }

    .chat-layout {
        margin-left: 0;
    }

    .chat-sidebar {
        width: 280px;
    }

    .navbar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "toggle brand actions"
            "search search search"
            "nav nav nav";
        align-items: center;
        row-gap: 6px;
        padding: 8px 10px 8px;
        height: var(--navbar-height);
    }

    .navbar__nav {
        display: flex;
        grid-area: nav;
        width: 100%;
        justify-self: stretch;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex: none;
        padding: 6px 8px;
        border-radius: 16px;
        border: 1px solid rgba(217, 226, 239, 0.65);
        background: rgba(255, 255, 255, 0.66);
        backdrop-filter: blur(10px);
        overflow: hidden;
    }

    .navbar__nav-caption {
        display: inline-flex;
        margin-right: 2px;
    }

    .navbar__nav-links {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 1 1 auto;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 0 2px;
    }

    .navbar__nav-links::-webkit-scrollbar {
        display: none;
    }

    .navbar__nav-tools {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 0 0 auto;
        padding-left: 2px;
    }

    .navbar__toggle {
        grid-area: toggle;
        display: block;
        margin-right: 0;
        padding: 6px;
    }

    .navbar__brand {
        grid-area: brand;
        min-width: 0;
    }

    .navbar__brand img {
        height: 34px !important;
        width: auto;
    }

    .navbar__actions {
        grid-area: actions;
        justify-self: end;
        gap: 6px;
        min-width: 0;
        position: relative;
        z-index: 180;
    }

    .navbar__search {
        grid-area: search;
        max-width: none;
        margin: 0;
        min-width: 0;
        position: relative;
        z-index: 110;
    }

    .navbar__search-results {
        z-index: 120;
        max-height: min(46vh, 320px);
    }

    .navbar__actions .dropdown {
        z-index: 185;
    }

    .navbar__actions .dropdown__menu {
        z-index: 190;
    }

    .navbar__search input {
        height: 38px;
        padding: 8px 12px 8px 34px;
        border-radius: 14px;
    }

    .navbar__search .search-icon {
        left: 12px;
        font-size: 13px;
    }

    .navbar__user span {
        display: none;
    }

    .navbar__user {
        padding: 2px;
        border-radius: 50%;
        background: transparent;
    }

    .navbar__user img {
        width: 32px;
        height: 32px;
    }

    .navbar__nav a {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.82);
    }

    .navbar__nav-tool {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.82);
    }

    .navbar__nav a img {
        height: 17px !important;
    }

    .navbar__nav-icon {
        width: 18px;
        height: 18px;
    }

    .navbar__site-icon {
        width: 18px;
        height: 18px;
        font-size: 16px;
    }

    .navbar__notif {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .top-birthday-strip__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 8px 10px;
    }

    .top-birthday-chip {
        min-width: 190px;
        max-width: 210px;
    }
}

@media (max-width: 700px) {
    :root {
        --navbar-height: 168px;
    }

    .navbar {
        row-gap: 6px;
        padding-bottom: 8px;
    }

    .navbar__search {
        width: 100%;
    }
}

@media (max-width: 600px) {
    :root {
        --navbar-height: 174px;
    }

    .navbar {
        padding-top: calc(8px + env(safe-area-inset-top));
    }

    .navbar__search input {
        height: 40px;
        font-size: 15px;
    }

    .navbar__nav a {
        width: 34px;
        height: 34px;
    }

    .chat-sidebar {
        width: 100%;
    }

    .chat-main {
        display: none;
    }

    .chat-layout.chat-open .chat-sidebar {
        display: none;
    }

    .chat-layout.chat-open .chat-main {
        display: flex;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -60px;
    }

    .profile-avatar {
        width: 120px;
        height: 120px;
    }

    .profile-info__details {
        justify-content: center;
    }

    .profile-actions {
        justify-content: center;
    }

    .groups-grid,
    .projects-grid,
    .courses-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide footer-style right sidebar widgets on phone; open them via the header modal instead. */
@media (max-width: 760px) {
    .sidebar-right {
        display: none !important;
    }
}

/* ============================================================
   DROPDOWN MENU
   ============================================================ */
.dropdown {
    position: relative;
}

.dropdown__menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 50;
}

.dropdown__menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown__item:hover {
    background: var(--bg-hover);
}

.dropdown__divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: .5;
}

.empty-state__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state__text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================================
   PORTFOLIO PAGE (Projects redesign)
   ============================================================ */
.portfolio-hero {
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.portfolio-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, .06);
    border-radius: 50%;
}

.portfolio-hero__content h1 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.portfolio-hero__content p {
    font-size: 15px;
    color: rgba(255, 255, 255, .8);
}

/* Toolbar */
.portfolio-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.portfolio-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.portfolio-views {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portfolio-view-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 18px;
    border: 1px solid transparent;
}

.portfolio-view-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Stats */
.portfolio-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.portfolio-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.portfolio-stat__value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.portfolio-stat__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-tertiary);
}

/* Grid view */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* List view */
.portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portfolio-list .portfolio-card {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.portfolio-list .portfolio-card__image {
    height: 100%;
    min-height: 160px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Card */
.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.portfolio-card__image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-tertiary);
    position: relative;
}

.portfolio-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.portfolio-card:hover .portfolio-card__image img {
    transform: scale(1.05);
}

.portfolio-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    opacity: .3;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
}

.portfolio-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.portfolio-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.portfolio-card__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.portfolio-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.portfolio-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.portfolio-card__author {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.portfolio-card__author:hover {
    color: var(--primary);
}

.portfolio-card__author img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.portfolio-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portfolio-card__time {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-list .portfolio-card {
        grid-template-columns: 1fr;
    }

    .portfolio-list .portfolio-card__image {
        height: 180px;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .portfolio-hero {
        padding: 28px 20px;
    }

    .portfolio-hero__content h1 {
        font-size: 22px;
    }

    .portfolio-stats {
        flex-wrap: wrap;
    }

    .portfolio-stat {
        min-width: calc(50% - 8px);
    }

    .portfolio-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .portfolio-views {
        justify-content: flex-end;
    }
}

/* Card badge */
.portfolio-card__badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* ============================================================
   GALLERY MODAL
   ============================================================ */
.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.gallery-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.gallery-modal {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.gallery-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 2;
    opacity: .7;
    transition: opacity .2s;
}

.gallery-close:hover {
    opacity: 1;
}

.gallery-header {
    color: #fff;
    margin-bottom: 16px;
}

.gallery-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.gallery-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, .7);
}

.gallery-header a {
    color: #4fc3f7;
    text-decoration: none;
}

.gallery-viewer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    min-height: 300px;
    max-height: 60vh;
}

.gallery-viewer img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .15);
    color: #fff;
    border: none;
    font-size: 36px;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 2;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, .3);
}

.gallery-nav--prev {
    left: 12px;
}

.gallery-nav--next {
    right: 12px;
}

.gallery-caption {
    text-align: center;
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    margin: 12px 0;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 56px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .5;
    transition: all .2s;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    opacity: 1;
    border-color: var(--primary);
}

/* ============================================================
   SOCIAL BUTTONS (Profile)
   ============================================================ */
.social-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.social-actions--stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.social-actions--stack .btn {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.1;
    border-radius: 8px;
}

.profile-page .profile-actions .social-actions--stack {
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 5px;
}

.profile-page .profile-actions .social-actions--stack .profile-action-btn {
    width: 150px;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1.1;
}

@media (max-width: 760px) {
    .profile-page .profile-actions {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }

    .profile-page .profile-actions .social-actions--stack {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .profile-page .profile-actions .social-actions--stack .profile-action-btn {
        width: auto;
        min-width: 118px;
        max-width: 46%;
        min-height: 30px;
        padding: 4px 8px;
        font-size: 11px;
    }
}

.social-counters {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.social-counter {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .2s;
}

.social-counter:hover {
    color: var(--primary);
}

.social-counter strong {
    font-weight: 800;
    color: var(--text-primary);
    margin-right: 3px;
}

/* Friend request notification badge */
.friend-requests-badge {
    position: relative;
}

.friend-requests-badge .badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Social list modal */
.social-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.social-user-item:last-child {
    border-bottom: none;
}

.social-user-item img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.social-user-item__info {
    flex: 1;
}

.social-user-item__name {
    font-weight: 600;
    font-size: 14px;
}

.social-user-item__sub {
    font-size: 12px;
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    .gallery-modal {
        width: 95%;
    }

    .gallery-viewer {
        min-height: 200px;
    }
}

/* Gallery contributor chips */
.gallery-contrib-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .1);
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    color: #fff;
    font-size: 13px;
    transition: background .2s;
    position: relative;
}

.gallery-contrib-chip:hover {
    background: rgba(255, 255, 255, .2);
}

.gallery-contrib-chip img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.gallery-contrib-chip small {
    color: rgba(255, 255, 255, .5);
    font-size: 11px;
}

.gallery-contrib-remove {
    background: rgba(255, 0, 0, .5);
    border: none;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    transition: background .2s;
}

.gallery-contrib-remove:hover {
    background: rgba(255, 0, 0, .8);
}

.gallery-contributors {
    text-align: center;
}

.gallery-actions {
    text-align: center;
}

/* ============================================================ 
   NOTIFICATIONS 
   ============================================================ */
.navbar__notif {
    position: relative;
    cursor: pointer;
    font-size: 19px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #d6dfed;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    box-shadow: 0 3px 10px rgba(33, 73, 140, 0.08);
    transition: var(--transition);
}

.navbar__notif:hover {
    transform: translateY(-1px);
    border-color: #b8ccec;
    background: linear-gradient(180deg, #ffffff 0%, #eaf2ff 100%);
}

.navbar__notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
    border: 2px solid var(--bg-primary);
}

.dropdown__menu--right {
    right: 0;
    left: auto;
}

.notif-dropdown {
    width: min(390px, calc(100vw - 24px));
    max-height: 76vh;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #d6e1f3;
    background: linear-gradient(180deg, #fcfdff 0%, #f7faff 100%);
    box-shadow: 0 18px 45px rgba(23, 52, 95, 0.2);
}

.notif-dropdown__header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 14px;
    border-bottom: 1px solid #dce6f6;
    background: rgba(250, 252, 255, 0.96);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notif-dropdown__title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notif-dropdown__title {
    font-size: 14px;
    font-weight: 800;
    color: #1d2f4f;
    letter-spacing: 0.02em;
}

.notif-dropdown__count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid #c6d8f5;
    background: #eaf2ff;
    color: #295ca8;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notif-dropdown__count.is-empty {
    color: #6b7e9f;
    border-color: #d8e0ef;
    background: #f2f5fa;
}

.notif-dropdown__mark-all {
    border: 1px solid #cbd9ef;
    background: #ffffff;
    color: #365f9f;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.notif-dropdown__mark-all:hover {
    border-color: #97b7e7;
    color: #1d4f96;
    background: #edf4ff;
}

.notif-dropdown__list {
    max-height: min(62vh, 480px);
    overflow-y: auto;
    padding: 10px;
}

.notif-state {
    margin: 8px 0;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    border: 1px dashed #ced9ec;
    background: #f8fbff;
}

.notif-state--empty {
    padding: 22px 16px;
}

.notif-state__icon {
    font-size: 22px;
    margin-bottom: 6px;
}

.notif-state__title {
    color: #2a436e;
    font-weight: 700;
    margin-bottom: 5px;
}

.notif-state__text {
    color: #6b7e9f;
    line-height: 1.35;
}

.notif-state--error {
    border-color: #f2c9c9;
    background: #fff7f7;
    color: #a34545;
}

.notif-state--loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notif-state--loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #bfd2ef;
    border-top-color: #2f67c9;
    animation: notifSpin 0.8s linear infinite;
}

@keyframes notifSpin {
    to {
        transform: rotate(360deg);
    }
}

.notif-item {
    position: relative;
    margin-bottom: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d8e2f2;
    border-radius: 12px;
    background: #fff;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(29, 53, 93, 0.06);
}

.notif-item:hover {
    border-color: #a9c1e7;
    background: #f7fbff;
    transform: translateY(-1px);
}

.notif-item--unread {
    border-color: #95b7eb;
    background: linear-gradient(180deg, #f7fbff 0%, #f2f8ff 100%);
}

.notif-item--unread::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #2f6fd8;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(47, 111, 216, 0.14);
}

.notif-item__main {
    min-width: 0;
    flex: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.notif-item__avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.notif-item__img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #d6e0ef;
    background: #eef3fb;
}

.notif-item__icon {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #d9e3f4;
    background: #fff;
    color: #285db2;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notif-item__content {
    min-width: 0;
}

.notif-item__text {
    font-size: 13px;
    line-height: 1.35;
    color: #20365c;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item__meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notif-item__type {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #335f9f;
    background: #edf4ff;
    border: 1px solid #c6d7f2;
    border-radius: 999px;
    padding: 2px 7px;
}

.notif-item__time {
    font-size: 11px;
    color: #6c7f9f;
}

.notif-item__delete {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 1px solid #d8e1ef;
    background: #f7f9fd;
    color: #6f7f99;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.notif-item__delete:hover {
    border-color: #f0c6c6;
    background: #fff2f2;
    color: #cc3d3d;
}

.notif-dropdown-footer {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #dce4f2;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.notif-dropdown-link {
    border: 1px solid #ccd9ed;
    background: #fff;
    color: #335d9b;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.notif-dropdown-link:hover {
    border-color: #9cb9e5;
    background: #eef4ff;
    color: #1f4f96;
}

.notif-dropdown-link--danger {
    border-color: #efcbcb;
    color: #c64747;
    background: #fff7f7;
}

.notif-dropdown-link--danger:hover {
    border-color: #e4a8a8;
    background: #ffecec;
    color: #b13131;
}

@media (max-width: 760px) {
    .notif-dropdown {
        right: -10px;
        width: min(380px, calc(100vw - 14px));
    }
}

/* ============================================================
   ADMIN PANEL - ENHANCED
   ============================================================ */
.admin-page {
    max-width: 100%;
    padding-bottom: 30px;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    padding: 20px;
    margin-bottom: 16px;
    background: linear-gradient(125deg, #f8fbff 0%, #eef5ff 70%, #f2f8ff 100%);
    border: 1px solid #d5e2f7;
    border-radius: 16px;
}

.admin-hero__eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: #2f5ea8;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.admin-hero__title {
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 8px;
}

.admin-hero__description {
    color: var(--text-secondary);
    max-width: 620px;
}

.admin-hero__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 0 16px;
    position: sticky;
    top: calc(var(--header-stack-height) + 12px);
    z-index: 10;
    background: rgba(240, 242, 245, .92);
    backdrop-filter: blur(3px);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.admin-tab {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    white-space: nowrap;
    flex: 0 0 auto;
    cursor: pointer;
    transition: var(--transition);
}

.admin-tab:hover {
    color: var(--text-primary);
    background: #f5f7fb;
}

.admin-tab.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 8px 22px rgba(24, 119, 242, .25);
}

.admin-section {
    margin-bottom: 16px;
    overflow: visible;
}

.admin-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-section__header>div {
    flex: 1 1 320px;
    min-width: 240px;
}

.admin-section__header .btn {
    flex: 0 0 auto;
}

.admin-section__header h3 {
    font-size: 20px;
    font-weight: 800;
}

.admin-section__hint {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.admin-toolbar {
    display: grid;
    grid-template-columns: 1fr 190px 220px auto;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-toolbar__search {
    min-width: 240px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table th {
    white-space: nowrap;
}

.admin-table td {
    vertical-align: middle;
}

.admin-table__empty {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    padding: 26px 12px;
}

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-cell img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.admin-user-cell__name {
    display: block;
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
}

.admin-user-cell__name:hover {
    color: var(--primary);
}

.admin-user-cell__email {
    font-size: 12px;
    color: var(--text-tertiary);
}

.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-announcement-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    background: #fff;
}

.admin-empty-card {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.stat-card {
    text-align: left;
    border-radius: 14px;
    padding: 14px 16px;
}

.stat-card__value {
    font-size: 28px;
    margin-top: 2px;
    margin-bottom: 3px;
}

.stat-card__meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.stat-card--users {
    border-top: 3px solid #1877f2;
}

.stat-card--posts {
    border-top: 3px solid #5b7cfa;
}

.stat-card--messages {
    border-top: 3px solid #0ea5a1;
}

.stat-card--projects {
    border-top: 3px solid #f59e0b;
}

.stat-card--groups {
    border-top: 3px solid #7c3aed;
}

.stat-card--online {
    border-top: 3px solid #16a34a;
}

@media (max-width: 1100px) {
    .admin-toolbar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 780px) {
    .admin-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-hero__title {
        font-size: 24px;
    }

    .admin-hero__actions {
        justify-content: flex-start;
    }

    .admin-toolbar {
        grid-template-columns: 1fr;
    }

    .admin-section__header .btn {
        width: 100%;
    }
}

/* Feed Video Embeds */
.post-video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 12px;
}

.post-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}