/*
Theme Name: WorkSpace
Theme URI: 
Author: WorkSpace
Author URI: 
Description: A company internal communication platform. Features a live news feed, groups, announcements, events, messaging, file sharing, and notifications.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: workspace
Tags: social, intranet, internal, communication, company
*/

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
    /* Brand Colors */
    --primary: #1877F2;
    --primary-dark: #0d65d9;
    --primary-light: #e7f0fd;
    --accent: #42b883;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #27ae60;

    /* Brand */
    --ws-blue: #003087;
    --ws-gold: #FFB800;

    /* Neutrals */
    /* --bg-body: #f0f2f5; */
    --bg-body: #f1f5ff;
    --bg-white: #ffffff;
    --bg-hover: #f2f2f2;
    --bg-input: #f0f2f5;
    --border: #dddfe2;
    --border-light: #e4e6eb;

    /* Text */
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --text-muted: #8a8d91;
    --text-link: #1877F2;

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-right-width: 280px;

    /* Header */
    --header-height: 56px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: 0.15s ease;
    --transition-md: 0.25s ease;

    /* Typography */
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-md: 16px;
    --font-size-lg: 20px;
    --font-size-xl: 24px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #18191a;
    --bg-white: #242526;
    --bg-hover: #3a3b3c;
    --bg-input: #3a3b3c;
    --border: #3e4042;
    --border-light: #3e4042;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #8a8d91;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
textarea,
select {
    font-family: inherit;
}

ul,
ol {
    list-style: none;
}

/* ============================================
   LAYOUT WRAPPER
   ============================================ */
.wp-site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content-area {
    display: flex;
    padding-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.main-content-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-right-width);
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 8px;
    align-items: start;
}

/* ============================================
   HEADER / NAVIGATION BAR
   ============================================ */
#mobile_nav {
    display: none;
}

#masthead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    padding: 0 16px;
    /* display: grid;
    grid-template-columns: var(--sidebar-width) 1fr auto;
    align-items: center;
    gap: 8px; */
    display: flex;
    align-items: center;
    justify-content: center;

}

.masthead-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 8px;
    align-items: start;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo img {
    height: 36px;
    width: auto;
}

.header-logo .site-name {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--ws-blue);
    white-space: nowrap;
}

.header-logo .site-tagline {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 400;
    display: block;
    line-height: 1;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    gap: 8px;
    max-width: calc(680px - 16px);
    width: 100%;
    border: 1px solid transparent;
    transition: var(--transition);
}

.header-search:focus-within {
    background: var(--bg-white);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.header-search svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.header-search input {
    background: none;
    border: none;
    outline: none;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    width: 100%;
}

.header-search input::placeholder {
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
    flex-shrink: 0;
}

.header-icon-btn:hover {
    background: var(--border);
    text-decoration: none;
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg-white);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.header-avatar:hover {
    border-color: var(--primary);
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    min-width: 220px;
    padding: 8px;
    display: none;
    z-index: 100;
}

.dropdown-menu.is-open {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: var(--transition);
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* Dark mode toggle in dropdown */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    background: var(--bg-hover);
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    transition: var(--transition);
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.toggle-switch.active::after {
    transform: translateX(16px);
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */
#secondary-left {
    width: var(--sidebar-width);
    padding: 8px 8px 8px 0;
    position: sticky;
    top: calc(var(--header-height) + 8px);
    max-height: calc(100vh - var(--header-height) - 16px);
    overflow-y: auto;
    scrollbar-width: none;
}

#secondary-left::-webkit-scrollbar {
    display: none;
}

.sidebar-profile-card {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.sidebar-profile-card:hover {
    text-decoration: none;
}

.sidebar-profile-cover {
    height: 60px;
    background: linear-gradient(135deg, var(--ws-blue, #003087), var(--primary, #1877F2));
    background-size: cover;
    background-position: center;
}

.sidebar-profile-avatar {
    display: flex;
    justify-content: center;
    margin-top: -28px;
    position: relative;
    z-index: 1;
}

.sidebar-profile-avatar img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--bg-white);
}

.sidebar-profile-info {
    text-align: center;
    padding: 8px 16px 16px;
}

.sidebar-profile-card .profile-name {
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.sidebar-profile-card .profile-email {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-card .profile-department {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
}

.sidebar-nav-section {
    /* margin-bottom: 8px; */
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

.test-svg{
    color: green;
}

.sidebar-nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    margin: 12px 0 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.sidebar-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav-item.active svg {
    color: var(--primary);
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.sidebar-nav-item .mdi-sidebar-btn.active {
    fill: var(--primary, #2563eb);
    display: none;
}
.mdi-sidebar-btn.inactive{
    display: flex;
}
.sidebar-nav-item.active .mdi-sidebar-btn.inactive{
    display: none;
}
.sidebar-nav-item.active .mdi-sidebar-btn.active{
    display: flex;
}

.sidebar-nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

/* ============================================
   MAIN FEED AREA
   ============================================ */
#primary {
    padding: 8px 8px;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================
   POST COMPOSER
   ============================================ */
.post-composer {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.composer-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.composer-input {
    flex: 1;
    background: var(--bg-input);
    border: none;
    border-radius: var(--radius-full);
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.composer-input:focus,
.composer-input:hover {
    background: var(--border-light);
}

.composer-input::placeholder {
    color: var(--text-secondary);
}

.composer-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0 8px;
}

.composer-actions {
    display: flex;
    gap: 4px;
    justify-content: space-between;
}

.composer-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    justify-content: center;
}

.composer-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.composer-actions .composer-action-btn:nth-child(1) svg {
    color: #00a93d;
}
.composer-actions .composer-action-btn:nth-child(2) svg {
    color: #2b7efe;
}
.composer-actions .composer-action-btn:nth-child(3) svg {
    color: #ff6900;
}

/* Expanded Composer Modal */
.composer-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.composer-modal.is-open {
    display: flex;
}

.composer-modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.composer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.composer-modal-header h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.modal-close-btn:hover {
    background: var(--border);
}

.composer-modal-body {
    padding: 16px 20px;
}

.composer-modal-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.composer-modal-user img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.composer-modal-user .user-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.audience-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-input);
    border: none;
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.audience-btn:hover {
    background: var(--border);
}

.post-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 18px;
    color: var(--text-primary);
    background: transparent;
    font-family: inherit;
    min-height: 100px;
    line-height: 1.5;
}

.post-textarea::placeholder {
    color: var(--text-muted);
}

.composer-media-preview {
    margin-top: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* Multi-photo preview grid */
.media-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.media-preview-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
    flex-shrink: 0;
}

.media-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-preview-thumb.video-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-secondary);
}

.media-preview-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 10px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-preview-item {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: var(--radius-full);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Tag people popover */
.tag-people-popover {
    margin-top: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

#tag-search-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 10px 14px;
    font-size: var(--font-size-sm);
    outline: none;
    background: transparent;
    color: var(--text-primary);
    box-sizing: border-box;
}

.tag-search-results {
    max-height: 180px;
    overflow-y: auto;
}

.tag-result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.tag-result-row:hover,
.tag-result-row:focus {
    background: var(--bg-hover);
    outline: none;
}

.tag-result-row img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.tag-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    min-height: 0;
}

.tag-selected-chips:empty {
    padding: 0;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-light, #e7f3ff);
    color: var(--primary);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

.tag-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.tag-chip-remove:hover {
    opacity: 1;
}

.toolbar-icon-btn.is-active {
    color: var(--primary);
    background: var(--primary-light, #e7f3ff);
}

/* Feeling popover */
.feeling-popover {
    margin-top: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    padding: 10px;
}

.feeling-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.feeling-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.feeling-option:hover {
    background: var(--bg-hover);
}

/* Persistent tagged-people indicator above toolbar */
.composer-tagged-indicator {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.tag-indicator-with {
    font-weight: 500;
    color: var(--text-muted);
}

.tag-ind-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 10px;
    background: var(--primary-light, #e7f3ff);
    color: var(--primary, #1877f2);
    border-radius: var(--radius-pill, 999px);
    font-size: 13px;
    font-weight: 600;
}

.tag-ind-remove {
    background: none;
    border: none;
    padding: 0 0 0 2px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: var(--primary, #1877f2);
    opacity: .7;
}

.tag-ind-remove:hover {
    opacity: 1;
}

/* Selected feeling chip above toolbar */
.composer-selected-feeling {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--primary-light, #e7f3ff);
    border-radius: var(--radius-full);
    width: fit-content;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary);
}

.composer-selected-feeling button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.composer-selected-feeling button:hover {
    opacity: 1;
}

/* Post feeling display */
.post-feeling {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-left: 4px;
}

/* ============================================
   FEELING / ACTIVITY MODAL (Facebook-style)
   ============================================ */
.feeling-activity-modal {
    margin-top: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-height: 380px;
    display: flex;
    flex-direction: column;
}

.fa-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
}

.fa-modal-back {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fa-modal-back:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fa-modal-header h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.fa-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
}

.fa-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.fa-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.fa-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.fa-modal-search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}

#fa-search-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    box-sizing: border-box;
}

#fa-search-input:focus {
    border-color: var(--primary);
}

.fa-tab-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.fa-tab-content .feeling-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    padding: 6px;
}

.fa-tab-content .feeling-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.fa-tab-content .feeling-option:hover {
    background: var(--bg-hover);
}

.fo-emoji {
    font-size: 20px;
    flex-shrink: 0;
}

.fo-label {
    font-weight: 500;
}

/* Activity categories */
.activity-list {
    padding: 4px 6px;
}

.activity-category {
    margin-bottom: 2px;
}

.activity-cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.activity-cat-header:hover {
    background: var(--bg-hover);
}

.activity-category.open>.activity-cat-header {
    color: var(--primary);
    background: var(--primary-light, #e7f3ff);
}

.activity-sub-items {
    padding-left: 20px;
}

.activity-sub-items .feeling-option {
    padding: 7px 10px;
    font-size: 13px;
}

/* ============================================
   POLL CREATION UI (Composer)
   ============================================ */
.composer-poll-section {
    margin-top: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.poll-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-light);
}

.poll-section-header h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.poll-section-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.poll-section-close:hover {
    color: var(--text-primary);
}

.poll-options-list {
    padding: 8px 12px;
}

.poll-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.poll-option-num {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.poll-option-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    outline: none;
    transition: var(--transition);
}

.poll-option-input:focus {
    border-color: var(--primary);
}

.poll-option-input::placeholder {
    color: var(--text-muted);
}

.poll-option-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0;
    transition: var(--transition);
}

.poll-option-row:hover .poll-option-remove {
    opacity: 1;
}

.poll-option-remove:hover {
    color: var(--danger);
}

.poll-add-option-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 12px 10px;
    padding: 8px 14px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    width: calc(100% - 24px);
    justify-content: center;
}

.poll-add-option-btn:hover {
    background: var(--primary-light, #e7f3ff);
    border-color: var(--primary);
}

/* ============================================
   POLL DISPLAY IN FEED
   ============================================ */
.post-poll {
    padding: 12px 20px;
}

.poll-option-vote {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    cursor: pointer;
    overflow: hidden;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    text-align: left;
    transition: var(--transition);
}

.poll-option-vote:hover {
    border-color: var(--primary);
}

.poll-locked .poll-option-vote {
    cursor: default;
}

.poll-locked .poll-option-vote:hover {
    border-color: var(--border);
}

.poll-locked .poll-option-vote.voted:hover {
    border-color: var(--primary);
}

.poll-option-vote.voted {
    border-color: var(--primary);
    background: var(--primary-light, #e7f3ff);
}

.poll-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--primary-light, #e7f3ff);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    transition: width 0.4s ease;
    z-index: 0;
}

.poll-option-vote.voted .poll-bar {
    background: rgba(24, 119, 242, 0.15);
}

.poll-option-text {
    position: relative;
    z-index: 1;
    flex: 1;
    font-weight: 500;
}

.poll-option-pct {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 10px;
}

.poll-option-vote.voted .poll-option-pct {
    color: var(--primary);
}

.poll-check-icon {
    position: relative;
    z-index: 1;
    color: var(--primary);
    font-weight: 700;
    margin-left: 6px;
    font-size: 14px;
}

.poll-total-votes {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    padding-left: 2px;
    cursor: pointer;
}
.poll-total-votes:hover {
    text-decoration: underline;
    color: var(--text-primary, #111827);
}

.composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--border-light);
}

.composer-toolbar-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.toolbar-icons {
    display: flex;
    gap: 4px;
}

.toolbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
}
.toolbar-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.toolbar-icon-btn:hover svg {
    fill: #1d2a3d;
}



.modal-close-btn svg {
    transition: transform .3s ease-in-out;
}
.modal-close-btn:hover svg {
    fill: #000;
    transform: rotate(360deg);
}




.submit-post-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
}

.submit-post-btn:hover {
    background: var(--primary-dark);
}

.submit-post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   POSTS / FEED CARDS
   ============================================ */
.feed-post {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
    overflow: hidden;
    transition: var(--transition-md);
}

.feed-post:hover {
    box-shadow: var(--shadow-hover);
}


/* ============================================
   GROUP
   ============================================ */
.page-template-header {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 16px;
}

.group-tab-bar {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
    display: flex;
    box-shadow: var(--shadow-card);
}


/* Clickable group cards */
.group-card {
    transition: box-shadow 0.15s, transform 0.1s;
}

.group-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 16px 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.post-meta {
    flex: 1;
}

.post-author {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-primary);
    display: inline-block;
}

.post-author:hover {
    text-decoration: underline;
}

.post-author-secondary {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.post-author-secondary:hover {
    text-decoration: underline;
}

.post-with {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.post-with .tagged-user {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.post-with .tagged-user:hover {
    text-decoration: underline;
}

.post-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.post-location svg {
    width: 12px;
    height: 12px;
}

.post-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.post-time svg {
    width: 12px;
    height: 12px;
}

.post-options-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.post-options-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.post-content {
    padding: 0 16px 12px;
}

.post-content p {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.post-content.large-text p {
    font-size: 24px;
    font-weight: 500;
}

.post-content p:last-child {
    margin-bottom: 0;
}

.post-content a {
    color: var(--primary);
}

/* ── Rich-text formatting (WYSIWYG / Quill output) ──── */
.post-content h1,
.post-content h2,
.post-content h3 {
    font-weight: 700;
    margin: 12px 0 6px;
    color: var(--text-primary);
}

.post-content h1 {
    font-size: 1.75em;
}

.post-content h2 {
    font-size: 1.4em;
}

.post-content h3 {
    font-size: 1.15em;
}

.post-content strong,
.post-content b {
    font-weight: 700;
}

.post-content em,
.post-content i {
    font-style: italic;
}

.post-content u {
    text-decoration: underline;
}

.post-content s,
.post-content del {
    text-decoration: line-through;
}

.post-content ul,
.post-content ol {
    padding-left: 1.5em;
    margin: 8px 0;
}

.post-content ul {
    list-style: disc;
}

.post-content ol {
    list-style: decimal;
}

.post-content li {
    margin-bottom: 4px;
    line-height: 1.6;
}

.post-content blockquote {
    border-left: 3px solid var(--primary);
    margin: 10px 0;
    padding: 8px 14px;
    background: var(--bg-hover, #f5f6f8);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.post-content pre {
    background: #282c34;
    color: #abb2bf;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: block;
}

.post-content code {
    background: rgba(0, 0, 0, .06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.post-content img {
    border-radius: var(--radius-sm);
    margin: 8px 0;
}

/* Quill alignment & indent classes */
.post-content .ql-align-center {
    text-align: center;
}

.post-content .ql-align-right {
    text-align: right;
}

.post-content .ql-align-justify {
    text-align: justify;
}

.post-content .ql-indent-1 {
    padding-left: 3em;
}

.post-content .ql-indent-2 {
    padding-left: 6em;
}

.post-content .ql-indent-3 {
    padding-left: 9em;
}

/* "Edited" badge in feed post-time row */
.feed-edited-badge {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
    cursor: help;
}

.clamp-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clamp-content.expanded {
    -webkit-line-clamp: unset;
}

.post-content .toggle-content {
    color: var(--primary);
    font-weight: 600;
    display: none;
}

.post-content .toggle-content:hover {
    text-decoration: underline;
}

.post-content:has(.clamp-content.has-clamp) .toggle-content {
    display: block;
}

/* ── Rich-text inside announcement cards ─────────────── */
.ann-card-excerpt strong,
.ann-card-excerpt b {
    font-weight: 700;
}

.ann-card-excerpt em,
.ann-card-excerpt i {
    font-style: italic;
}

.ann-card-excerpt u {
    text-decoration: underline;
}

.ann-card-excerpt s,
.ann-card-excerpt del {
    text-decoration: line-through;
}

.ann-card-excerpt ul,
.ann-card-excerpt ol {
    padding-left: 1.5em;
}

.ann-card-excerpt ul {
    list-style: disc;
}

.ann-card-excerpt ol {
    list-style: decimal;
}

.ann-card-excerpt blockquote {
    border-left: 2px solid var(--primary);
    padding-left: 10px;
}

.ann-card-excerpt pre {
    background: #282c34;
    color: #abb2bf;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', monospace;
}

.ann-card-excerpt code {
    background: rgba(0, 0, 0, .06);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
}

[data-theme="dark"] .post-content blockquote {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

[data-theme="dark"] .ann-card-excerpt blockquote {
    border-color: var(--primary);
}

.post-media {
    position: relative;
    overflow: hidden;
    /* background: var(--bg-input); */
}

.post-media img {
    border-radius: var(--radius-sm);
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    margin: 5px 0;
}

/* Standalone video (single video, not inside a grid). object-fit:contain so
   portrait clips don't blow out the post height — the screenshot showed a
   vertical video stretching the entire feed column. */
.post-media > .post-media-video {
    border-radius: var(--radius-sm);
    width: 100%;
    max-height: 500px;
    background: #000;
    display: block;
    object-fit: contain;
    margin: 5px 0;
}

.post-media-grid {
    display: grid;
    gap: 2px;
}

.post-media-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.post-media-grid.grid-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.post-media-grid.grid-3 .media-item:first-child {
    grid-row: 1 / 3;
}

.post-media-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Video inside a multi-item grid: match the cell height used by images. */
.post-media-grid .post-media-video {
    width: 100%;
    height: 200px;
    background: #000;
    object-fit: cover;
    display: block;
}

.post-media-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.media-item {
    position: relative;
    overflow: hidden;
}

.media-item-more img {
    filter: brightness(0.5);
}

.media-more-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    pointer-events: none;
}

.post-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
}

.post-reactions-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
}

.post-reactions-count.is-empty {
    display: none;
}

.post-reactions-count:hover .reaction-total-count {
    text-decoration: underline;
}

.reaction-icons {
    display: flex;
}

.reaction-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-white);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -6px;
    line-height: 1;
}

.reaction-icon:first-child {
    margin-left: 0;
}

.reaction-icon-like {
    background: #e7f3ff;
}

.reaction-icon-love {
    background: #fff0f3;
}

.reaction-icon-haha {
    background: #fffbe6;
}

.reaction-icon-wow {
    background: #fff3e0;
}

.reaction-icon-sad {
    background: #e6f4ff;
}

.reaction-icon-angry {
    background: #fff0e6;
}

/* Reactors tooltip */
.reactors-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 160px;
    max-width: 260px;
    font-size: 12px;
    line-height: 1.8;
    z-index: 20;
    pointer-events: none;
    white-space: nowrap;
}

.reactors-tooltip.is-visible {
    display: block;
}

.reactors-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 14px;
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.82);
}

