/* People Page Specific Styles */

/* -- People page layout ---------------------------------------------
   .people-main-container gets a fixed height so .people-content is
   a truly constrained flex-item that can scroll. min-height:0 on the
   flex-item is the key CSS rule that allows this.
   ------------------------------------------------------------------- */
.people-main-container {
    height: calc(100vh - 80px);
    min-height: unset;
    overflow: hidden;
}

.people-content {
    padding: 0;          /* padding lives on children, NOT the scroll container */
    min-height: 0;       /* allows flex-item to shrink below content size */
    overflow-y: auto;
}

/* Utility Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* -- Sticky filter bar --------------------------------------------- */
.people-sticky-header {
    position: sticky;
    top: 0;              /* sticks at top of .people-content scroll viewport */
    z-index: 105;
    /* no negative margins - padding is on children, not the scroll container */
    background-color: var(--event-background);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
}

/* Single-row: pill tabs + search + sort */
.people-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 2rem;
}

/* Pill tabs - unique class names, no conflict with common.css */
.filter-tabs {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: #B0B0B0;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
    cursor: pointer;
}

.filter-tab:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.filter-tab.active {
    background: var(--event-primary);
    border-color: var(--event-primary);
    color: #1a1a1a;
    font-weight: 600;
}

.people-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.people-select:focus {
    outline: none;
    border-color: var(--event-primary);
    background-color: rgba(255, 255, 255, 0.15);
}

.people-select option {
    background-color: var(--event-background);
    color: #FFFFFF;
}

/* Search inside filter bar - override common.css margin */
.people-filter-bar .header-search {
    flex: 1;
    min-width: 0;
    margin-right: 0;
}

.people-filter-bar .search-input {
    width: 100%;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    color: #888;
    font-size: 0.82rem;
}

.sort-control i {
    color: var(--event-primary);
    font-size: 0.8rem;
}

.sort-control select {
    background: #252525;
    border: 1px solid rgba(255,255,255,0.12);
    color: #E0E0E0;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.sort-control select:hover,
.sort-control select:focus {
    border-color: var(--event-primary);
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.75rem;
    padding: 1.25rem 2rem 2rem; /* replaces the removed .people-content padding */
}

/* Profile Card - vertical card */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    background-color: #252525;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 0;
    box-sizing: border-box;
    width: 100%;
}

.profile-card:hover {
    background-color: #2c2c2c;
    border-color: rgba(201, 169, 110, 0.25);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.profile-image {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.85rem;
    border: 2px solid rgba(201, 169, 110, 0.2);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.profile-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--event-secondary);
    color: #FFFFFF;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    gap: 0;
}

.profile-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 0.35rem;
    line-height: 1.3;
    word-break: break-word;
}

.profile-role {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--event-primary);
    overflow: hidden;
    margin: 0 0 0.2rem;
}

.profile-meta {
    font-size: 0.73rem;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.profile-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
    margin-top: 1rem;
}

.connect-btn {
    flex: 1;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background-color: var(--event-primary);
    border: none;
    border-radius: 6px;
    color: #1A1A1A;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.connect-btn:hover {
    background-color: color-mix(in srgb, var(--event-primary) 82%, #FFFFFF);
}

.bookmark-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.bookmark-btn:hover {
    border-color: var(--event-primary);
    color: var(--event-primary);
}

/* Profile Detail Panel */
.profile-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.profile-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.profile-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90vw;
    height: 100%;
    background-color: var(--event-background);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    z-index: 2001;
}

.profile-panel-overlay.active .profile-panel {
    transform: translateX(0);
}

.panel-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

.panel-close-btn:hover {
    opacity: 0.7;
}

.panel-header {
    padding: 2rem;
    background: linear-gradient(135deg, var(--event-secondary) 0%, #6B5537 100%);
    position: relative;
    overflow: hidden;
}

.panel-header-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.45;
    pointer-events: none;
}

.panel-header > *:not(.panel-header-bg) {
    position: relative;
    z-index: 1;
}

.panel-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.panel-avatar-img {
    width: 100%;
    height: 100%;
}

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