.reactors-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.post-comments-shares {
    display: flex;
    gap: 12px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.post-comments-shares span {
    cursor: pointer;
}

.post-comments-shares span:hover {
    text-decoration: underline;
}

.post-actions-bar {
    display: flex;
    padding: 4px 12px;
    border-top: 1px solid var(--border-light);
    gap: 4px;
}

.post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.post-action-btn img.ws-icon{
    width: 22px;
    height: 22px;
}

.post-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.post-action-btn.liked {
    color: var(--primary);
}

.post-action-btn.liked svg {
    fill: var(--primary);
}

.post-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Reaction Popup */
.reaction-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: var(--bg-white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    padding: 8px 12px;
    gap: 8px;
    z-index: 10;
}

.reaction-popup.is-open {
    display: flex;
}

/* Invisible bridge fills the 8px gap so mouseleave doesn't fire mid-hover */
.reaction-popup::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.reaction-popup button {
    /* font-size: 28px;
    cursor: pointer;
    transition: transform 0.1s ease;
    border: none;
    background: none;
    line-height: 1; */

    all: unset;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 50%;
    transition: transform .14s ease;
    width: 24px !important;
    height: 24px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-btn:hover {
    transform: scale(1.3) translateY(-4px);
}

/* Like button wrapper */
.like-btn-wrapper {
    position: relative;
    flex: 1;
}

/* ============================================
   COMMENTS SECTION
   ============================================ */
.comments-section {
    padding: 0 16px 12px;
    display: none;
}

.comments-section.is-open {
    display: block;
}

.top-comments-link {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    padding: 4px 0 8px;
    cursor: pointer;
}

.top-comments-link:hover {
    text-decoration: underline;
}

.comment {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.comment-bubble {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    max-width: calc(100% - 40px);
}

.comment-bubble .comment-author {
    color: var(--primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-transform: capitalize;
    display: block;
    margin-bottom: 2px;
}

.comment-bubble p {
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.comment-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    padding-left: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-meta button {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.comment-meta button:hover {
    text-decoration: underline;
}

.comment-meta button.liked {
    color: var(--primary);
}

.comment-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
}

.comment-input-row img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.comment-input-wrapper {
    flex: 1;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
}

.comment-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.comment-input-wrapper input::placeholder {
    color: var(--text-secondary);
}

.comment-submit {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
}

.comment-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.comment-submit svg{
    color: var(--primary);
}

/* ============================================
   RIGHT SIDEBAR
   ============================================ */
#secondary-right {
    width: var(--sidebar-right-width);
    padding: 8px 0 8px 8px;
    position: sticky;
    top: calc(var(--header-height) + 8px);
    max-height: calc(100vh - var(--header-height) - 16px);
    overflow-y: auto;
    scrollbar-width: none;
}

#secondary-right::-webkit-scrollbar {
    display: none;
}

.widget-card {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

.widget-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Online Users */
.online-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.online-user-item:hover {
    padding-left: 4px;
}

.online-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.online-avatar-wrapper img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-white);
}

.online-user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

/* Recent Activity */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.activity-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Suggested Groups */
.suggested-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.suggested-group:last-child {
    border-bottom: none;
}

.group-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.group-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-info {
    flex: 1;
}

.group-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.group-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.join-group-btn {
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.join-group-btn:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   EVENTS WIDGET (IDMCC Calendar)
   ============================================ */
.event-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

.event-item:last-child {
    border-bottom: none;
}

.event-date-badge {
    width: 40px;
    flex-shrink: 0;
    text-align: center;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.event-date-badge .month {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    display: block;
}

.event-date-badge .day {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1.2;
}

.event-info {
    flex: 1;
}

.event-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.event-time {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.event-time svg {
    width: 12px;
    height: 12px;
}

.event-attending {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.rsvp-btn {
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
    display: inline-block;
}

.rsvp-btn:hover {
    background: var(--primary);
    color: white;
}

.rsvp-btn.going {
    background: var(--success);
    color: white;
}

/* ============================================
   LOADING / SKELETON
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-light) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-post {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   INFINITE SCROLL LOADER
   ============================================ */
.feed-loading-spinner {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   NOTIFICATIONS PANEL
   ============================================ */
.notifications-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    width: 360px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.notifications-panel.is-open {
    display: block;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    position: sticky;
    top: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    z-index: 1;
}

.panel-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.panel-header a {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 600;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: var(--primary-light);
}

.notification-item.unread:hover {
    background: #d9e8fc;
}

.notif-avatar {
    position: relative;
    flex-shrink: 0;
}

.notif-avatar img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.notif-type-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.notif-type-icon.like {
    background: #1877F2;
}

.notif-type-icon.comment {
    background: var(--success);
}

.notif-type-icon.event {
    background: var(--danger);
}

.notif-text {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.notif-text strong {
    font-weight: 700;
}

.notif-time {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.notif-dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: var(--radius-full);
    flex-shrink: 0;
    align-self: center;
}

/* ============================================
   FOOTER
   ============================================ */
#colophon {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 16px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-muted {
    color: var(--text-secondary);
}

.font-bold {
    font-weight: 700;
}

.mt-4 {
    margin-top: 4px;
}

.mt-8 {
    margin-top: 8px;
}

.mb-4 {
    margin-bottom: 4px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast {
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    pointer-events: none;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    :root {
        --sidebar-right-width: 240px;
    }

    .main-content-wrapper {
        grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-right-width);
    }
}

@media (max-width: 960px) {
    .main-content-wrapper {
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    #secondary-right {
        display: none;
    }
}

@media (max-width: 640px) {
    :root {
        --sidebar-width: 0px;
        --header-height: 52px;
    }

    #masthead {
        grid-template-columns: auto 1fr auto;
    }

    .main-content-wrapper {
        grid-template-columns: 1fr;
        padding: 0;
    }

    #secondary-left {
        display: none;
    }

    .header-logo .site-tagline {
        display: none;
    }

    .composer-action-btn span {
        display: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    #masthead,
    #secondary-left,
    #secondary-right,
    #colophon {
        display: none;
    }

    .site-content-area {
        padding-top: 0;
    }

    .feed-post {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   LIGHTBOX
   ============================================ */
#ws-lightbox-simple {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ws-lightbox-simple-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

#ws-lightbox-simple-img {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

#ws-lightbox-simple-close,
#ws-lightbox-simple-prev,
#ws-lightbox-simple-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 2;
}

#ws-lightbox-simple-close:hover,
#ws-lightbox-simple-prev:hover,
#ws-lightbox-simple-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

#ws-lightbox-simple-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 22px;
}

#ws-lightbox-simple-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    font-size: 28px;
}

#ws-lightbox-simple-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    font-size: 28px;
}

body.ws-lightbox-open {
    overflow: hidden;
}

/* ============================================================
   EVENTS PAGE — FACEBOOK STYLE
   ============================================================ */

/* Section headings for Upcoming / Current / Past */
.events-section-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

.events-section-heading:first-of-type {
    margin-top: 0;
}

.events-section-empty {
    margin-bottom: 8px;
}

/* Calendar placeholder for events without a cover image */
.event-card-placeholder-cal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.event-card-placeholder-cal .epc-month {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #e53935;
    letter-spacing: 0.5px;
    border: 2px solid var(--border-light);
    border-bottom: none;
    padding: 2px 10px 0;
    border-radius: 4px 4px 0 0;
    line-height: 1.3;
}

.event-card-placeholder-cal .epc-day {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    border-top: none;
    padding: 0 10px 2px;
    border-radius: 0 0 4px 4px;
    line-height: 1.2;
}

/* ── Left nav panel ─────────────────────────────────── */
.events-nav-panel {
    width: 360px;
    min-width: 260px;
    flex-shrink: 0;
    padding: 16px 8px;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    border-right: 1px solid var(--border-light);
    background: var(--bg-white);
    box-sizing: border-box;
}

.events-nav-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    padding: 8px 12px;
    margin: 0 0 12px;
}

.events-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    margin: 0 8px 12px;
}

.events-search-box input {
    background: none;
    border: none;
    outline: none;
    font-size: 13px;
    width: 100%;
    color: var(--text-primary);
}

.events-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.events-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: background var(--transition);
}

.events-nav-link:hover,
.events-nav-link.active {
    background: var(--bg-hover);
}

.events-nav-icon-wrap {
    width: 36px;
    height: 36px;
    background: var(--bg-input);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.create-event-trigger {
    display: block;
    width: calc(100% - 16px);
    margin: 0 8px 16px;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}

.create-event-trigger:hover {
    background: var(--primary-dark);
}

.events-panel-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 4px 12px 12px;
}

.events-categories-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin: 0 0 6px;
}

.events-category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition);
}

.events-category-link:hover,
.events-category-link.active {
    background: var(--bg-hover);
}

.events-cat-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-input);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Content area ───────────────────────────────────── */
.events-content-area {
    flex: 1;
    min-width: 0;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height));
}

.events-discover-header {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 16px;
}

/* Filter tabs */
.events-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.events-filter-tab {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.events-filter-tab.active,
.events-filter-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Event cards grid ───────────────────────────────── */
.events-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

.event-card {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-md), transform var(--transition-md);
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.event-card-img-link {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-input);
    position: relative;
    text-decoration: none;
}

.event-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.event-card:hover .event-card-img {
    transform: scale(1.04);
}

.event-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, var(--primary-light), #e8e8e8);
}

.event-card-more-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
}

.event-card-body {
    padding: 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.event-card-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.event-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-card-title:hover {
    color: var(--primary);
}

.event-card-venue {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-card-counts {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.event-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.event-interested-card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.event-interested-card-btn:hover,
.event-interested-card-btn.is-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.event-share-card-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: background var(--transition);
}

.event-share-card-btn:hover {
    background: var(--bg-hover);
}

/* ── Single event view ──────────────────────────────── */
.single-event-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.single-event-back:hover {
    color: var(--text-primary);
}

.single-event-hero {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    /* overflow must stay visible so the ellipsis dropdown is not clipped */
    overflow: visible;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.single-event-cover-img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.single-event-cover-placeholder {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, var(--primary-light), #e8e8e8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.single-event-info {
    padding: 20px 24px;
}

.single-event-date-range {
    font-size: 14px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 8px;
}

.single-event-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.2;
}

.single-event-venue-info {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.single-event-tabs-row {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 16px;
}

.single-event-tab {
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition);
}

.single-event-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.single-event-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    /* establish stacking context so dropdown sits above siblings */
    overflow: visible;
}

.event-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.event-action-btn:hover {
    background: var(--bg-hover);
}

.event-action-btn.is-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.event-action-btn.going-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}


.event-action-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: background var(--transition);
}

.event-action-icon-btn:hover {
    background: var(--bg-hover);
}

/* Two-column content below hero */
.single-event-content-grid {
    /* display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    align-items: start; */
}

.single-event-details-card,
.single-event-host-card,
.event-description-card,
.single-event-map-card,
.single-event-guests-card {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.single-event-details-card,
.single-event-host-card,
.event-description-card {
    padding: 20px 24px;
}

.single-event-details-card h3,
.single-event-host-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text-primary);
}
.event-detail-wrapper{
    display: flex;
    justify-content: space-between;
}
.event-detail-column{
    padding-right: 50px;
}

.event-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 7px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.event-detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.event-detail-text {
    padding-top: 8px;
    flex: 1;
}

.event-detail-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.event-description-card {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.single-event-map-card {
    overflow: hidden;
}

.single-event-map-img {
    width: 100%;
    height: 180px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-muted);
}

.single-event-map-venue {
    padding: 12px 16px;
}

.single-event-map-venue h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.single-event-map-venue p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.single-event-guests-card {
    padding: 16px;
}

.single-event-guests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.single-event-guests-header h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.single-event-guests-header a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.guests-counts {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}

.guests-count-item {
    text-align: center;
}

.guests-count-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.guests-count-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.guests-avatar-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.guests-avatar-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-white);
}

.single-event-host-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.single-event-host-item img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.single-event-host-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.single-event-host-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Create Event Modal ─────────────────────────────── */
.events-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    overflow-y: auto;
}

.events-modal-box {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: slideDown 0.2s ease;
    padding: 16px 20px;
}

.events-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.events-modal-header h3 {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.events-modal-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition);
}

.events-modal-close:hover {
    background: var(--border);
}

.events-modal-body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.event-cover-zone {
    height: 200px;
    background: var(--bg-input);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-cover-zone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-cover-add-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    z-index: 2;
}

.event-cover-add-btn:hover {
    background: var(--bg-hover);
}





/* ── Group Event List Cards ─────────────────────────────────── */
.ge-event-card {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.ge-event-card.ge-event-past {
    opacity: 0.55;
}

.ge-edit-btn,
.ws-ann-edit-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 2px 10px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    letter-spacing: 2px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.ge-edit-btn:hover,
.ws-ann-edit-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ge-event-image {
    width: 140px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ge-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ge-event-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.ge-event-date-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    text-align: center;
    line-height: 1.1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.ge-badge-month {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ge-badge-day {
    display: block;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.ge-event-details {
    flex: 1;
    min-width: 0;
}

.ge-event-title {
    font-size: 14px;
    font-weight: 700;
}

.ge-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.ge-status-upcoming {
    background: #dcfce7;
    color: #16a34a;
}

.ge-status-past {
    background: var(--bg-input);
    color: var(--text-muted);
}

.ge-event-datetime {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ge-event-location {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ge-event-host {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.ge-event-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 6px 0 0;
}

/* ── Feed Event Card (News Feed rendering) ──────────────────── */
.feed-event-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 0 -4px;
}

.feed-event-cover {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.feed-event-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feed-event-cover-default {
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-event-cover-default::after {
    content: '📅';
    font-size: 48px;
    opacity: 0.6;
}

.feed-event-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    text-align: center;
    line-height: 1.1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.feed-ev-badge-month {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feed-ev-badge-day {
    display: block;
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.feed-event-info {
    padding: 14px 16px;
    background: var(--bg-input);
}

.feed-event-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.feed-event-meta,
.feed-group-meta {
    font-size: 12px;
    font-weight: 500;
    border-radius: 0 0 var(--radius-sm) 0;
    display: flex;
    align-items: center;
    gap: 4px;

    position: absolute;
    top: 0;
    left: 0;
    padding: 5px 10px;
}
.feed-event-meta{
    color: #dbfce7;
    background: #00a93d;
}
.feed-group-meta{
    color: #dbeaff;
    background: #155dff;
}
.feed-event-meta a,
.feed-group-meta a{
    color: #fff;
    font-weight: 700;
}
.feed-event-meta svg,
.feed-group-meta svg{
    width: 18px;
    height: 18px;
}

.feed-event-location {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.feed-event-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 8px 0 0;
    line-height: 1.4;
}

.feed-event-link {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: opacity var(--transition);
}

.feed-event-link:hover {
    opacity: 0.85;
}

.create-event-form {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-host-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.event-host-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.event-host-info {
    flex: 1;
}

.event-host-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.event-host-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.event-form-input,
.event-form-textarea,
.event-form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-body);
    transition: border-color var(--transition);
}

.event-form-input:focus,
.event-form-textarea:focus,
.event-form-select:focus {
    border-color: var(--primary);
}

.event-form-input::placeholder,
.event-form-textarea::placeholder {
    color: var(--text-muted);
}

.event-form-textarea {
    resize: vertical;
    min-height: 90px;
}

.event-form-select {
    appearance: none;
    cursor: pointer;
}

.event-datetime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.event-datetime-grid input,
.event-datetime-grid select {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-white);
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    font-family: var(--font-body);
}

.event-datetime-grid input:focus,
.event-datetime-grid select:focus {
    border-color: var(--primary);
}

.event-end-toggle {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    margin-top: -4px;
}

.create-event-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: not-allowed;
    transition: background var(--transition), color var(--transition);
}

.create-event-submit-btn.ready {
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

.create-event-submit-btn.ready:hover {
    background: var(--primary-dark);
}

/* ── Expandable sections (co-hosts, repeat, settings) ── */
.event-expandable-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.event-expandable-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.event-expandable-toggle:hover {
    background: var(--bg-hover);
}

.event-expandable-icon {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.event-expandable-chevron {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.15s;
}

.event-expandable-section.is-open .event-expandable-chevron {
    transform: rotate(180deg);
}

.event-expandable-panel {
    padding: 0 14px 14px;
}

.event-expandable-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 0;
}

/* Toggle switch */
.event-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.event-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.event-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.event-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.event-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.event-toggle-switch input:checked+.event-toggle-slider {
    background: var(--primary);
}

.event-toggle-switch input:checked+.event-toggle-slider::before {
    transform: translateX(20px);
}

/* ── WYSIWYG Editor (Quill) ────────────────────────────────── */
.ws-wysiwyg-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: visible;
    background: var(--bg-primary, #fff);
}

.ws-wysiwyg-wrap .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 6px 8px;
    background: var(--bg-secondary, #f8f9fb);
}

.ws-wysiwyg-wrap .ql-container.ql-snow {
    border: none;
    font-size: 14px;
    font-family: inherit;
}

.ws-wysiwyg-wrap .ql-editor {
    min-height: 120px;
    max-height: 280px;
    overflow-y: auto;
    padding: 12px 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.ws-wysiwyg-wrap .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
    font-size: 14px;
}

.ws-wysiwyg-wrap .ql-snow .ql-stroke {
    stroke: var(--text-secondary);
}

.ws-wysiwyg-wrap .ql-snow .ql-fill {
    fill: var(--text-secondary);
}

.ws-wysiwyg-wrap .ql-snow .ql-picker {
    color: var(--text-secondary);
}

.ws-wysiwyg-wrap .ql-snow button:hover .ql-stroke,
.ws-wysiwyg-wrap .ql-snow .ql-picker-label:hover .ql-stroke {
    stroke: var(--primary);
}

.ws-wysiwyg-wrap .ql-snow button:hover .ql-fill {
    fill: var(--primary);
}

.ws-wysiwyg-wrap .ql-snow button.ql-active .ql-stroke {
    stroke: var(--primary);
}

.ws-wysiwyg-wrap .ql-snow button.ql-active .ql-fill {
    fill: var(--primary);
}

.ws-wysiwyg-wrap .ql-snow .ql-picker-label {
    border-color: transparent;
}

.ws-wysiwyg-wrap .ql-snow .ql-toolbar button {
    width: 26px;
    height: 26px;
    padding: 3px;
}

.ql-code-block {
    color: #733e0a;
    background: #fefbe8;
    border-radius: 3px;
    border: 1px solid #eee;
    padding: 5px 10px;
}


/* Quill dark mode */
[data-theme="dark"] .ws-wysiwyg-wrap {
    border-color: var(--border);
}

[data-theme="dark"] .ws-wysiwyg-wrap .ql-toolbar.ql-snow {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .ws-wysiwyg-wrap .ql-editor {
    color: var(--text-primary);
}

[data-theme="dark"] .ws-wysiwyg-wrap .ql-snow .ql-picker-options {
    background: var(--bg-primary);
    border-color: var(--border);
}

/* ── Co-hosts Autocomplete ─────────────────────────────────── */
.ws-cohosts-wrap {
    position: relative;
}

.ws-cohosts-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.ws-cohosts-selected:empty {
    margin-bottom: 0;
}

.ws-cohost-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary, #f0f2f5);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 4px 10px 4px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.ws-cohost-tag img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.ws-cohost-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
}

.ws-cohost-remove:hover {
    color: var(--error, #e53935);
}

.ws-cohosts-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    outline: none;
}

.ws-cohosts-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .12);
}

.ws-cohosts-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.ws-cohosts-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background .12s;
}

.ws-cohosts-option:hover {
    background: var(--bg-hover, #f0f2f5);
}

.ws-cohosts-option img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.ws-cohosts-no-results {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Event modal footer layout */
.ws-event-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

/* Empty state */
.events-empty-state {
    text-align: center;
    padding: 60px 32px;
    color: var(--text-secondary);
}

.events-empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.events-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 800px) {
    .single-event-content-grid {
        grid-template-columns: 1fr;
    }

    .events-card-grid {
        grid-template-columns: 1fr;
    }

    .single-event-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .event-datetime-grid {
        grid-template-columns: 1fr 1fr;
    }

    .event-datetime-grid select:last-child {
        grid-column: 1 / -1;
    }
}

/* ── Event Discussion Tab ───────────────────────────────────── */
.event-discussion-wrap {
    padding: 16px 0;
}

.event-discussion-heading {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.ws-card-post {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.ws-card-post:last-of-type {
    border-bottom: none;
}

.ws-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ws-card-body {
    flex: 1;
    min-width: 0;
}

.ws-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}



.ws-card-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.ws-card-time {
    font-size: 12px;
    color: var(--text-muted);
}

.ws-card-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.ws-card-content p {
    margin: 0 0 8px;
}

.ws-card-content p:last-child {
    margin-bottom: 0;
}

/* Edit composer (contenteditable) — same paragraph rhythm as rendered post */
.ws-card-edit-input p,
.ws-card-reply-input p {
    margin: 0 0 8px;
}

.ws-card-edit-input p:last-child,
.ws-card-reply-input p:last-child {
    margin-bottom: 0;
}

.ws-card-empty {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.ws-card-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.ws-card-compose-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ws-card-compose-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ws-card-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: vertical;
    color: var(--text-primary);
    background: var(--bg-white);
    box-sizing: border-box;
}

.ws-card-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.ws-card-submit {
    align-self: flex-end;
    padding: 7px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ws-card-submit:hover {
    background: var(--primary-dark);
}

/* ── Event More / Ellipsis Dropdown ────────────────────────── */
.event-more-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 170px;
    z-index: 9999;
    padding: 4px 0;
}

.event-more-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
}

.event-more-item:hover {
    background: var(--bg-hover);
}

.event-more-item--danger {
    color: var(--danger);
}

.event-more-item--muted {
    color: var(--text-muted);
    cursor: default;
}

.event-more-item--muted:hover {
    background: none;
}

/* ── Invite Modal ───────────────────────────────────────────── */
.invite-user-list {
    max-height: 340px;
    overflow-y: auto;
}

.invite-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.invite-user-row:last-child {
    border-bottom: none;
}

.invite-user-row img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.invite-user-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.invite-send-btn {
    padding: 5px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.invite-send-btn:hover {
    background: var(--primary-dark);
}

.invite-send-btn.invited {
    background: var(--accent);
    cursor: default;
}

.invite-already-label {
    font-size: 12px;
    color: var(--text-muted);
    padding: 5px 10px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* ── Admin: Inline Add Event Category ───────────────────────── */
.event-add-cat-wrap {
    margin-top: -4px;
}

.event-add-cat-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    line-height: 1.5;
}

.event-add-cat-toggle:hover {
    text-decoration: underline;
}

.event-add-cat-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.event-add-cat-row .event-form-input {
    flex: 1;
    margin: 0;
}

/* Emoji trigger button */
.event-emoji-trigger {
    width: 48px;
    height: 42px;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, background .15s;
}

.event-emoji-trigger:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

[data-theme="dark"] .event-emoji-trigger {
    background: var(--bg-card);
    border-color: var(--border-dark, var(--border-light));
}

/* Emoji picker popup */
.event-emoji-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 32px);
    gap: 2px;
    z-index: 9999;
    width: 280px;
}

.event-emoji-opt {
    width: 32px;
    height: 32px;
    font-size: 20px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
    line-height: 1;
}

.event-emoji-opt:hover {
    background: var(--bg-hover);
}

[data-theme="dark"] .event-emoji-picker {
    background: var(--bg-card);
    border-color: var(--border-dark, var(--border-light));
}

.event-add-cat-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.event-add-cat-btn:hover {
    background: var(--primary-dark, var(--primary));
}

.event-add-cat-btn:disabled {
    opacity: .6;
    cursor: default;
}

[data-theme="dark"] .event-add-cat-toggle {
    color: var(--primary-light, var(--primary));
}

/* ══════════════════════════════════════════════════════════════
   FEED WIDGETS: Events & People You May Know
   ══════════════════════════════════════════════════════════════ */

/* Shared widget card wrapper */
.feed-widget-card {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    padding: 16px 20px 20px;
    margin-bottom: 16px;
}

.feed-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.feed-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.feed-widget-see-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.feed-widget-see-all:hover {
    text-decoration: underline;
}

.feed-widget-more-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.feed-widget-more-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ── Feed Events ─────────────────────────────────────────────── */
.feed-events-scroll-wrap {
    position: relative;
}

.feed-events-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.feed-events-scroll::-webkit-scrollbar {
    display: none;
}

.feed-event-card {
    flex: 0 0 calc(50% - 6px);
    min-width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.feed-event-thumb {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: var(--bg-hover);
    flex-shrink: 0;
}

.feed-event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feed-event-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, var(--ws-blue, #1877f2), var(--primary));
}

.feed-event-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.feed-event-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .3px;
}

.feed-event-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-event-title:hover {
    text-decoration: underline;
}

.feed-event-location {
    font-size: 12px;
    color: var(--text-secondary);
}

.feed-event-counts {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.feed-event-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.feed-event-rsvp-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.feed-event-rsvp-btn:hover {
    background: var(--bg-hover);
}

.feed-event-rsvp-btn.active {
    background: var(--primary-light, #e8f0fe);
    border-color: var(--primary);
    color: var(--primary);
}

.feed-event-share-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.feed-event-share-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* Scroll nav arrows */
.feed-events-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: var(--text-secondary);
    transition: background .15s;
}

.feed-events-nav:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.feed-events-prev {
    left: -14px;
}

.feed-events-next {
    right: -14px;
}

/* ── People You May Know ─────────────────────────────────────── */
.feed-people-scroll-wrap {
    position: relative;
}

.feed-people-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.feed-people-scroll::-webkit-scrollbar {
    display: none;
}

.feed-person-card {
    flex: 0 0 160px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.feed-person-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, .12);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.feed-person-dismiss:hover {
    background: rgba(0, 0, 0, .22);
}

.feed-person-photo-link {
    display: block;
}

.feed-person-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.feed-person-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.feed-person-name:hover {
    text-decoration: underline;
}

.feed-person-role {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    margin-top: -2px;
}

.feed-person-mutual {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.feed-person-mutual-avatars {
    display: flex;
}

.feed-person-mutual-avatars img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--bg-white);
    margin-left: -4px;
    object-fit: cover;
}

.feed-person-mutual-avatars img:first-child {
    margin-left: 0;
}

.feed-person-add-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    margin-top: auto;
}

.feed-person-add-btn:hover {
    background: var(--primary-light, #e8f0fe);
    border-color: var(--primary);
    color: var(--primary);
}

.feed-person-add-btn.sent {
    background: var(--bg-hover);
    color: var(--text-muted);
    border-color: var(--border-light);
    cursor: default;
}

.feed-person-add-btn:disabled {
    opacity: .6;
    cursor: default;
}

/* Nav arrow */
.feed-people-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: var(--text-secondary);
    transition: background .15s;
}

.feed-people-nav:hover {
    background: var(--bg-hover);
}

.feed-people-prev {
    left: -14px;
}

.feed-people-next {
    right: -14px;
}

/* Dark mode */
[data-theme="dark"] .feed-widget-card,
[data-theme="dark"] .feed-event-card,
[data-theme="dark"] .feed-person-card {
    background: var(--bg-card);
    border-color: var(--border-dark, var(--border-light));
}

[data-theme="dark"] .feed-event-rsvp-btn,
[data-theme="dark"] .feed-event-share-btn,
[data-theme="dark"] .feed-person-add-btn,
[data-theme="dark"] .feed-events-nav,
[data-theme="dark"] .feed-people-nav {
    background: var(--bg-card);
    border-color: var(--border-dark, var(--border-light));
}

/* ============================================================
   ANNOUNCEMENTS PAGE
   ============================================================ */

/* Page wrapper */
.ann-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

/* ── Hero banner ─────────────────────────────────────────── */
.ann-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #1877f2 0%, #0e5dbe 100%);
    border-radius: var(--radius-sm);
    padding: 28px 32px;
    margin-bottom: 20px;
    color: #fff;
}

.ann-hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ann-hero-icon {
    font-size: 42px;
    line-height: 1;
    flex-shrink: 0;
}

.ann-hero-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
}

.ann-hero-sub {
    font-size: 14px;
    margin: 0;
    opacity: .85;
    color: #fff;
}

.ann-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .5);
    border-radius: var(--radius-pill, 999px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}

.ann-create-btn:hover {
    background: rgba(255, 255, 255, .3);
    border-color: rgba(255, 255, 255, .8);
}

/* ── Filter bar ──────────────────────────────────────────── */
.ann-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ann-filter-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.ann-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: var(--radius-pill, 999px);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.ann-filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ann-filter-tab.active {
    background: var(--primary-light, #e8f0fe);
    color: var(--primary, #1877f2);
    font-weight: 600;
}

.ann-total-count {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Announcement list ───────────────────────────────────── */
.ann-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Card ────────────────────────────────────────────────── */
.ann-card {
    display: flex;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}

.ann-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.ann-card.is-pinned {
    border-color: var(--primary, #1877f2);
}

/* Colored left accent bar */
.ann-card-priority-bar {
    width: 5px;
    flex-shrink: 0;
    background: var(--priority-color, #1877f2);
    border-radius: 0;
}

.ann-card-inner {
    flex: 1;
    padding: 18px 20px;
    min-width: 0;
}

/* Card top: badges + more menu */
.ann-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.ann-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ann-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill, 999px);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.ann-badge-pinned {
    background: #fff8e1;
    color: #b45309;
}

/* More menu (···) */
.ann-card-more-wrap {
    position: relative;
    flex-shrink: 0;
}

.ann-card-more-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background .15s;
}

.ann-card-more-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ann-card-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}

.ann-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}

.ann-dropdown-item:hover {
    background: var(--bg-hover);
}

.ann-dropdown-danger {
    color: #e53e3e;
}

.ann-dropdown-danger:hover {
    background: #fff5f5;
}

/* Author row */
.ann-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ann-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ann-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ann-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ann-author-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Card body: text + optional cover image */
.ann-card-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.ann-card-text {
    flex: 1;
    min-width: 0;
}

.ann-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
}

.ann-card-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.ann-card-title a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.ann-card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ann-card-cover-link {
    flex-shrink: 0;
}

.ann-card-cover-img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
}

/* Card footer */
.ann-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-lighter, var(--border-light));
    flex-wrap: wrap;
}

.ann-card-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ann-footer-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #1877f2);
    text-decoration: none;
    transition: gap .15s;
}

.ann-footer-read-more:hover {
    gap: 8px;
}

.ann-card-footer-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ann-footer-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.ann-footer-meta-item:hover {
    color: var(--text-secondary);
}

/* Empty state */
.ann-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.ann-empty-icon {
    font-size: 52px;
    margin-bottom: 16px;
}

.ann-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.ann-empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px;
}

.ann-empty-state .ann-create-btn {
    background: var(--primary, #1877f2);
    color: #fff;
    border-color: var(--primary, #1877f2);
    padding: 10px 22px;
}

.ann-empty-state .ann-create-btn:hover {
    background: var(--primary-dark, #1255c0);
}

/* ── Create Announcement Modal ───────────────────────────── */
.ann-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.ann-modal {
    background: var(--bg-white);
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .04);
    display: flex;
    flex-direction: column;
    animation: annModalIn .2s ease-out;
}

@keyframes annModalIn {
    from {
        opacity: 0;
        transform: scale(.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ann-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.ann-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.ann-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s, transform .15s;
    flex-shrink: 0;
}

.ann-modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Author preview inside modal */
.ann-modal-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
}

.ann-modal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
}

.ann-modal-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ann-modal-author-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Form body — uses .ws-ann-form class from reusable component */
.ws-ann-form {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Priority selector */
.ann-priority-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ann-priority-option {
    display: flex;
}

.ann-priority-option input[type="radio"] {
    display: none;
}

.ann-priority-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 18px;
    border-radius: var(--radius-pill, 999px);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border-light);
    background: var(--bg-white);
    color: var(--text-secondary);
    transition: all .2s ease;
    user-select: none;
}

.ann-priority-pill:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.ann-priority-option input:checked+.ann-priority-pill {
    background: var(--p-bg, #e7f0fd);
    color: var(--p-color, #1877f2);
    border-color: var(--p-color, #1877f2);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-color, #1877f2) 12%, transparent);
}

/* Text inputs */
.ann-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input, var(--bg-white));
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

.ann-form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .1);
}

.ann-title-input {
    font-size: 17px;
    font-weight: 600;
}

.ann-title-input::placeholder {
    font-weight: 400;
    color: var(--text-muted);
}

.ann-form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input, var(--bg-white));
    outline: none;
    resize: vertical;
    min-height: 110px;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