.panel-avatar-img .profile-initials,
.panel-avatar-img .profile-placeholder {
    width: 100%;
    height: 100%;
    font-size: 2.25rem;
}

/* Any Font Awesome icon in drawer avatar circle */
#panelAvatarImg .profile-initials:has(> i),
.panel-avatar-img .profile-initials:has(> i) {
    font-size: 50px !important;
}

#panelAvatarImg .profile-initials > i,
#panelAvatarImg .profile-initials > i::before,
.panel-avatar-img .profile-initials > i,
.panel-avatar-img .profile-initials > i::before {
    font-size: 50px !important;
    line-height: 1 !important;
}

.panel-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.panel-role {
    font-size: 1rem;
    color: #E0E0E0;
    margin-bottom: 0.25rem;
}

.panel-company {
    font-size: 0.9rem;
    color: #D0D0D0;
}

.panel-actions {
    padding: 1.5rem 2rem;
    display: flex;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-action-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.panel-action-btn.primary {
    background-color: var(--event-primary);
    border-color: var(--event-primary);
    color: #1A1A1A;
    font-weight: 600;
}

.panel-action-btn.primary:hover {
    background-color: #E5B885;
}

.panel-action-btn:hover:not(.primary) {
    background-color: rgba(255, 255, 255, 0.15);
}

.panel-action-btn.icon-only {
    flex: 0 0 auto;
    width: 44px;
    padding: 0.75rem;
}

.panel-tabs {
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-tab {
    padding: 1rem 0;
    background: none;
    border: none;
    color: #B0B0B0;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.panel-tab:hover {
    color: #FFFFFF;
}

.panel-tab.active {
    color: var(--event-primary);
    border-bottom-color: var(--event-primary);
}

.panel-tab-content {
    display: none;
}

.panel-tab-content.active {
    display: block;
}

.panel-content {
    padding: 2rem;
}

.panel-all-interests {
    margin-top: 1.5rem;
}

.panel-all-interests h3,
.panel-common-interests h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 0.75rem;
}

.panel-bio {
    font-size: 0.95rem;
    color: #E0E0E0;
    line-height: 1.7;
    margin-bottom: 0;
}

.panel-social {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-social-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin: 0 0 0.85rem;
}

.panel-social-links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.panel-social-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none !important;
    color: #fff !important;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

a.panel-social-row {
    cursor: pointer;
}

a.panel-social-row:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

a.panel-social-row:link,
a.panel-social-row:visited,
a.panel-social-row:active {
    color: #fff !important;
    text-decoration: none !important;
}

.panel-social-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
}

.panel-social-row.linkedin .panel-social-row-icon {
    background: rgba(10, 102, 194, 0.2);
    color: #6eb5e8;
    box-shadow: inset 0 0 0 1px rgba(10, 102, 194, 0.35);
}

.panel-social-row.twitter .panel-social-row-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #e8e8e8;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.panel-social-row.website .panel-social-row-icon {
    background: rgba(95, 214, 141, 0.14);
    color: #6ee89a;
    box-shadow: inset 0 0 0 1px rgba(95, 214, 141, 0.3);
}