.ann-form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .1);
}

/* WYSIWYG inside announcement modal */
.ws-ann-modal .ws-wysiwyg-wrap {
    border-radius: 10px;
    border-color: var(--border-light);
}

.ws-ann-modal .ws-wysiwyg-wrap .ql-toolbar.ql-snow {
    border-radius: 10px 10px 0 0;
    background: var(--bg-hover, #f5f6f8);
    padding: 8px 10px;
}

.ws-ann-modal .ws-wysiwyg-wrap .ql-editor {
    min-height: 130px;
    max-height: 260px;
}

/* Cover image upload zone */
.ann-cover-zone {
    border: 2px dashed var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover, #f8f9fb);
}

.ann-cover-zone:hover {
    border-color: var(--primary);
    background: rgba(24, 119, 242, .05);
}

.ann-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 22px;
    color: var(--text-muted);
    pointer-events: none;
}

.ann-cover-placeholder span {
    font-size: 13px;
}

.ann-cover-zone img[data-role="cover-preview"] {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Pin checkbox row */
.ann-pin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-hover, #f8f9fb);
    transition: background .15s;
}

.ann-pin-row:hover {
    background: var(--border-light);
}

.ann-pin-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Error message */
.ann-form-error {
    background: #fff0f0;
    color: #c53030;
    border: 1px solid #feb2b2;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
}

/* Modal footer */
.ann-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
    padding-top: 16px;
}

.ann-modal-cancel {
    padding: 10px 22px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.ann-modal-cancel:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.ann-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: var(--primary, #1877f2);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s, box-shadow .15s, transform .1s;
}

.ann-submit-btn:hover:not(:disabled) {
    background: var(--primary-dark, #1255c0);
    box-shadow: 0 4px 12px rgba(24, 119, 242, .3);
}

.ann-submit-btn:active:not(:disabled) {
    transform: scale(.97);
}

.ann-submit-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ── Dark mode ───────────────────────────────────────────── */
[data-theme="dark"] .ann-hero {
    background: linear-gradient(135deg, #1255c0 0%, #0a3d87 100%);
}

[data-theme="dark"] .ann-filter-bar,
[data-theme="dark"] .ann-card,
[data-theme="dark"] .ann-empty-state,
[data-theme="dark"] .ann-modal {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-modal-header {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-card-dropdown {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .ann-dropdown-item:hover {
    background: var(--bg-hover);
}

[data-theme="dark"] .ann-dropdown-danger:hover {
    background: rgba(229, 62, 62, .15);
}

[data-theme="dark"] .ann-form-input,
[data-theme="dark"] .ann-form-textarea {
    background: var(--bg-input, #2a2a3a);
    border-color: var(--border-dark, #3a3a4a);
    color: var(--text-primary);
}

[data-theme="dark"] .ann-cover-zone {
    background: var(--bg-input, #2a2a3a);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-cover-zone:hover {
    background: rgba(24, 119, 242, .12);
}

[data-theme="dark"] .ann-priority-pill {
    background: var(--bg-hover);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-form-error {
    background: rgba(197, 48, 48, .15);
    border-color: #e53e3e;
    color: #fc8181;
}

[data-theme="dark"] .ann-card-footer {
    border-top-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-pin-row {
    background: var(--bg-input, #2a2a3a);
}

[data-theme="dark"] .ann-modal-footer {
    border-top-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-ann-modal .ws-wysiwyg-wrap {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-ann-modal .ws-wysiwyg-wrap .ql-toolbar.ql-snow {
    background: var(--bg-input, #2a2a3a);
    border-color: var(--border-dark, #3a3a4a);
}

/* ── Announcement View Modal ─────────────────────────────── */
.ann-view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.ann-view-modal {
    background: var(--bg-white);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .04);
    animation: annModalIn .2s ease-out;
}

.ann-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
}

.ann-view-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ann-view-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    line-height: 1.5;
}

.ann-view-pinned {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}

.ann-view-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.ann-view-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.ann-view-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: annSpin .6s linear infinite;
}

@keyframes annSpin {
    to {
        transform: rotate(360deg);
    }
}

.ann-view-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ann-view-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
}

.ann-view-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ann-view-author-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.ann-view-cover {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.ann-view-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.ann-view-content {
    line-height: 1.7;
}

.ann-view-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.ann-view-permalink-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.ann-view-permalink-link:hover {
    text-decoration: underline;
}

/* Dark mode */
[data-theme="dark"] .ann-view-modal {
    background: var(--bg-card, #242526);
}

[data-theme="dark"] .ann-view-header {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-view-footer {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ann-view-pinned {
    background: rgba(254, 243, 199, .15);
    color: #fcd34d;
}

[data-theme="dark"] .ann-view-spinner {
    border-color: var(--border-dark);
    border-top-color: var(--primary);
}

/* ============================================================
   GROUP ANNOUNCEMENT CARDS
   ============================================================ */
.ws-ann-card {
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary);
    transition: box-shadow .15s;
}

.ws-ann-card:hover {
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .08));
}

.ws-ann-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ws-ann-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.6;
}

.ws-ann-badge--pinned {
    background: #fef3c7;
    color: #92400e;
}

.ws-ann-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ws-ann-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.ws-ann-author-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.ws-ann-author-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.ws-ann-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.ws-ann-content {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
}

.ws-ann-cover-img {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    max-height: 300px;
    object-fit: cover;
}

[data-theme="dark"] .ws-ann-card {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-ann-badge--pinned {
    background: rgba(254, 243, 199, .15);
    color: #fcd34d;
}

/* ============================================================
   FEED — ANNOUNCEMENT HIGHLIGHTING
   ============================================================ */

/* Highlighted announcement feed post */
.feed-post.is-announcement {
    border-left: none;
    position: relative;
    overflow: visible;
}

/* Left colored accent bar */
.feed-post-ann-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--priority-color, #1877f2);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    pointer-events: none;
}

/* Strip between accent bar and post header */
.feed-post-ann-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;

    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.feed-post-ann-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.feed-ann-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.feed-ann-badge-pinned {
    background: #fff8e1;
    color: #b45309;
}

/* Pin button inside announcement strip / widget */
.feed-ann-pin-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 4px;
    border: 1.5px solid var(--border-light);
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
}

.feed-ann-pin-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.feed-ann-pin-btn.is-pinned {
    background: #fff8e1;
    color: #b45309;
    border-color: #fcd34d;
}

.feed-ann-pin-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Indent post-header slightly when accent bar present */
.feed-post.is-announcement .post-header,
.feed-post.is-announcement .post-content,
.feed-post.is-announcement .post-media,
.feed-post.is-announcement .post-stats,
.feed-post.is-announcement .post-actions-bar,
.feed-post.is-announcement .comments-section {

    margin-left: 5px;
}

/* ============================================================
   FEED — ANNOUNCEMENTS WIDGET
   ============================================================ */

#feed-announcements-widget .feed-ann-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 0 8px;
}

/* Individual announcement item */
.feed-ann-item {
    display: flex;
    align-items: stretch;
    position: relative;
    transition: background .12s;
}

.feed-ann-item:not(:last-child) {
    border-bottom: 1px solid var(--border-lighter, var(--border-light));
}

.feed-ann-item:hover {
    background: var(--bg-hover);
}

/* Left colored accent */
.feed-ann-item-accent {
    width: 4px;
    flex-shrink: 0;
    background: var(--priority-color, #1877f2);
    border-radius: 0;
    margin: 4px 0;
}

/* Item body */
.feed-ann-item-body {
    flex: 1;
    padding: 12px 16px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.feed-ann-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.feed-ann-item-badges {
    display: flex;
    align-items: center;
    gap: 5px;
}

.feed-ann-item-icon {
    font-size: 14px;
    line-height: 1;
}

.feed-ann-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-ann-item-title:hover {
    color: var(--primary);
    text-decoration: underline;
}

.feed-ann-item-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.feed-ann-item-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-ann-item-dot {
    opacity: .5;
}

/* Pin button compact in widget */
#feed-announcements-widget .feed-ann-pin-btn {
    padding: 3px 8px;
    font-size: 11px;
}

/* Pinned item background tint */
.feed-ann-item.is-pinned {
    background: #fffdf0;
}

.feed-ann-item.is-pinned:hover {
    background: #fff8d6;
}

/* ── Dark mode ───────────────────────────────────────────── */
[data-theme="dark"] .feed-post-ann-accent {
    opacity: .9;
}

[data-theme="dark"] .feed-ann-badge-pinned {
    background: rgba(252, 211, 77, .15);
    color: #fcd34d;
}

[data-theme="dark"] .feed-ann-pin-btn.is-pinned {
    background: rgba(252, 211, 77, .12);
    color: #fcd34d;
    border-color: rgba(252, 211, 77, .4);
}

[data-theme="dark"] .feed-ann-item.is-pinned,
[data-theme="dark"] .feed-ann-item.is-pinned:hover {
    background: rgba(252, 211, 77, .06);
}

[data-theme="dark"] #feed-announcements-widget .feed-ann-list {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .feed-ann-item:not(:last-child) {
    border-bottom-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .feed-ann-item:hover {
    background: var(--bg-hover);
}

.template-header-icon{
    width: 50px;
    height: 50px;
    background: #1877F225;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
}


/* ============================================================
   MEMBERS PAGE
   ============================================================ */
.members-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

/* Hero */
.members-hero,
.ann-hero-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #1877f2 0%, #0e5dbe 100%);
    border-radius: var(--radius-sm);
    padding: 24px 28px;
    margin-bottom: 20px;
    color: #fff;
}

.members-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.members-hero-icon {
    font-size: 50px;
    line-height: 1;
    flex-shrink: 0;
    background: #ffffff25;
    border-radius: var(--radius-sm);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.members-hero-icon svg,
.ann-hero-icon svg{
    width: 40px;
    height: 40px;
}

.members-hero-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
}

.members-hero-sub {
    font-size: 13px;
    margin: 0;
    opacity: .85;
    color: #fff;
}

/* Search */
.members-search-form {
    flex-shrink: 0;
}

.members-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .2);
    border: 1.5px solid rgba(255, 255, 255, .4);
    border-radius: var(--radius-pill, 999px);
    padding: 8px 14px;
    min-width: 220px;
}

.members-search-wrap svg {
    color: rgba(255, 255, 255, .8);
    flex-shrink: 0;
}

.members-search-input {
    background: none;
    border: none;
    outline: none;
    font-size: 13px;
    color: #fff;
    width: 100%;
}

.members-search-input::placeholder {
    color: rgba(255, 255, 255, .65);
}

.members-search-clear {
    color: rgba(255, 255, 255, .7);
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}

.members-search-clear:hover {
    color: #fff;
}

/* Filter bar */
.members-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.members-filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.members-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: var(--radius-pill, 999px);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.members-filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.members-filter-tab.active {
    background: var(--primary-light, #e8f0fe);
    color: var(--primary);
    font-weight: 600;
}

.members-total-count {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

/* Member card */
.member-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 24px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}

.member-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.member-card-avatar-link {
    display: block;
    margin-bottom: 12px;
}

.member-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-body);
}

.member-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.3;
}

.member-card-name:hover {
    color: var(--primary);
}

.member-card-role {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light, #e8f0fe);
    border-radius: var(--radius-pill, 999px);
    padding: 2px 10px;
    margin-bottom: 8px;
}

.member-card-bio {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.member-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: auto;
}

.member-conn-btn,
.member-msg-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border-light);
    transition: background .15s, border-color .15s, color .15s;
}

.member-conn-btn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.member-conn-btn.is-connected {
    background: var(--danger);
    color: var(--primary-light);
    border-color: var(--danger);
    cursor: pointer;
}

.member-conn-btn.is-pending {
    background: var(--bg-hover);
    color: var(--text-muted);
    border-color: var(--border-light);
    cursor: default;
}

.member-msg-btn {
    background: var(--bg-white);
    color: var(--text-secondary);
}

.member-msg-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.member-msg-btn:disabled,
.member-conn-btn:disabled {
    opacity: .7;
}

/* Empty & Pagination */
.members-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.members-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.members-empty h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}

.members-empty p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.members-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.members-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    transition: background .15s;
}

.members-page-btn:hover,
.members-page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Dark mode */
[data-theme="dark"] .members-filter-bar,
[data-theme="dark"] .member-card {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .members-search-wrap {
    background: rgba(255, 255, 255, .1);
}

[data-theme="dark"] .member-msg-btn {
    background: var(--bg-card);
}

/* ============================================================
   MESSAGES PAGE
   ============================================================ */
.messages-page {
    padding: 0 !important;
    max-width: 100% !important;
}

.messages-layout {
    display: flex;
    height: calc(100vh - 60px);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 16px 0;
}

/* ── Sidebar ── */
.msg-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
}

.msg-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 12px;
}

.msg-sidebar-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 0;
    padding: 4px 6px;
    margin: 0 0 0 -6px;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: background .12s;
}

.msg-sidebar-user:hover {
    background: var(--bg-hover);
}

.msg-sidebar-username {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.1;
}

.msg-sidebar-caret {
    margin-left: 2px;
    color: var(--text-primary);
}

.msg-new-btn {
    background: none;
    border: 0;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background .12s, color .12s;
}

.msg-new-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.msg-folder-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 18px 8px;
}

.msg-folder-tab {
    background: none;
    border: 0;
    padding: 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .12s;
}

.msg-folder-tab.is-active {
    color: var(--text-primary);
}

.msg-folder-tab.msg-folder-requests {
    font-size: 14px;
    font-weight: 600;
}

.msg-folder-tab.msg-folder-requests.is-active {
    color: var(--primary);
}

.msg-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input, #f0f2f5);
    border-radius: var(--radius-pill, 999px);
    padding: 8px 12px;
    margin: 8px 12px;
}

.msg-search-wrap svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.msg-search-input {
    background: none;
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
}

.conv-list {
    overflow-y: auto;
    flex: 1;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 5px!important;
    cursor: pointer;
    position: relative;
    transition: background .12s;
}

.conv-item:hover {
    background: var(--bg-hover);
}

.conv-item.active {
    background: var(--primary-light, #e8f0fe);
}

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 2px;
}

.conv-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.conv-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.conv-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: baseline;
    gap: 0;
}

.conv-preview-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.conv-preview-time {
    flex-shrink: 0;
    color: var(--text-muted);
}

.unread-badge {
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-pill, 999px);
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
}

.conv-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.msg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

/* ── Thread ── */
.msg-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative; /* anchors the absolutely-positioned Details panel */
}

.msg-thread-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.msg-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.msg-empty-icon {
    font-size: 52px;
    margin-bottom: 16px;
}

.msg-empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.msg-empty-state p {
    font-size: 14px;
    text-align: center;
    max-width: 280px;
    margin: 0 0 20px;
}

.msg-new-btn-cta {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.msg-new-btn-cta:hover {
    background: var(--primary-dark, #1255c0);
}

/* Thread header */
.msg-thread-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    flex-shrink: 0;
}

.msg-thread-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    padding: 4px 6px;
    margin-left: -6px;
    border-radius: var(--radius-sm);
    transition: background .12s;
}

.msg-thread-identity:hover {
    background: var(--bg-hover);
}

.msg-thread-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.msg-thread-action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    transition: background .12s, color .12s;
}

.msg-thread-action:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* Profile-card empty state (when an opened conversation has no messages) */
.msg-profile-card {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    background: var(--bg-body, #fff);
}

.msg-profile-card-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--border-light);
}

.msg-profile-card-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.msg-profile-card-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.msg-profile-card-btn {
    margin-top: 8px;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-input, #f0f2f5);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .12s;
}

.msg-profile-card-btn:hover {
    background: var(--border-light);
}

/* Collapsed sidebar mode (thread takes full width) */
.messages-layout.msg-collapsed .msg-sidebar {
    display: none;
}

.msg-back-btn {
    display: none;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background .15s;
    flex-shrink: 0;
}

.msg-back-btn:hover {
    background: var(--bg-hover);
}

.msg-thread-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input, #efefef);
    overflow: hidden;
    flex-shrink: 0;
}

/* Generic-user fallback (shown when the <img src> is empty/broken).
   Inline SVG via mask so it tints to currentColor. */
.msg-thread-avatar-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--text-muted, #9aa0a6);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 12a5 5 0 100-10 5 5 0 000 10zm0 2c-4 0-9 2-9 6v2h18v-2c0-4-5-6-9-6z'/></svg>") center/70% no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 12a5 5 0 100-10 5 5 0 000 10zm0 2c-4 0-9 2-9 6v2h18v-2c0-4-5-6-9-6z'/></svg>") center/70% no-repeat;
    pointer-events: none;
}

.msg-thread-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--bg-input, #efefef);
}

/* When the img has no usable src, hide it so the ::before fallback shows */
.msg-thread-avatar:not([src]),
.msg-thread-avatar[src=""],
.msg-thread-avatar[src="#"] {
    visibility: hidden;
}

/* conv-list & profile-card avatars: gray fallback with a generic-user SVG
   shown via background-image. When the <img> has a real src it overlays
   the fallback; when src is empty the background shows through. */
.conv-avatar,
.msg-profile-card-avatar {
    background-color: var(--bg-input, #efefef);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239aa0a6'><path d='M12 12a5 5 0 100-10 5 5 0 000 10zm0 2c-4 0-9 2-9 6v2h18v-2c0-4-5-6-9-6z'/></svg>");
    background-size: 65%;
    background-position: center;
    background-repeat: no-repeat;
}

/* ════════════════════════════════════════════════════════════════════════
   MESSAGE HOVER TOOLBAR + REACTIONS + REPLY + MORE POPUP
   ════════════════════════════════════════════════════════════════════════ */

/* The bubble + toolbar live in one row so the toolbar floats next to it. */
.msg-bubble-row {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.msg-bubble-wrap.is-mine .msg-bubble-row {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.msg-hover-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity .12s;
    pointer-events: none;
}
.msg-bubble-wrap:hover .msg-hover-toolbar,
.msg-hover-toolbar:focus-within {
    opacity: 1;
    pointer-events: auto;
}
.msg-tool-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.msg-tool-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
/* React button shows the user's reaction glyph when active (instead of the
   default smiley SVG). The glyph is rendered via `<img class="ws-emoji">` for
   shortcode-named emoji, or as a Unicode character. */
.msg-tool-btn.js-msg-react.is-reacted {
    background: rgba(24, 119, 242, 0.12);
}
.msg-tool-react-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 18px;
}
.msg-tool-react-glyph img.ws-emoji,
.msg-tool-react-glyph .ws-emoji {
    width: 18px;
    height: 18px;
    display: block;
}
/* When the emoji-picker auto-converter (or our fast-path) renders a native
   Unicode glyph inside the React button, render it at button size. */
.msg-tool-react-glyph .ws-emoji-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

/* Reactions row (chips below the bubble) */
.msg-react-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.msg-bubble-wrap.is-mine .msg-react-row {
    justify-content: flex-end;
    position: relative;
}
.msg-react-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    margin-top: -12px;
    border-radius: 999px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
    z-index: 1;

}
.msg-react-chip span{
    font-size: 12px!important;
}
.msg-react-chip:hover { background: var(--bg-hover); }
.msg-react-chip img.ws-emoji { width: 14px; height: 14px; vertical-align: -2px; }
.msg-react-count { color: var(--text-secondary); font-weight: 600; }