.panel-social-row.phone .panel-social-row-icon {
    background: rgba(201, 169, 110, 0.16);
    color: var(--event-primary, #C9A96E);
    box-shadow: inset 0 0 0 1px rgba(201, 169, 110, 0.28);
}

.panel-social-row.location .panel-social-row-icon {
    background: rgba(201, 169, 110, 0.14);
    color: var(--event-primary, #C9A96E);
    box-shadow: inset 0 0 0 1px rgba(201, 169, 110, 0.25);
}

.panel-social-row-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.panel-social-row-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
}

.panel-social-row-value {
    font-size: 0.92rem;
    font-weight: 500;
    color: #f2f2f2;
    line-height: 1.4;
    word-break: break-word;
}

.panel-social-row-arrow {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: #777;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

a.panel-social-row:hover .panel-social-row-arrow {
    opacity: 1;
    color: #aaa;
}

.panel-interests {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-interests-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 0.75rem;
}

.panel-common-interests h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-tag {
    padding: 0.5rem 1rem;
    background-color: rgba(139, 111, 71, 0.3);
    border: 1px solid rgba(139, 111, 71, 0.5);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #E0E0E0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .people-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Show/Hide for mobile */
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .people-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .profile-card {
        padding: 1.5rem 1rem 1.1rem;
    }

    .profile-image {
        width: 60px;
        height: 60px;
        margin-bottom: 0.65rem;
    }

    .profile-initials {
        font-size: 1rem;
    }

    .profile-name {
        font-size: 0.88rem;
    }

    .profile-role {
        font-size: 0.75rem;
    }

    /* Message button slightly narrower */
    .connect-btn {
        font-size: 0.75rem;
        flex: 0 1 auto;
        min-width: 0;
        padding: 0 0.6rem;
    }

    /* Bookmark button wider for easier tapping */
    .bookmark-btn {
        width: 40px;
        height: 34px;
        flex-shrink: 0;
        font-size: 0.85rem;
    }

    /* Prevent iOS zoom on search input focus */
    .people-filter-bar .search-input,
    .search-input {
        font-size: 16px !important;
    }
    
    .people-main-container {
        height: 100dvh;
        overflow: hidden;
    }

    .people-content {
        padding: 0;
        overflow-x: hidden;
    }

    .people-grid {
        padding: 0.75rem 1rem 2rem;
    }

    .people-sticky-header {
        top: 0;
        z-index: 101;
    }

    .people-filter-bar {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .people-filter-bar .header-search {
        flex: 1 1 100%;
        order: 2;
    }

    .people-tabs {
        order: 1;
    }

    .sort-control {
        order: 3;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .people-grid {
        grid-template-columns: 1fr;
    }

    .people-tabs {
        font-size: 0.8rem;
    }

    /* Panel responsive */
    .profile-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .panel-header {
        padding: 1.5rem;
    }

    .profile-panel .panel-close-btn {
        top: 1rem;
        right: 1rem;
        width: 46px;
        height: 46px;
        padding: 0;
        font-size: 1.4rem;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 50%;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    .profile-panel .panel-close-btn:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.55);
    }
    
    .panel-avatar {
        width: 100px;
        height: 100px;
    }

    #panelAvatarImg .profile-initials > i,
    #panelAvatarImg .profile-initials > i::before,
    .panel-avatar-img .profile-initials > i,
    .panel-avatar-img .profile-initials > i::before {
        font-size: 50px !important;
    }
    
    .panel-name {
        font-size: 1.5rem;
    }
    
    .panel-actions {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .panel-action-btn {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 120px;
    }
    
    .panel-action-btn.icon-only {
        flex: 0 0 44px;
    }
    
    .panel-content {
        padding: 1.5rem;
    }

    .panel-tabs {
        gap: 1rem;
        overflow-x: auto;
    }
}

/* Bio truncation */
.bio-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}

.profile-bio {
    cursor: default;
}

/* -- Match bar ---------------------------------------------------------- */

.match-bar {
    margin: 0 0 20px 0;
    padding: 0.6rem 0.75rem;
    background: rgba(201, 169, 110, 0.08);
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 8px;
}

.match-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.match-bar-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--event-primary);
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.match-bar-label i {
    font-size: 0.65rem;
}

.match-bar-pct {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--event-primary);
}

.match-bar-track {
    height: 3px;
    background: rgba(201, 169, 110, 0.15);
    border-radius: 99px;
    overflow: hidden;
}

.match-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--event-secondary), var(--event-primary));
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* Bookmark active state FIX:
   - panel-action-btn and .icon-only.bookmarked selectors were flipped/miswritten
   - .icon-only should be a child of .panel-action-btn, not the reverse
   - keep specificity consistent with markup
   - use :is() for clarity (CSS4, supported by all modern browsers)
*/
.bookmark-btn.bookmarked i,
.panel-action-btn.icon-only.bookmarked i {
    color: var(--event-primary);
}

.bookmark-btn.bookmarked,
.panel-action-btn.icon-only.bookmarked {
    border-color: var(--event-primary);
}

/* -- Direct Message Chat Panel ----------------------------------- */
.chat-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.chat-panel-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100%;
    background: var(--event-background);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1101;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
}