/* Reply quote bar (above a bubble that's a reply) */
.msg-reply-quote {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px 14px;
    margin-bottom: -10px;
    /* border-left: 3px solid var(--border); */
    border-left: 3px solid #B9DA65;
    /* background: var(--bg-input); */
    background: #D7F291;
    border-radius: 4px 4px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    max-width: 280px;
    align-self: flex-start;
}
.msg-bubble-wrap.is-mine .msg-reply-quote { align-self: flex-end; }
.msg-reply-quote-author { font-weight: 600; color: var(--text-primary); }
.msg-reply-quote-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reply preview above the composer */
.msg-reply-preview {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-input);
    font-size: 13px;
}
.msg-reply-preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.msg-reply-preview-label { color: var(--text-secondary); }
.msg-reply-preview-author { color: var(--primary); font-weight: 600; }
.msg-reply-preview-text {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-reply-preview-cancel {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: var(--bg-white);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* More popup (Forward / Copy / Pin) — absolutely positioned */
.msg-more-popup {
    position: absolute;
    z-index: 9000;
    display: none;
    flex-direction: column;
    min-width: 200px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 8px;
}
.msg-more-time {
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 4px;
}
.msg-more-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.msg-more-item:hover { background: var(--bg-hover); }
.msg-more-item svg { color: var(--text-secondary); }

/* Forward modal */
.msg-forward-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.msg-forward-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.msg-forward-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}
.msg-forward-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.msg-forward-close {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
}
.msg-forward-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.msg-forward-list {
    overflow-y: auto;
    padding: 8px;
}
.msg-forward-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    text-align: left;
}
.msg-forward-row:hover { background: var(--bg-hover); }
.msg-forward-row .conv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Quick reaction picker fallback (when WSEmojiPicker isn't available) */
.msg-quick-react {
    position: absolute;
    z-index: 9001;
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    background: var(--bg-white);
    border-radius: 999px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.msg-quick-react-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    border-radius: 50%;
}
.msg-quick-react-btn:hover { background: var(--bg-hover); transform: scale(1.15); }
.msg-quick-react-btn img.ws-emoji { width: 22px; height: 22px; }

/* Pinned bubble visual cue */
.msg-bubble-wrap.is-pinned::before {
    content: '📌';
    font-size: 12px;
    margin-right: 4px;
}

/* Hide the old inline time-ago span (now shown in More popup) */
.msg-time { display: none; }

/* ════════════════════════════════════════════════════════════════════════
   USER STATUS DOTS + STATUS DROPDOWN
   Six states: online / away / break / meeting / dnd / offline
   ════════════════════════════════════════════════════════════════════════ */
.msg-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted, #9aa0a6);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--bg-white);
}
.msg-status-dot.status-online  { background: #22c55e; }
.msg-status-dot.status-away    { background: #facc15; }
.msg-status-dot.status-break   { background: #f97316; }
.msg-status-dot.status-meeting { background: #ef4444; }
.msg-status-dot.status-dnd     { background: #dc2626; box-shadow: 0 0 0 2px var(--bg-white), inset 0 0 0 2px #fff; }
.msg-status-dot.status-offline { background: #9aa0a6; }
.msg-status-dot.status-custom  { background: var(--primary); }  /* purple — matches the custom-status pill */

/* My own status badge above #msg-sidebar-user — shown for break/meeting/dnd/custom only */
.msg-sidebar-user-wrap { position: relative; }
.msg-sidebar-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    margin-bottom: 5px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-secondary);
    background: var(--bg-input, #efefef);
    width: max-content;
}
.msg-sidebar-status-badge-emoji { font-size: 13px; line-height: 1; flex-shrink: 0; }
.msg-sidebar-status-badge-text  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-sidebar-status-badge.status-dnd,
.msg-sidebar-status-badge.status-meeting { color: #b91c1c; background: #fee2e2; }
.msg-sidebar-status-badge.status-break   { color: #b45309; background: #fef3c7; }
.msg-sidebar-status-badge.status-custom  { color: #6d28d9; background: #ede9fe; }

/* ════════════════════════════════════════════════════════════════════════
   LINK PREVIEW — pending card above composer + inline card on bubbles
   ════════════════════════════════════════════════════════════════════════ */
/* Container — JS toggles its `display`. One card per detected URL inside. */
.msg-pending-linkpreviews {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 0 16px;
    margin: 0 0 8px;
}

/* Individual preview card — always visible when its parent container is */
.msg-pending-linkpreview {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    background: var(--bg-input, #f0f2f5);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 13px;
    position: relative;
}
.msg-pending-linkpreview-img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background-color: var(--bg-white);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.msg-pending-linkpreview-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.msg-pending-linkpreview-host {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.msg-pending-linkpreview-title {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
            line-clamp: 2;
    -webkit-box-orient: vertical;
}
.msg-pending-linkpreview-desc {
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
            line-clamp: 2;
    -webkit-box-orient: vertical;
}
.msg-pending-linkpreview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: var(--bg-white);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.msg-pending-linkpreview-remove:hover { background: var(--danger, #e23b3b); color: #fff; }

/* Inline link-preview card rendered inside a sent/received message bubble */
.msg-bubble-linkpreview {
    display: flex;
    margin-top: 6px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    max-width: 320px;
}
.msg-bubble-linkpreview:hover { filter: brightness(.98); }
.msg-bubble-linkpreview-img {
    flex: 0 0 96px;
    background-color: var(--bg-input, #efefef);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.msg-bubble-linkpreview-body {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.msg-bubble-linkpreview-host {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.msg-bubble-linkpreview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
            line-clamp: 2;
    -webkit-box-orient: vertical;
}
.msg-bubble-linkpreview-desc {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
            line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Message-Request "Accept" button (shown on .conv-item.is_request rows) */
.conv-accept-btn {
    padding: 6px 14px;
    margin-right: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--primary, #1877f2);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.conv-accept-btn:hover { filter: brightness(.95); }
.conv-accept-btn:disabled { opacity: .55; cursor: default; }

/* Pending-count chip on the Requests folder tab */
.msg-folder-tab[data-folder="requests"].has-pending::after {
    content: attr(data-count);
    display: inline-block;
    min-width: 16px;
    height: 16px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary, #1877f2);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
}

/* Status dot positioned on the bottom-right of a conv-list avatar */
.conv-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.conv-avatar-status {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--bg-white);
    background: #9aa0a6;
}
.conv-avatar-status.status-online  { background: #22c55e; }
.conv-avatar-status.status-away    { background: #facc15; }
.conv-avatar-status.status-break   { background: #f97316; }
.conv-avatar-status.status-meeting { background: #ef4444; }
.conv-avatar-status.status-dnd     { background: #dc2626; }
.conv-avatar-status.status-offline { background: transparent; border-color: transparent; }
.conv-avatar-status.status-custom  { background: var(--primary); }

/* ──────────────────────────────────────────────────────────────────────
   DATE DIVIDER inside #messages-area
   Instagram-style centered timestamp inserted whenever the message-day
   changes (or above the very first message). Kept small + dim so it
   doesn't compete with the message bubbles.
   ────────────────────────────────────────────────────────────────────── */
.msg-date-divider {
    align-self: center;
    margin: 14px 0 6px;
    width: 100%;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted, #9aa0a6);
    text-align: center;
    letter-spacing: .02em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 20px;
}
.msg-date-divider:before,
.msg-date-divider:after{
    content: "";
    flex: 1;
    height: 1px;
    border-bottom: 1px dashed #dddddd35;
}

/* Sidebar user button + status dropdown */
.msg-sidebar-user-wrap {
    position: relative;
}
.msg-sidebar-user-info{
    display: flex;
    flex-direction: column;
}
.msg-sidebar-user .msg-status-dot {
    margin-right: 4px;
    box-shadow: none;
    width: 12px;
    height: 12px;
}
.msg-status-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 9500;
    min-width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 8px;
    display: none;
}
.msg-status-menu.is-open { display: block; }
.msg-status-menu-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 6px 10px 8px;
}
.msg-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}
.msg-status-item:hover { background: var(--bg-hover); }
.msg-status-item.is-current { font-weight: 700; }
.msg-status-item .msg-status-dot { box-shadow: none; }

/* ════════════════════════════════════════════════════════════════════════
   CONV-ITEM enhancements: 99+ unread, mute, more menu
   ════════════════════════════════════════════════════════════════════════ */
.unread-badge {
    min-width: 20px;
    padding: 0 6px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-radius: 999px;
    flex-shrink: 0;
}

.conv-mute-icon {
    margin-left: 6px;
    color: var(--text-muted);
    flex-shrink: 0;
    vertical-align: middle;
}

.conv-item.is-muted .conv-name,
.conv-item.is-muted .conv-preview-text {
    color: var(--text-muted);
}

/* Three-dot "more" button on each conv row — visible on hover */
.conv-item-more {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 4px;
    opacity: 0;
    transition: opacity .12s, background .12s;
    flex-shrink: 0;
    z-index: 10;
}
.conv-item:hover .conv-item-more { opacity: 1; }
.conv-item-more:hover { background: var(--bg-white); color: var(--text-primary); }

.conv-more-menu {
    position: absolute;
    z-index: 9600;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    min-width: 140px;
}
.conv-more-item {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}
.conv-more-item:hover { background: var(--bg-hover); }

/* Pointer-events fix: clicks on SVG icons inside buttons resolve to the
   button, so `e.target.closest('.msg-tool-btn')` always succeeds. */
.msg-tool-btn svg,
.msg-icon-btn svg,
.msg-send-btn svg,
.msg-thread-action svg,
.conv-item-more svg,
.msg-new-btn svg,
.msg-sidebar-user svg,
.msg-folder-tab svg { pointer-events: none; }

/* ════════════════════════════════════════════════════════════════════════
   STATUS EMOJI + CUSTOM-STATUS MODAL
   ════════════════════════════════════════════════════════════════════════ */

/* Status menu — emoji glyph in front of every item, label, then preset dot */
.msg-status-item .msg-status-emoji {
    width: 20px;
    text-align: center;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}
.msg-status-item .msg-status-label { flex: 1; }
.msg-status-menu-sep {
    height: 1px;
    background: var(--border-light);
    margin: 6px 4px;
}

/* Status emoji shown on each conv-list row (left of the More button) */
.conv-item-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

/* Custom-status modal */
.msg-custom-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.msg-custom-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.msg-custom-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}
.msg-custom-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.msg-custom-close {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease-in-out;
}
.msg-custom-close:hover { 
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(360deg);
}
.msg-custom-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}
.msg-custom-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.msg-custom-input-row {
    display: flex;
    gap: 8px;
}
.msg-custom-icon-input {
    width: 56px;
    text-align: center;
    font-size: 22px;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-white);
}

/* Emoji-picker button + popover for the custom-status icon */
.msg-custom-input-row { position: relative; }
.msg-custom-icon-btn {
    width: 56px;
    height: 46px;
    text-align: center;
    font-size: 22px;
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-white);
    cursor: pointer;
    line-height: 1;
}
.msg-custom-icon-btn:hover { background: var(--bg-hover); }

.msg-emoji-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10000;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    width: 320px;
    max-height: 260px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
.msg-emoji-pick {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}
.msg-emoji-pick:hover { background: var(--bg-hover); transform: scale(1.15); }

/* Status badge moved into .conv-info — appears above the name */
.conv-item-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 2px;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    background: var(--bg-input, #efefef);
    color: var(--text-secondary);
    align-self: flex-start;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Single span now carries both the glyph and the label */
.conv-item-status-emoji {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}
.conv-item-status-emoji img.ws-emoji {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.conv-item-status-text {
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Custom-status colors — purple pill so it's distinguishable from presets */
.conv-item-status.status-custom {
    color: #6d28d9;
    background: #ede9fe;
}

/* Curated emoji popover for the custom-status icon button */
.msg-emoji-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10001;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    width: 296px;
    max-height: 240px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
.msg-emoji-pick {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}
.msg-emoji-pick:hover { background: var(--bg-hover); transform: scale(1.15); }

/* ── Online friends section (rendered below the conv list) ───────────── */
.conv-online-section {
    border-top: 1px solid var(--border-light);
    padding: 12px 8px 16px;
}
.conv-online-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 6px 10px 8px;
}
.conv-online-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    color: inherit;
}
.conv-online-row:hover { background: var(--bg-hover); }
.conv-online-row .conv-avatar {
    width: 44px;
    height: 44px;
}
.conv-online-row .conv-info { gap: 2px; }
.conv-online-row .conv-name {
    font-size: 14px;
    font-weight: 600;
}

.conv-item-status.status-dnd,
.conv-item-status.status-meeting { color: #b91c1c; background: #fee2e2; }
.conv-item-status.status-break   { color: #b45309; background: #fef3c7; }
.conv-item-status.status-away    { color: #92400e; background: #fef9c3; }
.conv-item-status.status-online  { color: #15803d; background: #dcfce7; }
.msg-custom-text-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-white);
}
.msg-custom-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-white);
}
.msg-custom-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
}
.msg-custom-cancel,
.msg-custom-save {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.msg-custom-save {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.msg-custom-save:hover { filter: brightness(.95); }

/* Online folder tab — same style as Requests but with a green pip */
.msg-folder-online {
    font-size: 14px;
    font-weight: 600;
}
.msg-folder-online::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 6px;
    vertical-align: middle;
}
.msg-folder-online.is-active { color: var(--primary); }

/* ════════════════════════════════════════════════════════════════════════
   READ RECEIPT + TYPING INDICATOR
   ════════════════════════════════════════════════════════════════════════ */
.msg-read-receipt {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 8px;
    margin-top: -4px;
}
.msg-read-receipt-check {
    color: var(--primary);
    font-weight: 700;
}

.msg-typing-bubble {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    align-self: flex-start;
    padding: 0 4px;
}
.msg-typing-bubble .msg-sender-avatar {
    width: 28px;
    height: 28px;
}
.msg-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-input, #efefef);
    padding: 10px 14px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}
.msg-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted, #9aa0a6);
    opacity: .35;
    animation: ws-typing 1.2s infinite ease-in-out;
}
.msg-typing-dots span:nth-child(2) { animation-delay: .15s; }
.msg-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ws-typing {
    0%, 80%, 100% { transform: scale(.7); opacity: .35; }
    40%           { transform: scale(1);  opacity: 1; }
}

.msg-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--bg-white);
}

.msg-thread-info {
    flex: 1;
    min-width: 0;
}

.msg-thread-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-thread-status {
    font-size: 12px;
    color: var(--text-muted);
}

/* Messages area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-body, #f0f2f5);
}

.msg-day-label {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px;
}

.msg-bubble-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 75%;
}

.msg-bubble-wrap.is-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-bubble-wrap.is-theirs {
    align-self: flex-start;
}

.msg-sender-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.msg-bubble-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.msg-sender-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 4px;
}

.msg-bubble {
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    max-width: 100%;
}

.msg-bubble-wrap.is-mine .msg-bubble {
    /* background: var(--primary); */
    background: #00A887;
    color: #fff;
    border-bottom-right-radius: 3px;

    
}
.msg-bubble-wrap.is-mine .msg-bubble:after{
    content: " ";
    position: absolute;
    top: 50%;
    left: 100%;
    /* To the right of the tooltip */
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #00A887;
}

.msg-bubble-wrap.is-theirs .msg-bubble {
    background: var(--bg-white);
    color: var(--text-primary);
    border-bottom-left-radius: 3px;
    box-shadow: var(--shadow-sm);
}
.msg-bubble-wrap.is-theirs .msg-bubble:after{
    content: " ";
    position: absolute;
    top: 50%;
    right: 100%;
    /* To the left of the tooltip */
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent #E0F9F3 transparent transparent;
}

.msg-time {
    font-size: 10px;
    color: var(--text-muted);
    padding: 0 4px;
    align-self: flex-end;
}

/* Input bar */
.msg-input-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
    flex-shrink: 0;
}

.msg-input-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.msg-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px 16px;
}

.msg-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    /* Textarea behaviour: 1-row default, JS grows it to scrollHeight up to 160px */
    resize: none;
    line-height: 1.4;
    min-height: 20px;
    max-height: 160px;
    padding: 0;
    overflow-y: auto;
    display: block;
}

/* The input wrap holds an auto-growing textarea — align center so the
   first line sits next to the icon buttons, and let the wrap expand
   vertically as the textarea grows. */
.msg-input-wrap { align-items: center; }

.msg-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 0;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .12s, color .12s;
}

.msg-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.msg-icon-btn input[type="file"] { display: none; }

.msg-attach-btn {
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    transition: color .15s;
}

.msg-attach-btn:hover {
    color: var(--primary);
}

/* Image / audio / video message bubbles */
.msg-bubble.has-media {
    padding: 4px;
    background: transparent !important;
    box-shadow: none !important;
}

.msg-bubble-wrap.is-mine .msg-bubble.has-media,
.msg-bubble-wrap.is-theirs .msg-bubble.has-media {
    background: transparent;
}

.msg-bubble-image {
    display: block;
    max-width: 260px;
    max-height: 320px;
    border-radius: 14px;
    object-fit: cover;
}

.msg-bubble-image-link {
    display: inline-block;
    line-height: 0;
}

.msg-bubble-audio {
    display: block;
    max-width: 280px;
    height: 36px;
}

.msg-bubble-video {
    display: block;
    max-width: 280px;
    border-radius: 14px;
}

.msg-bubble-file {
    display: inline-block;
    padding: 8px 14px;
    background: var(--bg-input);
    border-radius: 18px;
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
}

.msg-bubble-text {
    padding: 4px 8px;
    border-radius: 18px;
    /* Preserve Shift+Enter newlines and consecutive spaces from the textarea,
       while still wrapping long lines. Without this, HTML collapses every
       run of whitespace to a single space and newlines vanish visually. */
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Reverse-infinite-scroll loader chip (older history fetch) */
.msg-load-older {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    color: var(--text-muted);
}
.msg-load-older .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: ws-spin 0.7s linear infinite;
}
@keyframes ws-spin { to { transform: rotate(360deg); } }

.msg-bubble-text .ws-emoji,
.msg-bubble .ws-emoji {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
    display: inline-block;
}

.msg-bubble.has-media .msg-bubble-text {
    margin-top: 4px;
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.msg-bubble-wrap.is-mine .msg-bubble.has-media .msg-bubble-text {
    background: var(--primary);
    color: #fff;
}

/* Pending attachments grid (one thumbnail per queued file) */
.msg-pending-attachments {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-input);
}
.msg-pending-attachment-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: 0 0 0 1px var(--border-light);
}
.msg-pending-attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.msg-pending-attachment-file {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.msg-pending-attachment-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-pending-attachment-remove:hover { background: var(--danger, #e23b3b); }

/* Drag-over highlight on the thread (drop zone) */
.msg-thread-inner.is-dragover { position: relative; }
.msg-thread-inner.is-dragover::after {
    content: 'Drop image to attach';
    position: absolute;
    inset: 8px;
    z-index: 50;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--primary, #1877f2);
    border-radius: 16px;
    background: rgba(24,119,242,0.06);
    color: var(--primary, #1877f2);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
}

/* Image modal viewer (click any image bubble) */
.msg-image-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}
.msg-image-modal-img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 6px;
    cursor: default;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.msg-image-modal-close,
.msg-image-modal-download {
    position: absolute;
    top: 18px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    color: #fff;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.msg-image-modal-close  { right: 18px; font-size: 26px; }
.msg-image-modal-download { right: 70px; }
.msg-image-modal-close:hover,
.msg-image-modal-download:hover { background: rgba(255,255,255,0.28); }

/* Bubble image trigger (formerly an <a>, now a button) */
.msg-bubble-image-link {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    line-height: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   GALLERY — multi-image / multi-video bubble
   ════════════════════════════════════════════════════════════════════════ */
.msg-bubble-gallery {
    display: grid;
    gap: 4px;
    max-width: 320px;
    border-radius: 14px;
    overflow: hidden;
}
.msg-bubble-gallery.cells-1 { grid-template-columns: 1fr; }
.msg-bubble-gallery.cells-2 { grid-template-columns: 1fr 1fr; }
.msg-bubble-gallery.cells-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.msg-bubble-gallery.cells-3 .msg-bubble-gallery-cell:nth-child(1) {
    grid-row: 1 / span 2;
}
.msg-bubble-gallery.cells-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.msg-bubble-gallery-cell {
    position: relative;
    padding: 0;
    border: 0;
    background: var(--bg-input, #efefef);
    cursor: zoom-in;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 1;
}
.msg-bubble-gallery.cells-1 .msg-bubble-gallery-cell {
    aspect-ratio: auto;
}
.msg-bubble-gallery-cell img,
.msg-bubble-gallery-cell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.msg-bubble-gallery.cells-1 .msg-bubble-gallery-cell img,
.msg-bubble-gallery.cells-1 .msg-bubble-gallery-cell video {
    max-height: 360px;
    height: auto;
    object-fit: contain;
}
.msg-bubble-gallery-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
    pointer-events: none;
}
.msg-bubble-gallery-more {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Modal nav arrows + counter for gallery cycling */
.msg-image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.msg-image-modal-nav:hover { background: rgba(255,255,255,0.28); }
.msg-image-modal-prev { left: 18px; }
.msg-image-modal-next { right: 18px; }
.msg-image-modal-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════
   DETAILS side panel (info button)
   ════════════════════════════════════════════════════════════════════════ */
.msg-details-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: var(--bg-white);
    border-left: 1px solid var(--border-light);
    box-shadow: -8px 0 24px rgba(0,0,0,0.06);
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 30;
    display: flex;
    flex-direction: column;
}
.msg-details-panel.is-open { transform: translateX(0); }

.msg-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}
.msg-details-title { margin: 0; font-size: 16px; font-weight: 700; }
.msg-details-close {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
}
.msg-details-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.msg-details-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.msg-details-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
}
.msg-details-row-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary, #1877f2);
    font-weight: 600;
}
.msg-details-row-label::before {
    content: '🔔';
    font-size: 16px;
}
.msg-details-toggle {
    width: 38px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: var(--border-light);
    cursor: pointer;
    position: relative;
    padding: 0;
    transition: background .15s;
}
.msg-details-toggle.is-on { background: var(--primary); }
.msg-details-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
}
.msg-details-toggle.is-on .msg-details-toggle-knob { transform: translateX(16px); }

.msg-details-section { padding: 8px 18px 18px; }
.msg-details-section-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}
.msg-details-members { display: flex; flex-direction: column; gap: 10px; }
.msg-details-member {
    display: flex;
    align-items: center;
    gap: 12px;
}
.msg-details-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
}
.msg-details-member-name { font-weight: 600; font-size: 14px; }
.msg-details-member-role { font-size: 12px; color: var(--text-muted); }
.msg-details-empty { color: var(--text-muted); font-size: 13px; padding: 16px 0; text-align: center; }

.msg-details-foot {
    border-top: 1px solid var(--border-light);
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}
.msg-details-action {
    padding: 14px 18px;
    background: transparent;
    border: 0;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
}
.msg-details-action:hover { background: var(--bg-hover); }
.msg-details-action-primary { color: var(--primary); border: 1px solid var(--primary); border-radius: 8px; margin: 4px 18px; padding: 10px 12px; text-align: center; }
.msg-details-action-danger { color: var(--danger, #e23b3b); }

/* Rich profile header inside the Details panel */
.msg-details-cover {
    height: 110px;
    background: linear-gradient(135deg, #a78bfa 0%, #c084fc 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.msg-details-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px 16px;
    border-bottom: 1px solid var(--border-light);
    margin-top: -34px;
}
.msg-details-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
    border: 3px solid var(--bg-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.msg-details-identity-text { padding-top: 30px; min-width: 0; }
.msg-details-name {
    font-weight: 700;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.msg-details-realname {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Profile fields list */
.msg-details-fields { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.msg-details-field {
    padding: 8px 18px;
}
.msg-details-field dt {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 2px;
}
.msg-details-field dd {
    margin: 0;
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
}
.msg-details-field[data-field="bio"] dd { white-space: pre-wrap; }
.msg-details-field a { color: var(--primary); text-decoration: none; }
.msg-details-field a:hover { text-decoration: underline; }

/* Nickname editor */
.msg-details-nickname-editor {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-input);
}
.msg-details-nickname-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
#msg-details-nickname-input {
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
}
#msg-details-nickname-input:focus { border-color: var(--primary); }
.msg-details-nickname-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.msg-details-nickname-cancel,
.msg-details-nickname-save {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.msg-details-nickname-save {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.msg-details-nickname-save:disabled { opacity: .55; cursor: default; }

.msg-pending-remove:hover {
    background: var(--danger);
    color: #fff;
}

/* Voice recording bar */
.msg-recording-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
    background: #fff5f5;
    font-size: 13px;
    color: var(--text-primary);
}

.msg-recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e23b3b;
    animation: ws-rec-pulse 1s ease-in-out infinite;
}

@keyframes ws-rec-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(.8); }
}

.msg-recording-time {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.msg-recording-cancel,
.msg-recording-stop {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
}

.msg-recording-stop {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ════════════════════════════════════════════════════════════════════════
   CHROMELESS MESSENGER — body.ws-msg-chromeless
   header-messages.php + sidebar-messages.php + footer-messages.php now
   own the DOM for this page. There is no #masthead, no #colophon, no
   #secondary-right rendered — nothing to hide. .ws-msg-shell is the
   top-level flex row that contains the icon rail + the messages-layout.
   ════════════════════════════════════════════════════════════════════════ */
body.ws-msg-chromeless {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg-white);
}

body.ws-msg-chromeless .ws-msg-shell {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-white);
}

/* ── Hover-expand rail (push-content mode) ──────────────────────────────
   Collapsed: 76px icon-only. Hovered: 240px with labels. Width transitions
   reflow the conv-list + thread panels rightward (no overlay). */
.ws-msg-rail {
    flex: 0 0 76px;
    width: 76px;
    height: 100vh;
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    transition: flex-basis .2s ease, width .2s ease;
    overflow: hidden;
}

.ws-msg-rail:hover,
.ws-msg-rail:focus-within {
    flex-basis: 240px;
    width: 240px;
}

.ws-msg-rail-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 22px 12px 26px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.ws-msg-rail-profile img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ws-msg-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.ws-msg-rail-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    transition: background .12s;
    white-space: nowrap;
}

.ws-msg-rail-item:hover { background: var(--bg-hover); }
.ws-msg-rail-item.is-active { font-weight: 700; }

.ws-msg-rail-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Labels: hidden in collapsed state, revealed on hover. Using
   opacity + max-width transition for a smooth slide-in. */
.ws-msg-rail-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity .15s ease, max-width .2s ease;
}

.ws-msg-rail:hover .ws-msg-rail-label,
.ws-msg-rail:focus-within .ws-msg-rail-label {
    opacity: 1;
    max-width: 200px;
}

/* ── Messages page main column ──────────────────────────────────────── */
body.ws-msg-chromeless main#primary.messages-page {
    flex: 1;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    height: 100vh;
    display: flex;
}

body.ws-msg-chromeless .messages-layout {
    flex: 1;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: var(--bg-white);
    display: flex;
    min-width: 0;
}

body.ws-msg-chromeless .msg-sidebar {
    width: 360px;
    flex: 0 0 360px;
    border-right: 1px solid var(--border-light);
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.ws-msg-chromeless .msg-thread {
    flex: 1;
    min-width: 0;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* The fix that brings the composer back: explicitly make msg-thread-inner
   a vertical flex column with min-height: 0, and force the header /
   pending bar / recording bar / input bar to auto-height while the
   messages-area and profile-card flex-grow to fill remaining space. */
body.ws-msg-chromeless .msg-thread-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

body.ws-msg-chromeless .msg-thread-inner > .msg-thread-header,
body.ws-msg-chromeless .msg-thread-inner > .msg-pending-attachment,
body.ws-msg-chromeless .msg-thread-inner > .msg-recording-bar,
body.ws-msg-chromeless .msg-thread-inner > .msg-input-bar {
    flex: 0 0 auto;
}

body.ws-msg-chromeless .messages-area,
body.ws-msg-chromeless .msg-profile-card {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 900px) {
    body.ws-msg-chromeless .ws-msg-rail { display: none; }
    body.ws-msg-chromeless .msg-sidebar { width: 100%; flex-basis: 100%; }
    body.ws-msg-chromeless .msg-thread { display: none; }
    body.ws-msg-chromeless .messages-layout.has-active-conv .msg-sidebar { display: none; }
    body.ws-msg-chromeless .messages-layout.has-active-conv .msg-thread  { display: flex; }
}

/* ── Instagram-fidelity polish (fullscreen mode only) ────────────────────
   White backgrounds across all panels, subtle gray active row, hide the
   leftover copyright in the left rail, and tighten spacings to match the
   Instagram DM layout proportions. */
body.messages-fullscreen {
    background: var(--bg-white);
}

body.messages-fullscreen #secondary-left {
    background: var(--bg-white);
}

/* Hide the "© 2026 WorkSpace" text + any text widget in the collapsed rail */
body.messages-fullscreen #secondary-left > div > p,
body.messages-fullscreen #secondary-left > div:last-child {
    display: none;
}

body.messages-fullscreen .msg-sidebar {
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
}

body.messages-fullscreen .msg-thread {
    background: var(--bg-white);
}

body.messages-fullscreen .messages-area {
    background: var(--bg-white);
    background-image: url('../workspace/assets/message-area-background.png');
    background-position: center;
    background-size: auto;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 20px 24px;
    gap: 4px;
    position: relative;
}


body.messages-fullscreen .msg-bubble-wrap.is-theirs .msg-bubble {
    /* background: var(--bg-input, #efefef); */
    color: var(--text-primary);
    background: #E0F9F3;
    box-shadow: none;
}

body.messages-fullscreen .conv-item.active {
    background: var(--bg-input, #f0f2f5);
}

body.messages-fullscreen .conv-item {
    border-radius: 6px;
    margin: 0 8px;
    padding: 8px 10px;
}
/* body.messages-fullscreen .conv-item:after{
    content: "fasf";
    position: absolute;
    top: 0;
    right: 0;
    background: red;
    width: 40px;
    height: 100%;
    pointer-events: none;
}
body.messages-fullscreen .conv-item:after:{

} */


/* body.messages-fullscreen .conv-item:hover {
    pointer-events: none;
}

body.messages-fullscreen .conv-item:hover .conv-item-more {
    pointer-events: auto;
}
body.messages-fullscreen .conv-item-more {
    position: relative;
    z-index: 10;
} */


body.messages-fullscreen .conv-list {
    padding: 0 0 16px;
}

body.messages-fullscreen .msg-thread-header {
    border-bottom: 1px solid var(--border-light);
    padding: 14px 22px;
}

body.messages-fullscreen .msg-input-bar {
    border-top: 1px solid var(--border-light);
    padding: 12px 20px 16px;
}

body.messages-fullscreen .msg-input-wrap {
    border-color: var(--border-light);
    padding: 10px 18px;
    border-radius: 10px;
}

body.messages-fullscreen .conv-avatar {
    width: 56px;
    height: 56px;
}

body.messages-fullscreen .conv-name {
    font-size: 14px;
    font-weight: 600;
}

body.messages-fullscreen .conv-preview {
    font-size: 13px;
}

/* Sidebar header padding + search to match Instagram spacing */
body.messages-fullscreen .msg-sidebar-header {
    padding: 22px 20px 14px;
}

body.messages-fullscreen .msg-search-wrap {
    margin: 0 16px 8px;
    background: var(--bg-input, #efefef);
}

body.messages-fullscreen .msg-folder-tabs {
    padding: 8px 20px 12px;
}

/* Thread message bubbles: Instagram-style tight grouping */
body.messages-fullscreen .msg-bubble {
    border-radius: 10px;
    padding: 8px 14px;
}


body.messages-fullscreen .msg-time {
    margin-top: 6px;
    font-size: 11px;
}

/* Profile-card empty state — centered, no extra padding */
body.messages-fullscreen .msg-profile-card {
    background: var(--bg-white);
    padding: 40px 20px;
    gap: 6px;
}

.msg-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, opacity .15s;
}

.msg-send-btn:hover:not(:disabled) {
    background: var(--primary-dark, #1255c0);
}

.msg-send-btn:disabled {
    opacity: .45;
    cursor: default;
}

/* ── New message modal ── */
.msg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 16px;
    backdrop-filter: blur(3px);
}

.msg-modal {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.msg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.msg-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.msg-modal-close {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.msg-modal-close:hover {
    color: var(--text-primary);
}

.msg-modal-body {
    padding: 16px 20px;
}

.msg-to-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 8px;
}

.msg-to-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.msg-to-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
}

.msg-to-results {
    max-height: 240px;
    overflow-y: auto;
}

.msg-to-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .12s;
}

.msg-to-result:hover {
    background: var(--bg-hover);
}

.msg-to-result img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.msg-to-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.msg-to-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Mobile: hide sidebar when thread is active */
@media (max-width: 680px) {
    .messages-layout {
        height: calc(100vh - 60px);
    }

    .msg-sidebar {
        width: 100%;
        border-right: none;
    }

    .msg-thread {
        display: none;
    }

    .messages-layout.thread-open .msg-sidebar {
        display: none;
    }

    .messages-layout.thread-open .msg-thread {
        display: flex;
        width: 100%;
    }

    .msg-back-btn {
        display: flex;
    }
}

/* Dark mode */
[data-theme="dark"] .messages-layout,
[data-theme="dark"] .msg-sidebar,
[data-theme="dark"] .msg-thread-header,
[data-theme="dark"] .msg-input-bar,
[data-theme="dark"] .msg-modal {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .msg-sidebar-header,
[data-theme="dark"] .conv-item.active {
    background: var(--bg-card);
}

[data-theme="dark"] .conv-item.active {
    background: rgba(24, 119, 242, .15);
}

[data-theme="dark"] .messages-area {
    background: var(--bg-body);
}

[data-theme="dark"] .msg-bubble-wrap.is-theirs .msg-bubble {
    background: var(--bg-card);
}

[data-theme="dark"] .msg-search-wrap,
[data-theme="dark"] .msg-input-wrap {
    background: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .msg-online-dot {
    border-color: var(--bg-card);
}

[data-theme="dark"] .msg-to-wrap {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .msg-modal-header {
    border-color: var(--border-dark, #3a3a4a);
}

/* ============================================================
   USER PROFILE PAGE
   ============================================================ */
.profile-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.profile-cover {
    height: 220px;
    background: linear-gradient(135deg, var(--ws-blue), var(--primary));
    position: relative;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    overflow: hidden;
}

.profile-cover-edit {
    position: absolute;
    bottom: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, .9);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    backdrop-filter: blur(4px);
}

.profile-cover-edit:hover {
    background: #fff;
}

.profile-info-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 8px 24px 20px;
    flex-wrap: wrap;
}

.profile-avatar-img {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 4px solid var(--bg-white);
    object-fit: cover;
    margin-top: -44px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    z-index: 1;
}

.profile-info-main {
    flex: 1;
    padding-bottom: 4px;
    min-width: 0;
}

.profile-display-name {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
}

.profile-role-badge {
    display: inline-block;
    background: var(--bg-input);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 4px;
}

.profile-dept {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

.profile-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 4px;
}

.profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .15s;
}

.profile-btn:hover {
    opacity: .85;
}

.profile-btn-primary {
    background: var(--primary);
    color: #fff;
}

.profile-btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
}

.profile-btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.profile-btn-connected {
    background: #e8f5e9;
    color: #2e7d32;
    cursor: default;
}

.profile-btn-pending {
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: default;
}

.profile-stats-bar {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid var(--border-light);
    gap: 0;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 20px;
}

.profile-stat:first-child {
    padding-left: 0;
}

.profile-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.profile-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 2px;
}

.profile-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(0, 0, 0, .12);
    flex-shrink: 0;
}

.profile-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-about-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.profile-about-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.55;
    margin: 0 0 14px;
}

.profile-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.profile-meta-item svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.profile-meta-item a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}

.profile-meta-item a:hover {
    text-decoration: underline;
}

.profile-posts {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-no-posts {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 48px 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-no-posts svg {
    margin-bottom: 12px;
    opacity: .4;
}

@media (max-width: 768px) {
    .profile-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .profile-avatar-img {
        width: 88px;
        height: 88px;
        margin-top: -34px;
    }

    .profile-display-name {
        font-size: 18px;
    }
}

[data-theme="dark"] .profile-card,
[data-theme="dark"] .profile-about-card {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .profile-avatar-img {
    border-color: var(--bg-card);
}

[data-theme="dark"] .profile-cover-edit {
    background: rgba(30, 30, 40, .85);
    color: #fff;
}

[data-theme="dark"] .profile-stats-bar {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .profile-stat-divider {
    background: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .profile-role-badge {
    background: rgba(255, 255, 255, .08);
}

[data-theme="dark"] .profile-btn-secondary {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

[data-theme="dark"] .profile-btn-connected {
    background: rgba(46, 125, 50, .2);
    color: #66bb6a;
}

[data-theme="dark"] .profile-no-posts {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

/* ============================================================
   EDIT PROFILE PAGE
   ============================================================ */
.edit-profile-page {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ep-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ep-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ep-hero-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.ep-hero-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 2px;
}

.ep-hero-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.ep-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    transition: background .15s;
}

.ep-back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ep-cover-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.ep-cover-preview {
    height: 200px;
    background: linear-gradient(135deg, var(--ws-blue), var(--primary));
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 14px;
}

.ep-cover-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-sm);
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .15s;
}

.ep-cover-upload-btn:hover {
    background: #fff;
}

.ep-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px 18px;
}

.ep-avatar-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    margin-top: -44px;
    flex-shrink: 0;
}

.ep-avatar-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.ep-avatar-edit-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
}

.ep-avatar-wrap:hover .ep-avatar-edit-overlay {
    opacity: 1;
}

.ep-avatar-name {
    font-size: 14px;
}

.ep-avatar-name strong {
    display: block;
    font-weight: 700;
    margin-bottom: 3px;
}

.ep-avatar-name span {
    font-size: 12px;
    color: var(--primary);
}

.ep-form {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 24px;
}

.ep-alert {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
}

.ep-alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.ep-alert-error {
    background: #fdecea;
    color: #c62828;
}

.ep-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}

.ep-field-full {
    grid-column: 1 / -1;
}

.ep-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}

.ep-input,
.ep-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color .15s;
    box-sizing: border-box;
}

.ep-input:focus,
.ep-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
}

.ep-textarea {
    resize: vertical;
    min-height: 100px;
}

.ep-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.ep-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}

.ep-save-btn:hover {
    opacity: .88;
}

.ep-save-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ep-cancel-btn {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 14px;
}

.ep-cancel-btn:hover {
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .ep-fields-grid {
        grid-template-columns: 1fr;
    }

    .ep-field-full {
        grid-column: 1;
    }

    .ep-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

[data-theme="dark"] .ep-cover-section,
[data-theme="dark"] .ep-form {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ep-avatar-img {
    border-color: var(--bg-card);
}

[data-theme="dark"] .ep-input,
[data-theme="dark"] .ep-textarea {
    background: rgba(255, 255, 255, .06);
    border-color: var(--border-dark, #3a3a4a);
    color: #fff;
}

[data-theme="dark"] .ep-input:focus,
[data-theme="dark"] .ep-textarea:focus {
    background: rgba(255, 255, 255, .1);
    border-color: var(--primary);
}

[data-theme="dark"] .ep-form-footer {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ep-back-btn {
    background: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .ep-hero-icon {
    background: rgba(255, 255, 255, .06);
}

/* ============================================================
   PROJECT MANAGEMENT (Monday.com-style) — Full-width
   ============================================================ */

/* ── Full-width layout override ─────────────────────────────── */
body.page-projects-full .main-content-wrapper {
    grid-template-columns: 1fr;
    padding: 0;
}

body.page-projects-full #secondary-left,
body.page-projects-full #secondary-right {
    display: none;
}

.ws-pm-fullwidth {
    padding: 0 24px 40px;
    max-width: 100%;
    min-height: calc(100vh - var(--header-height) - 40px);
}

/* ── Board List Header ──────────────────────────────────────── */
.ws-pm-list-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.ws-pm-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.ws-pm-page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.ws-pm-page-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Workspace Sidebar + Board Grid ─────────────────────────── */
.ws-pm-workspace-layout {
    display: flex;
    gap: 24px;
}

.ws-pm-workspace-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    padding: 12px 0;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 16px);
}

.ws-pm-ws-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 4px;
}

.ws-pm-ws-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.ws-pm-ws-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.ws-pm-ws-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 24px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background .15s;
}

.ws-pm-ws-item:hover {
    background: var(--bg-hover);
}

.ws-pm-ws-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ws-pm-ws-add {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px 8px 24px;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.ws-pm-ws-add:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.ws-pm-board-grid-area {
    flex: 1;
}

/* ── Board Cards ────────────────────────────────────────────── */
.ws-pm-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.ws-pm-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

.ws-pm-board-card {
    display: block;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .15s;
}

.ws-pm-board-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.ws-pm-board-card-accent {
    height: 4px;
    background: var(--board-color, var(--primary));
}

.ws-pm-board-card-body {
    padding: 16px 20px 20px;
}

.ws-pm-board-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.ws-pm-board-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.4;
}

.ws-pm-board-card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Buttons ────────────────────────────────────────────────── */
.ws-pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.ws-pm-btn-primary {
    background: var(--primary);
    color: #fff;
}

.ws-pm-btn-primary:hover {
    background: var(--primary-dark);
}

.ws-pm-btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ws-pm-btn-secondary:hover {
    background: var(--border);
}

.ws-pm-btn-ghost {
    background: none;
    color: var(--text-secondary);
    padding: 6px 12px;
}

.ws-pm-btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ws-pm-btn-danger:hover {
    color: var(--danger) !important;
}

.ws-pm-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ── Modal ──────────────────────────────────────────────────── */
.ws-pm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-pm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
}

.ws-pm-modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.ws-pm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.ws-pm-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.ws-pm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ws-pm-modal-close:hover {
    color: var(--text-primary);
}

.ws-pm-modal-body {
    padding: 20px 24px;
}

.ws-pm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

.ws-pm-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.ws-pm-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
    box-sizing: border-box;
}

.ws-pm-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.ws-pm-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ws-pm-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.ws-pm-color-swatch:hover {
    transform: scale(1.15);
}

.ws-pm-color-swatch.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-white);
}

/* ── Board Top Bar ──────────────────────────────────────────── */
.ws-pm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
}

.ws-pm-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-pm-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ws-pm-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.ws-pm-back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ws-pm-board-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

/* ── View Tabs ──────────────────────────────────────────────── */
.ws-pm-view-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 0;
}

.ws-pm-view-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s;
}

.ws-pm-view-tab:hover {
    color: var(--text-primary);
}

.ws-pm-view-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ── Toolbar ────────────────────────────────────────────────── */
.ws-pm-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
}

.ws-pm-new-task-btn {
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 13px;
}

.ws-pm-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
    margin: 0 8px;
}

.ws-pm-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
}

.ws-pm-toolbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ── Members Panel ──────────────────────────────────────────── */
.ws-pm-members-panel {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

.ws-pm-members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ws-pm-members-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.ws-pm-member-add {
    position: relative;
}

.ws-pm-member-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.ws-pm-member-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    color: var(--text-primary);
}

.ws-pm-member-result-item:hover {
    background: var(--bg-hover);
}

.ws-pm-members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ws-pm-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    font-size: 12px;
}

.ws-pm-member-avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.ws-pm-member-name {
    font-weight: 600;
    color: var(--text-primary);
}

.ws-pm-member-role {
    color: var(--text-muted);
}

.ws-pm-member-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.ws-pm-member-remove:hover {
    color: var(--danger);
}

/* ── Table Groups ───────────────────────────────────────────── */
.ws-pm-table-wrapper {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ws-pm-group {
    border-radius: 0;
}

.ws-pm-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    position: relative;
}

.ws-pm-group-toggle {
    background: none;
    border: none;
    color: var(--group-color, var(--text-secondary));
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: transform .2s;
}

.ws-pm-group-toggle.collapsed {
    transform: rotate(-90deg);
}

.ws-pm-group-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--group-color);
    outline: none;
    min-width: 60px;
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
}

.ws-pm-group-title:focus {
    background: var(--bg-hover);
}

.ws-pm-group-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.ws-pm-group-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    opacity: 0;
    transition: opacity .2s;
    margin-left: 4px;
}

.ws-pm-group-header:hover .ws-pm-group-delete {
    opacity: 1;
}

.ws-pm-group-delete:hover {
    color: var(--danger);
}

/* ── Table Rows ─────────────────────────────────────────────── */
.ws-pm-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-light);
    min-height: 38px;
}

.ws-pm-row-header {
    background: var(--bg-white);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-top: 2px solid var(--group-color, var(--primary));
}

.ws-pm-row-item {
    background: var(--bg-white);
    transition: background .1s;
    cursor: default;
}

.ws-pm-row-item:hover {
    background: rgba(204, 229, 255, .15);
}

.ws-pm-row-add {
    background: var(--bg-white);
    border-bottom: none;
}

.ws-pm-row-summary {
    background: var(--bg-white);
    border-bottom: none;
    min-height: 32px;
}

/* ── Row Color Bar ──────────────────────────────────────────── */
.ws-pm-row-color-bar {
    width: 6px;
    align-self: stretch;
    border-radius: 0;
    flex-shrink: 0;
    margin-right: 4px;
}

/* ── Table Cells ────────────────────────────────────────────── */
.ws-pm-cell {
    padding: 0 8px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 38px;
    border-right: 1px solid var(--border-light);
}

.ws-pm-cell:last-child {
    border-right: none;
}

.ws-pm-cell-checkbox {
    width: 48px;
    justify-content: flex-start;
    gap: 0;
    border-right: none;
    padding-left: 0;
}

.ws-pm-cell-checkbox input[type="checkbox"] {
    cursor: pointer;
    margin-left: 4px;
}

.ws-pm-cell-title {
    flex: 1;
    min-width: 240px;
    font-size: 13px;
    gap: 4px;
    padding-left: 4px;
}

.ws-pm-cell-owner {
    width: 100px;
    justify-content: center;
}

.ws-pm-cell-status {
    width: 150px;
    justify-content: center;
    padding: 0;
}

.ws-pm-cell-priority {
    width: 50px;
    justify-content: center;
}

.ws-pm-cell-date {
    width: 130px;
    justify-content: center;
    position: relative;
}

.ws-pm-cell-plus {
    width: 36px;
    justify-content: center;
}

.ws-pm-col-add-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
}

.ws-pm-col-add-btn:hover {
    color: var(--primary);
}

/* ── Item Title Cell ────────────────────────────────────────── */
.ws-pm-item-title {
    outline: none;
    cursor: text;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.ws-pm-item-title:focus {
    background: var(--bg-input);
}

.ws-pm-item-open-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: opacity .15s;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ws-pm-row-item:hover .ws-pm-item-open-btn {
    opacity: 1;
}

.ws-pm-item-open-btn:hover {
    color: var(--primary);
}

/* ── Status Button (full cell fill) ─────────────────────────── */
.ws-pm-status-btn {
    padding: 0;
    border: none;
    border-radius: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    height: 100%;
    min-height: 38px;
    text-align: center;
    transition: opacity .15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-pm-status-btn:hover {
    opacity: .85;
}

/* ── Priority Button (icon only) ────────────────────────────── */
.ws-pm-priority-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.ws-pm-priority-btn:hover {
    background: var(--bg-hover);
}

/* ── Assignee Button ────────────────────────────────────────── */
.ws-pm-assignee-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-pm-assignee-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--bg-white);
}