.chat-panel-overlay.active .chat-panel {
    transform: translateX(0);
}

/* Header */
.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #222;
    flex-shrink: 0;
}

.chat-panel-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.chat-panel-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: #333;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--event-primary);
    border: 2px solid rgba(201, 169, 110, 0.3);
}

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

.chat-panel-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.chat-panel-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFFFF;
}

.chat-panel-role {
    font-size: 0.78rem;
    color: #B0B0B0;
}

.chat-panel-close {
    background: none;
    border: none;
    color: #B0B0B0;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.chat-panel-close:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

/* Chat messages area */
#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

#chatMessages::-webkit-scrollbar {
    width: 4px;
}
#chatMessages::-webkit-scrollbar-track { background: transparent; }
#chatMessages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.chat-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.4rem;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    gap: 0.75rem;
    text-align: center;
}

.chat-empty i {
    font-size: 2.2rem;
    opacity: 0.35;
}

.chat-empty p {
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 220px;
}

/* Reuse schedule.css bubble styles (redeclared here so people.css is self-contained) */
.chat-date {
    text-align: center;
    font-size: 0.72rem;
    color: #B0B0B0;
    margin: 1.25rem 0 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.chat-message {
    margin-bottom: 0.75rem;
    max-width: 82%;
}

.chat-message.received {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.85rem 1rem;
    border-radius: 12px 12px 12px 4px;
    align-self: flex-start;
}

.chat-message.sent {
    background-color: rgba(139, 111, 71, 0.3);
    padding: 0.85rem 1rem;
    border-radius: 12px 12px 4px 12px;
    margin-left: auto;
    align-self: flex-end;
}

.chat-message p {
    color: #E0E0E0;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.chat-time {
    font-size: 0.72rem;
    color: #888;
    display: block;
    margin-top: 0.25rem;
}

/* Input bar */
.meeting-chat-input {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.65rem;
    position: sticky;
    bottom: 0;
    background-color: var(--event-background);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--event-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.chat-input::placeholder {
    color: #666;
}

.chat-send-btn {
    padding: 0.7rem 1.2rem;
    background-color: var(--event-primary);
    border: none;
    border-radius: 6px;
    color: #1A1A1A;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background-color: #E5B885;
}

@media (max-width: 768px) {
    .chat-panel {
        width: 100vw;
    }
}

/* -- Compose Modal --------------------------------------------------- */
.compose-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.compose-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.compose-modal {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    transform: translateY(12px);
    transition: transform .2s ease;
    overflow: hidden;
}

.compose-overlay.active .compose-modal {
    transform: translateY(0);
}

.compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #2a2a2a;
}

.compose-header-info {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.compose-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #888;
}

.compose-recipient {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f0f0;
}

.compose-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    padding: .25rem;
    line-height: 1;
    transition: color .15s;
}

.compose-close:hover { color: #f0f0f0; }

.compose-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.compose-textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    background: #141414;
    border: 1px solid #333;
    border-radius: 8px;
    color: #f0f0f0;
    font-size: .9rem;
    line-height: 1.6;
    padding: .8rem 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .15s;
}

.compose-textarea:focus {
    outline: none;
    border-color: var(--event-primary);
}

.compose-textarea::placeholder { color: #555; }

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compose-char-count {
    font-size: .75rem;
    color: #666;
}

.compose-send-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    background: var(--event-primary);
    border: none;
    border-radius: 6px;
    color: #1a1a1a;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, opacity .15s;
}

.compose-send-btn:hover { background: #e5b885; }
.compose-send-btn:disabled { opacity: .55; cursor: not-allowed; }

.compose-disclaimer {
    margin: 0;
    padding: .85rem 1.25rem 1rem;
    font-size: .72rem;
    color: #666;
    line-height: 1.5;
    border-top: 1px solid #2a2a2a;
    display: flex;
    gap: .4rem;
    align-items: flex-start;
}

.compose-disclaimer i { margin-top: .15rem; font-size: .7rem; color: #888; flex-shrink: 0; }

@media (max-width: 600px) {
    .compose-modal {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        margin-bottom: 0;
    }

    .compose-overlay {
        align-items: flex-end;
        padding: 0;
    }
}