.ws-pm-assignee-empty {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.ws-pm-assignee-btn:hover .ws-pm-assignee-empty {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Date Input ─────────────────────────────────────────────── */
.ws-pm-date-input {
    border: none;
    background: none;
    font-size: 12px;
    color: transparent;
    padding: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
    position: absolute;
    opacity: 0;
}

.ws-pm-date-label {
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.ws-pm-cell-date:hover .ws-pm-date-input {
    opacity: 1;
    width: 100%;
    position: relative;
    color: var(--text-primary);
}

.ws-pm-cell-date:hover .ws-pm-date-label {
    display: none;
}

.ws-pm-date-input.ws-pm-overdue~.ws-pm-date-label {
    color: var(--danger);
    font-weight: 600;
}

/* ── Summary Row ────────────────────────────────────────────── */
.ws-pm-summary-bar {
    display: flex;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    gap: 1px;
}

.ws-pm-summary-segment {
    height: 100%;
}

.ws-pm-date-range {
    font-size: 11px;
    color: #fff;
    background: var(--primary);
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

/* ── Add Item Input ─────────────────────────────────────────── */
.ws-pm-add-item-input {
    border: none;
    background: none;
    padding: 8px 6px;
    font-size: 13px;
    color: var(--text-secondary);
    width: 100%;
    outline: none;
    font-family: var(--font-body);
}

.ws-pm-add-item-input:focus {
    color: var(--text-primary);
}

.ws-pm-add-item-input::placeholder {
    color: var(--text-muted);
}

/* ── Add Group Button ───────────────────────────────────────── */
.ws-pm-add-group-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.ws-pm-add-group-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ── Dropdowns ──────────────────────────────────────────────── */
.ws-pm-dropdown {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 160px;
    overflow: hidden;
    z-index: 9999;
}

.ws-pm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    text-align: left;
}

.ws-pm-dropdown-item:hover {
    background: var(--bg-hover);
}

.ws-pm-dropdown-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* ── Task Detail Side Panel ─────────────────────────────────── */
.ws-pm-task-panel {
    position: fixed;
    top: var(--header-height);
    right: -480px;
    width: 480px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-white);
    box-shadow: -4px 0 24px rgba(0, 0, 0, .12);
    z-index: 1000;
    transition: right .3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ws-pm-task-panel.open {
    right: 0;
}

.ws-pm-task-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.ws-pm-task-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ws-pm-task-panel-close:hover {
    color: var(--text-primary);
}

.ws-pm-task-panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    flex: 1;
}

.ws-pm-task-panel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
}

.ws-pm-task-tab {
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ws-pm-task-tab:hover {
    color: var(--text-primary);
}

.ws-pm-task-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.ws-pm-task-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ws-pm-task-tab-content {
    display: none;
}

.ws-pm-task-tab-content.active {
    display: block;
}

.ws-pm-task-notes-input {
    margin-bottom: 20px;
}

.ws-pm-task-notes-input textarea {
    margin-bottom: 8px;
    min-height: 60px;
    resize: vertical;
}

.ws-pm-task-empty-state {
    text-align: center;
    padding: 40px 16px;
}

.ws-pm-task-empty-state p {
    margin: 8px 0 0;
    font-size: 13px;
}

.ws-pm-task-notes-display .ws-pm-note-item {
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
    white-space: pre-wrap;
}

/* ── Dashboard ──────────────────────────────────────────────── */
.ws-pm-view {
    /* views toggle */
}

.ws-pm-dash-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.ws-pm-dash-card {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.ws-pm-dash-card-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ws-pm-dash-card-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.ws-pm-dash-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.ws-pm-dash-widget {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.ws-pm-dash-widget-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}

.ws-pm-dash-widget-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.ws-pm-dash-widget-body {
    padding: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pie Chart */
.ws-pm-dash-pie-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.ws-pm-dash-pie {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ws-pm-dash-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ws-pm-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.ws-pm-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Bar Chart (vertical) */
.ws-pm-dash-bars {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 180px;
}

.ws-pm-dash-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 80px;
}

.ws-pm-dash-bar-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.ws-pm-dash-bar-track {
    width: 100%;
    height: 120px;
    background: var(--bg-input);
    border-radius: 4px 4px 0 0;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.ws-pm-dash-bar-fill {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: height .5s ease;
    min-height: 4px;
}

.ws-pm-dash-bar-name {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Horizontal bar */
.ws-pm-dash-bars-h {
    flex-direction: column;
    height: auto;
    align-items: stretch;
    gap: 10px;
}

.ws-pm-dash-hbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-pm-dash-hbar-label {
    width: 70px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.ws-pm-dash-hbar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.ws-pm-dash-hbar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .5s ease;
    min-width: 4px;
}

.ws-pm-dash-hbar-val {
    width: 24px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.ws-pm-dash-big-number {
    font-size: 48px;
    font-weight: 700;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .ws-pm-workspace-sidebar {
        display: none;
    }

    .ws-pm-task-panel {
        width: 380px;
    }
}

@media (max-width: 900px) {
    .ws-pm-cell-priority {
        display: none;
    }

    .ws-pm-cell-status {
        width: 120px;
    }

    .ws-pm-dash-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .ws-pm-dash-charts {
        grid-template-columns: 1fr;
    }

    .ws-pm-task-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 600px) {
    .ws-pm-fullwidth {
        padding: 0 12px 24px;
    }

    .ws-pm-board-grid {
        grid-template-columns: 1fr;
    }

    .ws-pm-cell-owner,
    .ws-pm-cell-date {
        display: none;
    }

    .ws-pm-cell-title {
        min-width: 140px;
    }

    .ws-pm-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ws-pm-toolbar {
        flex-wrap: wrap;
    }

    .ws-pm-dash-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] .ws-pm-board-card,
[data-theme="dark"] .ws-pm-members-panel,
[data-theme="dark"] .ws-pm-empty,
[data-theme="dark"] .ws-pm-workspace-sidebar,
[data-theme="dark"] .ws-pm-dash-card,
[data-theme="dark"] .ws-pm-dash-widget {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-pm-modal-content,
[data-theme="dark"] .ws-pm-task-panel {
    background: var(--bg-card);
}

[data-theme="dark"] .ws-pm-row-header {
    background: rgba(255, 255, 255, .03);
}

[data-theme="dark"] .ws-pm-row-item {
    background: var(--bg-card);
}

[data-theme="dark"] .ws-pm-row-item:hover {
    background: rgba(255, 255, 255, .04);
}

[data-theme="dark"] .ws-pm-row-add,
[data-theme="dark"] .ws-pm-row-summary {
    background: var(--bg-card);
}

[data-theme="dark"] .ws-pm-dropdown {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-pm-dropdown-item:hover,
[data-theme="dark"] .ws-pm-member-result-item:hover {
    background: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .ws-pm-input {
    background: rgba(255, 255, 255, .06);
    border-color: var(--border-dark, #3a3a4a);
    color: #fff;
}

[data-theme="dark"] .ws-pm-member {
    background: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .ws-pm-assignee-avatar {
    border-color: var(--bg-card);
}

/* ================================================================
   PHOTO LIGHTBOX — per-photo reactions & comments
   ================================================================ */

.ws-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: stretch;
    justify-content: center;
}

.ws-lightbox.is-open {
    display: flex;
}

/* Lock page scroll while lightbox is open */
html.ws-lightbox-open,
html.ws-lightbox-open body {
    overflow: hidden !important;
}

.ws-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 1;
}

.ws-lightbox-container {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

/* Close button */
.ws-lightbox-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.ws-lightbox-close:hover {
    background: rgba(255, 255, 255, .3);
}

/* ── Image area ─────────────────────────────────────────────── */
.ws-lightbox-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #000;
    min-width: 0;
}

.ws-lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 40px 60px;
}

#ws-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}

.ws-lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    font-weight: 500;
    background: rgba(0, 0, 0, .5);
    padding: 4px 14px;
    border-radius: 20px;
}

/* Navigation arrows */
.ws-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, opacity .2s;
}

.ws-lightbox-nav:hover {
    background: rgba(255, 255, 255, .3);
}

.ws-lightbox-nav.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.ws-lightbox-prev {
    left: 16px;
}

.ws-lightbox-next {
    right: 16px;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.ws-lightbox-sidebar {
    width: 360px;
    min-width: 360px;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-light);
}

/* Header */
.ws-lightbox-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.ws-lightbox-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.ws-lightbox-author-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

/* Reaction stats */
.ws-lightbox-reactions-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    min-height: 36px;
}

.ws-lightbox-reaction-icons {
    display: flex;
}

.ws-lightbox-reaction-icons span {
    font-size: 16px;
    margin-right: -4px;
}

.ws-lightbox-reaction-total {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 6px;
}

/* Action buttons */
.ws-lightbox-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 10px;
    border-bottom: 1px solid var(--border-light);
}

.ws-lightbox-react-wrapper {
    position: relative;
}

.ws-lightbox-like-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.ws-lightbox-like-btn:hover {
    background: var(--bg-hover);
}

.ws-lightbox-like-btn.liked {
    color: var(--primary);
}

.ws-lightbox-like-btn.liked svg {
    fill: currentColor;
}

.ws-lightbox-comment-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Reaction popup */
#ws-lightbox .ws-lightbox-reaction-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-white);
    border-radius: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    z-index: 20;
    margin-bottom: 8px;
    white-space: nowrap;
}

/* Invisible bridge so the mouse can travel from the Like button to the popup */
#ws-lightbox .ws-lightbox-reaction-popup::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

#ws-lightbox .ws-lightbox-reaction-popup.is-visible {
    display: flex;
}

#ws-lightbox .ws-lb-react-btn {
    font-size: 28px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: transform .15s, background .15s;
    line-height: 40px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#ws-lightbox .ws-lb-react-btn:hover {
    transform: scale(1.3);
    background: var(--bg-hover);
}

/* Comments list */
.ws-lightbox-comments {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.ws-lightbox-comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ws-lightbox-loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px 0;
}

/* Individual comment in lightbox */
.ws-lb-comment {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.ws-lb-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ws-lb-comment-body {
    flex: 1;
    min-width: 0;
}

.ws-lb-comment-bubble {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 8px 12px;
}

.ws-lb-comment-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}

.ws-lb-comment-author:hover {
    text-decoration: underline;
}

.ws-lb-comment-bubble p {
    margin: 0;
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
}

.ws-lb-comment-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 4px;
}

/* No comments state */
.ws-lb-no-comments {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 30px 0;
}

/* Comment input */
.ws-lightbox-comment-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
}

.ws-lightbox-comment-input>img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ws-lb-comment-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 20px;
    padding: 0 4px 0 14px;
}

.ws-lb-comment-field {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    padding: 8px 0;
    color: var(--text-primary);
    font-family: inherit;
}

.ws-lb-comment-field::placeholder {
    color: var(--text-muted);
}

.ws-lb-comment-send {
    border: none;
    background: none;
    color: var(--primary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .4;
    transition: opacity .2s;
}

.ws-lb-comment-send:not(:disabled) {
    opacity: 1;
}

.ws-lb-comment-send:not(:disabled):hover {
    background: var(--bg-hover);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 800px) {
    .ws-lightbox-container {
        flex-direction: column;
    }

    .ws-lightbox-media {
        flex: none;
        height: 50vh;
    }

    .ws-lightbox-sidebar {
        width: 100%;
        min-width: 0;
        flex: 1;
    }

    .ws-lightbox-img-wrap {
        padding: 20px;
    }
}

/* ── Dark mode ──────────────────────────────────────────────── */
[data-theme="dark"] .ws-lightbox-sidebar {
    background: var(--bg-card);
}

[data-theme="dark"] .ws-lightbox-header {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-lightbox-actions {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-lightbox-comment-input {
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-lightbox-reaction-popup {
    background: var(--bg-card);
    border-color: var(--border-dark, #3a3a4a);
}

[data-theme="dark"] .ws-lb-comment-bubble {
    background: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .ws-lb-comment-input-wrap {
    background: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .ws-lb-comment-field {
    color: #fff;
}

/* ============================================================
   FRAMIFY: Search Modal + Mobile Nav
   ============================================================ */
#header_search_modal {
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.75);
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease-in-out;
    -o-transition: opacity .5s ease-in-out;
    -ms-transition: opacity .5s ease-in-out;
    -moz-transition: opacity .5s ease-in-out;
    -webkit-transition: opacity .5s ease-in-out;
}

.search-toggle-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#header_search_modal_wrapper {
    width: 80%;
}

#header-search-form {
    width: 100% !important;
    min-width: 100% !important;
    height: 60px;
    margin-top: 20px;
}

#header-search-form #header-search-input {
    font-size: 18px !important;
}

#search_modal_close {
    cursor: pointer;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 12px;
    background: var(--ws-blue);
    border-radius: 50px;
    padding: 10px 20px;
    transition: all .3s ease-in-out;
    -o-transition: all .3s ease-in-out;
    -ms-transition: all .3s ease-in-out;
    -moz-transition: all .3s ease-in-out;
    -webkit-transition: all .3s ease-in-out;
}

#search_modal_close:hover {
    color: #000;
    background: var(--ws-gold);
    transform: scale(1.05, 1.05);
}

#search-results-dropdown {
    position: absolute;
    top: 90px !important;
    width: 80%;
    min-width: 80%;
    display: none;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    #header_nav_logo {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    #mobile_nav {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
    }

    #mobile_nav_wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 6px;
        position: relative;
    }

    #mobile_nav_wrapper span {
        background: #63748e;
        border-radius: 50px;
        width: 30px;
        height: 3px;
        transition: all .3s ease-in-out;
    }

    #mobile_nav:hover span {
        background: var(--ws-blue);
    }

    .mobile-nav-active span {
        background: var(--ws-blue) !important;
    }

    .mobile-nav-active span:nth-child(1) {
        transform: rotate(45deg);
    }

    .mobile-nav-active span:nth-child(2) {
        transform: translateX(-10px);
        opacity: 0;
        position: absolute;
    }

    .mobile-nav-active span:nth-child(3) {
        transform: rotate(-45deg);
        position: absolute;
    }

    .main-content-wrapper {
        display: flex;
    }

    .site-main {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    #secondary-left {
        position: fixed !important;
        left: -300px;
        width: 300px;
        padding: 7px;
        pointer-events: none;
        background: #fff;
        opacity: 0;
        z-index: 10 !important;
        transition: all .3s ease-in-out !important;
        -o-transition: all .3s ease-in-out !important;
        -ms-transition: all .3s ease-in-out !important;
        -moz-transition: all .3s ease-in-out !important;
        -webkit-transition: all .3s ease-in-out !important;
    }

    .sidebar-left-active {
        pointer-events: auto !important;
        left: 8px !important;
        opacity: 1 !important;
        display: block !important;
    }
}

@media (max-width: 420px) {
    #header_nav_logo {
        gap: 5px;
    }

    #masthead {
        padding: 0 10px;
    }

    .masthead-wrapper {
        padding: 0 !important;
    }

    #header_search_modal_wrapper {
        width: 95%;
    }

    #header-search-form {
        height: 50px;
        margin-top: 10px;
    }

    #header-search-form #header-search-input {
        font-size: 16px !important;
    }

    #search_modal_close {
        padding: 7px 15px;
    }

    #search-results-dropdown {
        top: 65px !important;
        width: 95%;
        min-width: 95%;
    }

    #mobile_nav_wrapper {
        gap: 4px;
    }

    #mobile_nav_wrapper span {
        width: 25px;
        height: 3px;
    }

    #secondary-left {
        left: -250px;
        width: 250px;
        padding: 5px;
        opacity: 0;
        z-index: 1;
        transition: all .3s ease-in-out;
    }

    .sidebar-left-active {
        pointer-events: auto !important;
        opacity: 1 !important;
        display: block !important;
    }
}

/* ============================================================
   Material Symbols icons (kohid CDN, output by ws_icon())
   ============================================================ */
img.ws-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    pointer-events: none;
    vertical-align: middle;
    flex-shrink: 0;
}
img.ws-icon.ws-icon--xs { width: 12px; height: 12px; }
img.ws-icon.ws-icon--sm { width: 14px; height: 14px; }
img.ws-icon.ws-icon--md { width: 16px; height: 16px; }
img.ws-icon.ws-icon--lg { width: 48px; height: 48px; }
img.ws-icon.ws-icon--xl { width: 64px; height: 64px; }
img.ws-icon.ws-icon--muted { opacity: 0.5; }
.sidebar-nav-item img.ws-icon { width: 22px; height: 22px; }
.header-icon-btn img.ws-icon,
.header-search img.ws-icon{
    width: 26px;
    height: 26px;
}




/* ============================================================
   Material Design icons (kohid CDN, output by ws_icon())
   ============================================================ */
.composer-modal img.ws-icon {
    width: 26px;
    height: 26px;
}
.composer-action-btn:nth-child(1) svg {
    fill: #00a93d;     
}
.composer-action-btn:nth-child(2) svg {
    fill: #2b7efe;
}
.composer-action-btn:nth-child(3) svg {
    fill: #ff6900;
}

#open-composer-photo img.ws-icon {
    filter: brightness(0) saturate(100%) invert(67%) sepia(48%) saturate(515%) hue-rotate(78deg) brightness(95%) contrast(86%);
    /* ≈ #45BD62 */
}

#open-composer-video img.ws-icon {
    filter: brightness(0) saturate(100%) invert(33%) sepia(98%) saturate(1875%) hue-rotate(204deg) brightness(99%) contrast(96%);
    /* ≈ #1877F2 */
}

#open-composer-feeling img.ws-icon {
    filter: brightness(0) saturate(100%) invert(28%) sepia(73%) saturate(2900%) hue-rotate(326deg) brightness(96%) contrast(91%);
    /* ≈ #E1306C */
}


[data-theme="dark"] img.ws-icon { filter: invert(1); }


.ws-icon-toggle .ws-icon-toggle__on {
    display: none;
}

.ws-icon-toggle.is-active .ws-icon-toggle__off {
    display: none;
}

.ws-icon-toggle.is-active .ws-icon-toggle__on {
    display: inline-flex;
}



.ws-svg {
    display: inline-block;
    fill: currentColor;
    vertical-align: middle;
    flex-shrink: 0;
}

.ws-svg--sm {
    width: 20px;
    height: 20px;
}

.ws-svg--md {
    width: 22px;
    height: 22px;
}

.ws-svg--lg {
    width: 24px;
    height: 24px;
}

.ws-svg--xl {
    width: 28px;
    height: 28px;
}

.ws-sidebar-left .ws-svg {
    color: var(--text-secondary);
}

.ws-sidebar-left .active .ws-svg {
    color: var(--primary);
}

.like-btn.liked .ws-svg {
    color: #e53935;
}





/* Wordpress Sidebar Hide */
.sidebar-divider,
.widget_block{
    display: none;
}