/* ========================================================
   ClubCity.org — CSS
   Modern neighborhood social network — tokens + components.
   ======================================================== */

/* -- Design Tokens -- */
:root {
    /* Neutrals */
    --cc-bg:         #f4f6f9;
    --cc-surface:    #ffffff;
    --cc-surface-2:  #f7f9fc;
    --cc-surface-3:  #eef1f5;
    --cc-ink:        #1c1e21;
    --cc-ink-2:      #3c4043;
    --cc-muted:      #5f6368;   /* ~5.0:1 on #fff — passes WCAG AA */
    --cc-muted-2:    #5a5d62;   /* ~5.5:1 on #fff — passes WCAG AA (was #8a8d91 = 3.2:1 fail) */
    --cc-border:     #e4e6eb;
    --cc-border-2:   #ced0d4;
    --cc-divider:    #f0f2f5;

    /* Brand + accents */
    --cc-primary:       #2563eb;
    --cc-primary-hover: #1d4ed8;
    --cc-primary-soft:  #eff6ff;
    --cc-accent:        #7c3aed;
    --cc-success:       #10b981;
    --cc-warning:       #f59e0b;
    --cc-danger:        #ef4444;
    --cc-like:          #e0245e;

    /* Shadows (subtle depth) */
    --cc-shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
    --cc-shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
    --cc-shadow-md: 0 4px 12px rgba(17, 24, 39, 0.08), 0 2px 4px rgba(17, 24, 39, 0.04);
    --cc-shadow-lg: 0 10px 28px rgba(17, 24, 39, 0.10), 0 4px 10px rgba(17, 24, 39, 0.04);
    --cc-shadow-xl: 0 20px 48px rgba(17, 24, 39, 0.14);
    --cc-shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);

    /* Radii */
    --cc-r-xs: 4px;
    --cc-r-sm: 6px;
    --cc-r:    8px;
    --cc-r-md: 12px;
    --cc-r-lg: 16px;
    --cc-r-xl: 24px;
    --cc-r-full: 9999px;

    /* Spacing scale (8px base) */
    --cc-s-0:  0;
    --cc-s-1:  4px;
    --cc-s-2:  8px;
    --cc-s-3:  12px;
    --cc-s-4:  16px;
    --cc-s-5:  20px;
    --cc-s-6:  24px;
    --cc-s-8:  32px;
    --cc-s-10: 40px;

    /* Transitions */
    --cc-t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --cc-t-med:  200ms cubic-bezier(0.4, 0, 0.2, 1);
    --cc-t-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Type */
    --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Helvetica, Arial, sans-serif;
    --cc-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* -- Reset & Base -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--cc-font);
    line-height: 1.55;
    color: var(--cc-ink);
    background: var(--cc-bg);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
a { color: var(--cc-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* -- Container -- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* -- Header -- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.site-logo { font-size: 1.1rem; color: #333; }
.site-logo:hover { text-decoration: none; }
.logo-sub { font-size: 0.75rem; color: #888; margin-left: 4px; }
.main-nav { display: flex; gap: 16px; align-items: center; }
.main-nav a { color: #555; font-size: 0.9rem; }
.main-nav a:hover { color: var(--cc-primary); }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 768px) {
    .main-nav { display: none; }
    .main-nav.open { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: #fff; border-bottom: 1px solid #ddd; padding: 16px; gap: 12px; }
    .mobile-toggle { display: block; }
}

/* -- Alerts -- */
.alert {
    padding: 12px 16px;
    margin: 0;
    font-size: 0.9rem;
    border-bottom: 1px solid;
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.alert ul { margin: 4px 0 0 16px; list-style: disc; }

/* -- Buttons -- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--cc-primary); color: #fff; }
.btn-primary:hover { background: var(--cc-primary-hover); }
.btn-outline { background: transparent; border-color: var(--cc-primary); color: var(--cc-primary); }
.btn-outline:hover { background: var(--cc-primary-soft); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { display: block; width: 100%; }
.btn-link { background: none; border: none; color: var(--cc-primary); cursor: pointer; font-size: 0.85rem; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.btn-reaction { background: #f0f2f5; border: 1px solid #ddd; padding: 4px 12px; border-radius: 20px; cursor: pointer; font-size: 0.85rem; }
.btn-reaction.reacted { background: #d1e7ff; border-color: var(--cc-primary); color: var(--cc-primary); }

/* -- Main Content -- */
.main-content { padding: 24px 16px; min-height: 60vh; }

/* -- Landing Page -- */
.landing-hero { text-align: center; padding: 48px 0 32px; }
.landing-hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero-sub { font-size: 1.1rem; color: #666; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.how-it-works { padding: 48px 0; }
.how-it-works h2 { text-align: center; margin-bottom: 32px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.step { text-align: center; padding: 24px; background: #fff; border-radius: 8px; border: 1px solid #e0e0e0; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--cc-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; margin-bottom: 12px; }
.step h3 { margin-bottom: 8px; }

/* -- Neighborhood Grid -- */
.featured-neighborhoods { padding: 32px 0; }
.featured-neighborhoods h2 { margin-bottom: 16px; }
.neighborhood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.neighborhood-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: block;
    color: #333;
    transition: box-shadow 0.15s;
}
.neighborhood-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-decoration: none; }
.neighborhood-card h3 { margin-bottom: 4px; color: var(--cc-primary); }
.card-location { font-size: 0.85rem; color: #888; }
.card-members { font-size: 0.85rem; color: #666; display: block; margin: 4px 0; }
.card-desc { font-size: 0.85rem; color: #555; margin-top: 8px; }

/* -- Feed Layout -- */
.feed-layout { display: grid; grid-template-columns: 200px 1fr 220px; gap: 20px; }
@media (max-width: 1024px) { .feed-layout { grid-template-columns: 1fr; } .feed-sidebar, .feed-sidebar-right { display: none; } }

.sidebar-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.sidebar-card h3, .sidebar-card h4 { margin-bottom: 8px; font-size: 0.95rem; }
.filter-list li a { display: block; padding: 4px 8px; border-radius: 4px; color: #555; font-size: 0.85rem; }
.filter-list li a:hover { background: #f0f2f5; }
.filter-list li a.active { background: #d1e7ff; color: var(--cc-primary); font-weight: 500; }
.event-list li { margin-bottom: 8px; }
.event-list li a { display: block; font-size: 0.85rem; }
.event-date { display: block; color: #888; font-size: 0.8rem; }
.sidebar-link { font-size: 0.8rem; display: block; margin-top: 8px; }

/* -- Post Cards -- */
.post-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}
.post-card.pinned { border-left: 3px solid #f0ad4e; }
.post-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.post-author strong { font-size: 0.9rem; }
.post-meta { font-size: 0.8rem; color: #888; }
.post-type-badge { background: #eee; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }
.post-title { margin-bottom: 8px; }
.post-title a { color: #333; }
.post-title a:hover { color: var(--cc-primary); }
.post-body { font-size: 0.9rem; color: #444; margin-bottom: 12px; }
.post-body-full { font-size: 0.95rem; line-height: 1.7; margin-bottom: 16px; }
.post-footer { display: flex; gap: 16px; font-size: 0.85rem; color: #888; align-items: center; flex-wrap: wrap; }
.post-stat { color: #888; }
.post-stat.activity-indicator { color: #d97706; font-weight: 500; }
.post-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; }
.badge-pinned { background: #fff3cd; color: #856404; }

/* -- Post Detail -- */
.post-detail { max-width: 720px; margin: 0 auto; }
.post-full { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px; margin-bottom: 24px; }

/* -- Comments -- */
.comments-section { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px; }
.comments-section h2 { margin-bottom: 16px; }
.comment { border-left: 2px solid #e0e0e0; padding: 8px 12px; margin-bottom: 12px; }
.comment-header { font-size: 0.85rem; margin-bottom: 4px; }
.comment-date { color: #888; margin-left: 8px; font-size: 0.8rem; }
.comment-body { font-size: 0.9rem; }
.comment-form { margin-bottom: 24px; }
.comment-form textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; margin-bottom: 8px; }
.reply-form { margin-top: 8px; }
.reply-form textarea { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.85rem; margin-bottom: 6px; }
.reply-toggle { margin-top: 4px; }
.locked-notice { background: #fff3cd; padding: 8px 12px; border-radius: 4px; font-size: 0.85rem; color: #856404; }

/* -- Report Form -- */
.report-form { margin-top: 12px; padding: 12px; background: #f8f8f8; border-radius: 4px; }
.report-form select, .report-form textarea { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.85rem; margin-bottom: 8px; }

/* -- Forms -- */
.form-page { max-width: 600px; margin: 0 auto; }
.form-page h1 { margin-bottom: 8px; }
.form-intro { color: #666; margin-bottom: 24px; }
.form-standard .form-group { margin-bottom: 16px; }
.form-standard label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 0.9rem; }
.form-standard input[type="text"],
.form-standard input[type="email"],
.form-standard input[type="password"],
.form-standard textarea,
.form-standard select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
}
.form-standard input:focus, .form-standard textarea:focus, .form-standard select:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: 0 0 0 2px rgba(26,107,196,0.15);
}
.form-standard small { color: #888; font-size: 0.8rem; }
.form-row { display: flex; gap: 12px; }
.form-group-sm { max-width: 100px; }
.input-addon { display: flex; align-items: stretch; }
.input-addon input { border-radius: 4px 0 0 4px; }
.addon-text { background: #f0f2f5; border: 1px solid #ddd; border-left: none; padding: 10px 12px; font-size: 0.85rem; color: #666; border-radius: 0 4px 4px 0; white-space: nowrap; }

/* -- Auth Pages -- */
.auth-page { display: flex; justify-content: center; align-items: center; min-height: 50vh; }
.auth-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 32px; width: 100%; max-width: 400px; }
.auth-card h1 { margin-bottom: 20px; text-align: center; }
.auth-link { text-align: center; margin-top: 16px; font-size: 0.85rem; color: #888; }

/* -- Page Headers -- */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }

/* -- Error Page -- */
.error-page { text-align: center; padding: 48px 0; }
.error-page h1 { margin-bottom: 8px; }
.error-page p { color: #666; margin-bottom: 24px; }
.error-actions { display: flex; gap: 12px; justify-content: center; }

/* -- Empty States -- */
.empty-state { text-align: center; padding: 48px 16px; color: #888; }
.empty-state-sm { font-size: 0.85rem; color: #999; }

/* -- Data Tables -- */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.data-table th { background: #f8f9fa; text-align: left; padding: 10px 12px; font-size: 0.85rem; font-weight: 600; border-bottom: 2px solid #e0e0e0; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem; }
.data-table tr:hover td { background: #f8f9fa; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.input-sm { padding: 4px 8px; font-size: 0.8rem; border: 1px solid #ddd; border-radius: 4px; width: 120px; }

/* -- Moderation Badges -- */
.badge-spam { background: #f8d7da; color: #721c24; }
.badge-harassment { background: #f8d7da; color: #721c24; }
.badge-illegal { background: #721c24; color: #fff; }
.badge-misinformation { background: #fff3cd; color: #856404; }
.badge-off_topic { background: #e2e3e5; color: #383d41; }
.badge-privacy { background: #d1ecf1; color: #0c5460; }
.badge-other { background: #e2e3e5; color: #383d41; }

/* -- Search -- */
.header-search { display: flex; }
.header-search input { padding: 6px 12px; border: 1px solid #ddd; border-radius: 20px; font-size: 0.85rem; width: 180px; }
.header-search input:focus { outline: none; border-color: var(--cc-primary); width: 240px; transition: width 0.2s; }
@media (max-width: 768px) { .header-search { display: none; } }
.search-page h1 { margin-bottom: 16px; }
.search-form { margin-bottom: 24px; }
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input { flex: 1; padding: 12px 16px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.search-count { color: #888; margin-bottom: 16px; }
.search-results { display: flex; flex-direction: column; gap: 12px; }
.search-result { display: block; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; color: #333; }
.search-result:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-decoration: none; }
.search-result h3 { margin: 4px 0; }
.search-result p { font-size: 0.9rem; color: #555; margin: 4px 0; }
.result-type { font-size: 0.75rem; background: #eee; padding: 2px 8px; border-radius: 10px; }
.result-meta { font-size: 0.8rem; color: #888; }
.search-inline { display: flex; gap: 8px; align-items: center; }
.search-inline input { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.85rem; }

/* -- Events -- */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.event-card { display: flex; gap: 16px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; color: #333; }
.event-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-decoration: none; }
.event-date-badge { background: var(--cc-primary); color: #fff; border-radius: 8px; padding: 8px 12px; text-align: center; min-width: 55px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.event-date-badge.big { padding: 12px 16px; min-width: 70px; }
.event-month { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }
.event-day { font-size: 1.5rem; font-weight: bold; line-height: 1; }
.event-info h3 { margin-bottom: 4px; }
.event-time, .event-location, .event-rsvp { display: block; font-size: 0.85rem; color: #666; }
.event-detail-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.event-meta { font-size: 0.9rem; color: #666; }
.event-meta span { display: block; margin-bottom: 2px; }
.rsvp-section { margin: 20px 0; padding: 16px; background: #f8f9fa; border-radius: 8px; }
.rsvp-form { display: flex; gap: 8px; margin-top: 8px; }
.attendee-list { margin-top: 8px; }
.attendee-list li { padding: 4px 0; display: flex; justify-content: space-between; border-bottom: 1px solid #f0f0f0; }
.rsvp-status { font-size: 0.8rem; }
.rsvp-going { color: #28a745; }
.rsvp-maybe { color: #ffc107; }
.rsvp-not_going { color: #dc3545; }

/* -- Classifieds -- */
.classifieds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.classified-card { display: block; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; color: #333; }
.classified-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-decoration: none; }
.classified-category { font-size: 0.75rem; background: #e2e3e5; padding: 2px 8px; border-radius: 10px; color: #383d41; }
.classified-card h3 { margin: 8px 0 4px; }
.classified-price { font-weight: 600; color: #28a745; display: block; }
.classified-price.free { color: var(--cc-primary); }
.classified-price-lg { font-size: 1.5rem; font-weight: bold; color: #28a745; }
.classified-price-lg.free { color: var(--cc-primary); }
.classified-condition { font-size: 0.9rem; color: #666; }
.classified-detail-meta { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.classified-meta { font-size: 0.8rem; color: #888; }
.listing-seller { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e0e0e0; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

/* -- Messages -- */
.message-list .message-thread-card { display: block; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; margin-bottom: 8px; color: #333; }
.message-thread-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-decoration: none; }
.thread-subject { font-weight: 600; margin-bottom: 4px; }
.thread-preview { font-size: 0.9rem; color: #666; }
.thread-meta { font-size: 0.8rem; color: #888; margin-top: 4px; }
.thread-participants { color: #666; margin-bottom: 16px; }
.message-list-detail { margin-bottom: 20px; }
.message-bubble { padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; max-width: 80%; }
.message-bubble.mine { background: #d1e7ff; margin-left: auto; }
.message-bubble.theirs { background: #f0f2f5; }
.message-author { font-size: 0.8rem; margin-bottom: 4px; }
.message-author strong { font-size: 0.85rem; }
.message-time { color: #888; margin-left: 8px; }
.message-body { font-size: 0.9rem; }
.reply-form-full { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; }
.reply-form-full textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 8px; font-size: 0.9rem; }

/* -- Profile -- */
.profile-page { max-width: 720px; margin: 0 auto; }
.profile-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.profile-avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; background: var(--cc-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: bold; }
.profile-info { flex: 1; }
.profile-info h1 { margin-bottom: 2px; }
.profile-username { color: #888; font-size: 0.9rem; }
.profile-bio { margin: 8px 0; color: #444; }
.profile-meta, .profile-trust { display: block; font-size: 0.85rem; color: #888; }
.profile-edit { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px; margin-bottom: 24px; }
.profile-section { margin-bottom: 24px; }
.profile-section h2 { margin-bottom: 12px; }
.profile-neighborhoods { display: flex; gap: 8px; flex-wrap: wrap; }

/* -- Admin -- */
.admin-page { }
.admin-page h1 { margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; text-align: center; }
.stat-card.stat-alert { border-color: #dc3545; background: #fff5f5; }
.stat-num { display: block; font-size: 2rem; font-weight: bold; color: var(--cc-primary); }
.stat-alert .stat-num { color: #dc3545; }
.stat-label { font-size: 0.8rem; color: #888; text-transform: uppercase; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .admin-columns { grid-template-columns: 1fr; } }
.admin-columns section { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; }
.admin-columns h2 { margin-bottom: 12px; font-size: 1rem; }
.admin-item { padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.admin-meta { font-size: 0.8rem; color: #888; display: block; }
.badge-role-admin { background: #d4edda; color: #155724; }
.badge-role-moderator { background: #d1ecf1; color: #0c5460; }
.badge-role-member { background: #e2e3e5; color: #383d41; }
.admin-list { margin-bottom: 16px; }
.admin-list li { padding: 4px 0; }

/* -- Governance -- */
.governance-status { background: #f8f9fa; padding: 12px 16px; border-radius: 8px; margin-bottom: 24px; }
.vote-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.vote-card h3 { margin-bottom: 8px; }
.vote-progress { font-weight: 600; color: var(--cc-primary); }
.vote-cooloff { font-size: 0.85rem; color: #856404; }
.vote-expires { font-size: 0.85rem; color: #888; }
.vote-records { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.vote-record { font-size: 0.8rem; padding: 2px 8px; border-radius: 10px; }
.vote-approve { background: #d4edda; color: #155724; }
.vote-reject { background: #f8d7da; color: #721c24; }
.vote-form { display: flex; gap: 8px; margin-top: 12px; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-expired { background: #e2e3e5; color: #383d41; }

/* -- Notifications -- */
.nav-notifications { position: relative; font-size: 1.1rem; display: inline-flex; align-items: center; }
.nav-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    background: #dc3545;
    color: #fff;
    border-radius: 9px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}
.nav-logout-form { display: inline; margin: 0; padding: 0; }
.nav-logout-btn { background: none; border: none; color: #555; font: inherit; cursor: pointer; padding: 0; font-size: 0.9rem; }
.nav-logout-btn:hover { color: var(--cc-primary); }
.notification-item { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid #f0f0f0; }
.notification-item.unread { background: var(--cc-primary-soft); }
.notification-item:hover { background: #f8f9fa; }

/* -- Pagination -- */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 24px; }

/* ===================================================
   CONVERSATION / THREAD UI
   Reddit/HN-inspired thread layout with clear parent-child
   lines, relative times, inline replies, and reactions
   on every level.
   =================================================== */

.thread-container { max-width: 780px; margin: 0 auto; }

/* -- Original Post -- */
.thread-op {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}
.thread-avatar img,
.thread-avatar .avatar-placeholder { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder { background: var(--cc-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.1rem; }
.avatar-placeholder.sm { width: 32px; height: 32px; font-size: 0.85rem; }
.thread-content { flex: 1; min-width: 0; }
.thread-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 0.85rem; color: #666; margin-bottom: 6px;
}
.thread-author { color: var(--cc-primary); font-weight: 600; text-decoration: none; }
.thread-author:hover { text-decoration: underline; }
.thread-meta time { color: #888; }
.dot { color: #ccc; }
.thread-type {
    background: #eef2f6;
    color: #555;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.type-announcement { background: #fff3cd; color: #6b4d00; }       /* 7.5:1 */
.type-question { background: #d1ecf1; color: #052d3a; }            /* 10.8:1 */
.type-alert { background: #f8d7da; color: #5a161d; }               /* 8.5:1 */
.type-recommendation { background: #d4edda; color: #0d3d1b; }      /* 9.2:1 */
.type-lost_found { background: #e2d7f0; color: #3a1f5f; }          /* 8.8:1 */
.thread-pinned { color: #b8860b; font-weight: 500; }
.thread-title { font-size: 1.5rem; margin: 4px 0 12px; line-height: 1.3; color: #222; }
.thread-body { font-size: 1rem; line-height: 1.65; color: #333; margin-bottom: 14px; word-wrap: break-word; }
.thread-body a { color: var(--cc-primary); word-break: break-word; }
.thread-body .mention { color: var(--cc-primary); font-weight: 500; text-decoration: none; background: #eef5fc; padding: 1px 4px; border-radius: 3px; }
.thread-body .mention:hover { background: #d9e9f9; }

/* -- Action Chips (unified button styling for post + comment actions) -- */
.thread-actions, .comment-actions {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px;
}
.action-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent;
    color: #666;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    font-family: inherit;
}
.action-chip:hover { background: #f0f2f5; color: var(--cc-primary); text-decoration: none; }
.action-chip.active { color: #dc3545; background: #fff0f1; font-weight: 500; }
.action-chip.active:hover { background: #ffe0e3; }
.action-chip.static { cursor: default; pointer-events: none; }
.action-chip.sm { padding: 4px 8px; font-size: 0.78rem; }
.action-chip.ghost { color: #999; }
.action-chip.ghost:hover { color: var(--cc-primary); }
.action-chip.danger:hover { color: #dc3545; background: #fff0f1; }
.chip-icon { font-size: 0.95em; line-height: 1; }
.chip-count { font-variant-numeric: tabular-nums; }

/* -- Reply Composer (main) -- */
.reply-composer {
    display: flex;
    gap: 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
}
.composer-avatar img,
.composer-avatar .avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; }
.composer-form { flex: 1; }
.composer-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 48px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.composer-form textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: 0 0 0 3px rgba(26,107,196,0.1);
}
.composer-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 8px; gap: 12px;
}
.composer-hint { font-size: 0.78rem; color: #999; }
.reply-prompt {
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.reply-prompt .btn { margin-right: 8px; }

.locked-notice {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    margin: 16px 0;
    font-size: 0.9rem;
}

/* -- Conversation Header -- */
.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e8eaed;
}
.conversation-header h2 { font-size: 1rem; color: #555; margin: 0; }
.conversation-actions .btn-link { font-size: 0.8rem; color: #888; }

/* -- Comments / Conversation -- */
.conversation { margin-top: 4px; }
.comment-thread { margin: 6px 0; position: relative; }

/* Thread lines - vertical guide connecting nested replies */
.comment-thread .comment-replies {
    position: relative;
    margin-left: 17px;
    padding-left: 15px;
    border-left: 2px solid #e8eaed;
    margin-top: 2px;
}
.comment-thread .comment-replies:hover { border-left-color: #c9d3db; }

/* The actual comment "node" (avatar + content) */
.comment-node {
    display: flex;
    gap: 10px;
    padding: 8px 10px 8px 4px;
    border-radius: 8px;
    position: relative;
}
.comment-node:hover { background: rgba(0, 0, 0, 0.015); }

.comment-collapse {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
    align-self: flex-start;
    margin-top: 8px;
    width: 16px;
}
.comment-collapse:hover { color: var(--cc-primary); }
.comment-thread.collapsed > .comment-node .comment-collapse { transform: rotate(-90deg); }
.comment-thread.collapsed > .comment-node .comment-body,
.comment-thread.collapsed > .comment-node .comment-actions,
.comment-thread.collapsed > .comment-node .inline-reply,
.comment-thread.collapsed > .comment-replies { display: none; }
.comment-thread.collapsed > .comment-node .comment-meta::after {
    content: ' [collapsed]';
    color: #aaa;
    font-size: 0.8rem;
}

.comment-avatar { flex-shrink: 0; }
.comment-content { flex: 1; min-width: 0; }

.comment-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    font-size: 0.82rem; color: #555555; margin-bottom: 4px;  /* was #888 (3.5:1 fail) → #555 (7:1 pass) */
}
.comment-author { color: #333; text-decoration: none; }
.comment-author strong { color: var(--cc-primary); font-weight: 600; }
.comment-author:hover strong { text-decoration: underline; }
.comment-edited { color: #aaa; font-size: 0.75rem; font-style: italic; }

.comment-body {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #2a2a2a;
    word-wrap: break-word;
    margin-bottom: 2px;
}
.comment-body a { color: var(--cc-primary); word-break: break-word; }
.comment-body .mention { color: var(--cc-primary); font-weight: 500; text-decoration: none; background: #eef5fc; padding: 1px 4px; border-radius: 3px; }

/* Depth-based visual tweaks */
.comment-thread.depth-0 > .comment-node { padding-left: 0; }
.comment-thread.depth-5 .comment-replies { border-left-color: #f0f2f5; }

/* -- Inline Reply Form -- */
.inline-reply {
    background: #f8f9fa;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
}
.inline-reply-to { font-size: 0.8rem; color: #666; margin-bottom: 6px; }
.inline-reply-to strong { color: var(--cc-primary); }
.inline-reply textarea {
    width: 100%; border: 1px solid #ddd; border-radius: 6px;
    padding: 8px; font-family: inherit; font-size: 0.9rem;
    resize: vertical; min-height: 60px;
}
.inline-reply textarea:focus {
    outline: none; border-color: var(--cc-primary);
    box-shadow: 0 0 0 2px rgba(26,107,196,0.1);
}
.inline-reply .composer-toolbar { margin-top: 6px; }

/* -- Continue Thread -- */
.continue-thread {
    display: inline-block;
    padding: 6px 12px;
    margin: 6px 0 6px 20px;
    background: var(--cc-primary-soft);
    color: var(--cc-primary);
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px dashed #c5dbf2;
}
.continue-thread:hover { background: #e0ecfa; text-decoration: none; }

/* -- Empty Conversation -- */
.empty-conversation {
    text-align: center;
    padding: 32px 16px;
    color: #888;
    font-size: 0.95rem;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px dashed #e0e4e8;
}
.empty-conversation strong { color: var(--cc-primary); }

/* -- @mention autocomplete -- */
.mention-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
    min-width: 180px;
}
.mention-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f2f5;
}
.mention-option:last-child { border-bottom: none; }
.mention-option:hover, .mention-option.active { background: var(--cc-primary-soft); }
.mention-option strong { color: var(--cc-primary); font-weight: 600; }
.mention-option-username { color: #888; font-size: 0.8rem; }

/* -- Danger button variant for old usage -- */
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }

/* -- Live activity pill -- */
.new-activity-pill {
    display: none;
    margin: 0 auto 12px auto;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--cc-primary), #2f85d6);
    color: #fff;
    border-radius: 24px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(26, 107, 196, 0.3);
    animation: pillPulse 1.5s ease-in-out infinite;
    width: fit-content;
    user-select: none;
}
.new-activity-pill.show { display: block; }
.new-activity-pill:hover { background: linear-gradient(135deg, var(--cc-primary-hover), var(--cc-primary)); transform: translateY(-1px); }
@keyframes pillPulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(26, 107, 196, 0.3); }
    50% { box-shadow: 0 3px 16px rgba(26, 107, 196, 0.5); }
}

/* -- Utility -- */
.hidden { display: none !important; }

/* -- Footer -- */
.site-footer { text-align: center; padding: 24px 16px; color: #999; font-size: 0.85rem; border-top: 1px solid #e0e0e0; margin-top: 48px; background: #fff; }
.footer-meta { margin-top: 4px; }
.footer-meta a { color: #999; }
.footer-meta a:hover { color: var(--cc-primary); }

/* -- Hashtags & Trending -- */
.hashtag { color: var(--cc-primary); text-decoration: none; font-weight: 500; }
.hashtag:hover { text-decoration: underline; }
.trending-list { list-style: none; padding: 0; margin: 0; }
.trending-list li { display: flex; justify-content: space-between; padding: 4px 8px; font-size: 0.85rem; }
.trending-count { color: #999; font-size: 0.75rem; }
.tag-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e0e0e0; }
.tag-header h1 { margin: 0 0 4px; color: var(--cc-primary); }
.tag-count { margin: 0; color: #888; font-size: 0.9rem; }

/* ============================================================
   Attachments — post & comment image/PDF grids, preview tiles,
   drop zones, and the lightbox overlay.
   ============================================================ */

/* -- Rendered grid on posts/comments -- */
.attachment-grid {
    display: grid;
    gap: 6px;
    margin: 10px 0 6px;
    border-radius: 10px;
    overflow: hidden;
}
.attachment-grid.count-1 { grid-template-columns: 1fr; max-width: 540px; }
.attachment-grid.count-2 { grid-template-columns: 1fr 1fr; }
.attachment-grid.count-3 { grid-template-columns: 1fr 1fr 1fr; }
.attachment-grid.count-4 { grid-template-columns: 1fr 1fr; }
.attachment-grid.comment { max-width: 420px; }

.attachment-tile {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f2f5;
    aspect-ratio: 4 / 3;
    line-height: 0;
    transition: transform 0.15s ease;
}
.attachment-tile:hover { transform: scale(1.01); }
.attachment-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.attachment-grid.count-1 .attachment-tile { aspect-ratio: auto; }
.attachment-grid.count-1 .attachment-tile img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    background: #000;
}

/* -- PDF tile -- */
.attachment-tile.attachment-pdf {
    background: linear-gradient(135deg, #fff4f4 0%, #ffe9e9 100%);
    border: 1px solid #f0c7c7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    color: #b43a3a;
    text-decoration: none;
    line-height: 1.3;
}
.attachment-tile.attachment-pdf:hover { text-decoration: none; background: #ffeaea; }
.attachment-tile.attachment-pdf .pdf-icon {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
    background: #b43a3a;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.attachment-tile.attachment-pdf .pdf-name {
    font-size: 0.8rem;
    text-align: center;
    word-break: break-word;
    max-height: 3.6em;
    overflow: hidden;
}
.attachment-tile.attachment-file {
    background: #f4f6f9;
    border: 1px solid #dfe4ea;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    font-size: 0.85rem;
}

/* -- Upload preview (before form submit) -- */
.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.attachment-preview:empty { display: none; }
.attachment-preview-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f2f5;
    border: 1px solid #dfe4ea;
    flex-shrink: 0;
}
.attachment-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.attachment-preview-item .attach-remove,
.attachment-preview-item .attach-status {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.attachment-preview-item .attach-remove:hover { background: #d33; }
.attachment-preview-item .attach-status {
    font-size: 0.65rem;
    background: rgba(255,193,7,0.9);
    color: #333;
    width: auto;
    height: auto;
    padding: 2px 6px;
    border-radius: 10px;
    right: auto;
    left: 4px;
    cursor: default;
}
.attachment-preview-item.uploading { opacity: 0.6; }
.attachment-preview-item.error { border-color: #dc3545; }
.attachment-preview-item.error .attach-status { background: #dc3545; color: #fff; }

.attachment-pdf-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.7rem;
    font-weight: 600;
    color: #b43a3a;
    background: #ffe9e9;
    padding: 6px;
    text-align: center;
    word-break: break-word;
}
.attachment-pdf-mini small { font-weight: 400; color: #555; }

.attachment-delete-check {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.attachment-delete-check input { margin: 0; }

/* -- Drop zone hint on textareas -- */
.drop-zone-wrap { position: relative; }
.drop-zone-hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
}
.drop-zone-active {
    outline: 2px dashed var(--cc-primary);
    outline-offset: -6px;
    background: #eef5ff;
}
.drop-zone-wrap.drop-zone-active textarea,
textarea.drop-zone-active {
    background: #eef5ff;
}

/* -- Attach button (composer) -- */
.btn-attach {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #f0f2f5;
    border: 1px solid #dfe4ea;
    border-radius: 14px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    margin-right: 8px;
    user-select: none;
}
.btn-attach:hover { background: #e4e9f0; color: var(--cc-primary); }

/* -- Lightbox overlay -- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    cursor: zoom-out;
    animation: lb-fade 0.15s ease-out;
}
.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 40px rgba(0,0,0,0.5);
    border-radius: 4px;
    cursor: default;
}
.lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.35); }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

/* -- Responsive: single column comment grid on narrow viewports -- */
@media (max-width: 480px) {
    .attachment-grid.count-2,
    .attachment-grid.count-3,
    .attachment-grid.count-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* -- Groups -- */
.group-detail { max-width: 1000px; margin: 0 auto; }
.group-header { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; }
.group-header-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.group-header h1 { margin: 0 0 4px 0; display: flex; align-items: center; gap: 8px; }
.group-description { margin-top: 12px; color: #444; line-height: 1.5; }
.group-actions { display: flex; align-items: center; gap: 10px; }
.group-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
@media (max-width: 768px) { .group-layout { grid-template-columns: 1fr; } }
.group-posts h2 { margin-bottom: 12px; font-size: 1.15rem; }
.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li { padding: 6px 0; font-size: 0.9rem; border-bottom: 1px solid #f0f2f5; display: flex; justify-content: space-between; align-items: center; }
.member-list li:last-child { border-bottom: none; }
.badge-private { background: #eee; color: #666; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.badge-role { background: #d1e7ff; color: var(--cc-primary); padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.badge-role-sm { background: #f0f2f5; color: #666; padding: 1px 6px; border-radius: 3px; font-size: 0.7rem; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.form-sub { color: #666; font-size: 0.9rem; margin-bottom: 20px; }

/* -- Polls -- */
.poll-container {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    background: #fafbfc;
}
.poll-question {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: #222;
}
.poll-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.poll-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.95rem;
}
.poll-option:hover { background: var(--cc-primary-soft); border-color: var(--cc-primary); }
.poll-option input { margin: 0; }
.poll-option.voted { background: #e6f2ff; border-color: var(--cc-primary); }
.poll-option-label { flex: 1; }

.poll-results { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.poll-result-row { padding: 4px 0; }
.poll-result-row.voted .poll-result-text { font-weight: 600; color: var(--cc-primary); }
.poll-result-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.poll-result-percent { color: #555; font-weight: 500; }
.poll-check { color: var(--cc-primary); font-weight: 700; }
.poll-results-bar-track {
    width: 100%;
    height: 8px;
    background: #e7ebef;
    border-radius: 4px;
    overflow: hidden;
}
.poll-results-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cc-primary), #3c91e6);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.poll-meta {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e7ebef;
}
.poll-revote-form { margin-top: 8px; }
.poll-revote-form summary { cursor: pointer; font-size: 0.85rem; }
.poll-add-prompt {
    margin: 12px 0;
    padding: 10px 14px;
    background: var(--cc-primary-soft);
    border: 1px dashed var(--cc-primary);
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}
.poll-options-fieldset { padding: 12px; border: 1px solid #e0e0e0; border-radius: 6px; }
.poll-options-fieldset legend { font-weight: 500; padding: 0 6px; }

/* =========================================
   SUPERADMIN PORTAL
   ========================================= */
.superadmin-shell { position: relative; }
.superadmin-nav {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #1a202c;
    color: #e2e8f0;
    padding: 16px 0;
    overflow-y: auto;
    z-index: 10;
}
.superadmin-nav .superadmin-brand {
    padding: 0 16px 16px;
    border-bottom: 1px solid #2d3748;
    margin-bottom: 12px;
}
.superadmin-nav .superadmin-brand strong { display: block; color: #fbbf24; font-size: 1.05rem; }
.superadmin-nav .superadmin-brand small { color: #a0aec0; font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; }
.superadmin-nav nav a {
    display: block;
    padding: 10px 16px;
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}
.superadmin-nav nav a:hover { background: #2d3748; color: #fff; }
.superadmin-nav nav a.active { background: #2d3748; color: #fbbf24; border-left-color: #fbbf24; }
.superadmin-nav .superadmin-footer {
    padding: 16px;
    border-top: 1px solid #2d3748;
    margin-top: 16px;
    position: sticky;
    bottom: 0;
    background: #1a202c;
}
.superadmin-nav .superadmin-footer a { color: #a0aec0; font-size: 0.82rem; text-decoration: none; }
.superadmin-nav .superadmin-footer a:hover { color: #fff; }

.superadmin-content {
    margin-left: 220px;
    padding: 20px 24px;
    max-width: none;
}
@media (max-width: 768px) {
    .superadmin-nav { position: relative; top: 0; width: 100%; height: auto; }
    .superadmin-nav nav { display: flex; overflow-x: auto; }
    .superadmin-nav nav a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
    .superadmin-nav nav a.active { border-bottom-color: #fbbf24; border-left-color: transparent; }
    .superadmin-nav .superadmin-footer { display: none; }
    .superadmin-content { margin-left: 0; padding: 16px; }
}

.superadmin-header { margin-bottom: 24px; }
.superadmin-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.superadmin-header .muted { color: #888; font-size: 0.9rem; }

.sa-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.sa-stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
}
.sa-stat-card.alert { border-color: #f56565; background: #fff5f5; }
.sa-stat-label { color: #718096; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.sa-stat-value { font-size: 1.75rem; font-weight: 700; color: #1a202c; margin: 4px 0; }
.sa-stat-card.alert .sa-stat-value { color: #c53030; }
.sa-stat-sub { color: #a0aec0; font-size: 0.75rem; }

.sa-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.sa-section h2 { font-size: 1.05rem; margin-bottom: 12px; color: #2d3748; }
.sa-section h3 { font-size: 0.95rem; margin-bottom: 6px; }
.sa-section .muted { color: #718096; font-size: 0.85rem; }

.sa-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .sa-grid-2 { grid-template-columns: 1fr; } }

.sa-list { list-style: none; padding: 0; }
.sa-list li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.sa-list li:last-child { border-bottom: 0; }

.sa-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.sa-filter-bar input, .sa-filter-bar select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}
.sa-filter-bar input[type="text"], .sa-filter-bar input[type="number"] { flex: 1; min-width: 180px; }

.sa-danger-zone { background: #fffaf0; border-color: #f6ad55; }
.sa-danger-zone h2 { color: #c05621; }

.sa-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.sa-action-form {
    padding: 12px;
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 6px;
}
.sa-action-form input, .sa-action-form select {
    width: 100%;
    padding: 6px 10px;
    margin: 6px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.sa-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
    padding: 10px 0;
}
.sa-bar { flex: 1; display: flex; flex-direction: column; align-items: center; }
.sa-bar-fill { width: 100%; background: linear-gradient(180deg, #4299e1, var(--cc-primary)); border-radius: 2px 2px 0 0; min-height: 2px; }
.sa-bar-label { font-size: 0.7rem; color: #888; margin-top: 2px; }

.sa-ext-grid { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sa-ext { padding: 3px 8px; border-radius: 10px; font-size: 0.75rem; font-family: monospace; }
.sa-ext.loaded { background: #c6f6d5; color: #22543d; }
.sa-ext.missing { background: #fed7d7; color: #822727; }

.sa-log {
    background: #1a202c;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.4;
    white-space: pre-wrap;
}

.data-table.compact { font-size: 0.85rem; }
.data-table.compact th, .data-table.compact td { padding: 6px 10px; }
.data-table.compact code.mono { font-family: 'SF Mono', Consolas, monospace; font-size: 0.75rem; color: #4299e1; }

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-active { background: #c6f6d5; color: #22543d; }
.badge-suspended { background: #fed7d7; color: #822727; }
.badge-archived { background: #e2e8f0; color: #4a5568; }
.badge-banned { background: #fed7d7; color: #822727; }
.badge-verified { background: #fef3c7; color: #92400e; }

/* Nav link for superadmin (visible only when is_platform_admin) */
.nav-superadmin {
    background: #fbbf24;
    color: #1a202c !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
}
.nav-superadmin:hover { background: #f59e0b; }

/* Impersonation banner */
.impersonation-banner {
    background: #fbbf24;
    color: #1a202c;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}
.impersonation-banner a { color: #1a202c; text-decoration: underline; }

/* Mobile floating "+" button for quick posting */
.fab-new-post {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: var(--cc-primary);
    color: #fff;
    text-decoration: none;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(26, 107, 196, 0.4);
    z-index: 50;
    border: none;
    cursor: pointer;
}
.fab-new-post:hover { background: var(--cc-primary-hover); text-decoration: none; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26, 107, 196, 0.5); }
@media (max-width: 1024px) {
    .fab-new-post { display: inline-flex; }
}

/* Prominent "New Post" nav button — always visible when in a neighborhood */
.nav-new-post {
    background: var(--cc-primary);
    color: #fff !important;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nav-new-post:hover { background: var(--cc-primary-hover); text-decoration: none; }

/* Always show FAB on mobile (960px and below) */
@media (max-width: 1024px) {
    .fab-new-post {
        display: inline-flex !important;
    }
    /* In mobile menu, the nav-new-post button gets full width */
    .main-nav.open .nav-new-post {
        text-align: center;
        justify-content: center;
        margin: 8px 0;
        padding: 10px;
    }
}

/* =========================================
   FACEBOOK-STYLE FEED (cranterbury.clubcity.org/)
   ========================================= */
.fb-feed {
    max-width: 680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 1100px) {
    .fb-feed {
        max-width: 980px;
        grid-template-columns: 1fr 280px;
        grid-template-areas: "composer sidebar" "toolbar sidebar" "posts sidebar";
        align-items: start;
    }
    .fb-composer { grid-area: composer; }
    .fb-feed-toolbar { grid-area: toolbar; }
    .fb-feed-posts { grid-area: posts; }
    .fb-sidebar { grid-area: sidebar; position: sticky; top: 72px; }
}

/* Avatars */
.fb-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #e4e6eb;
}
.fb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-avatar .avatar-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--cc-primary); color: #fff; font-weight: 600;
}
.fb-avatar.sm { width: 32px; height: 32px; }
.fb-avatar.sm .avatar-placeholder { font-size: 0.8rem; }

/* Composer card */
.fb-composer {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.fb-composer-collapsed {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f2f5;
}
.fb-composer-trigger {
    flex: 1;
    background: #f0f2f5;
    border: none;
    padding: 10px 16px;
    border-radius: 24px;
    color: #65676b;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
}
.fb-composer-trigger:hover { background: #e4e6eb; }

.fb-composer-actions {
    display: flex;
    gap: 2px;
    padding-top: 8px;
}
.fb-action {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    color: #65676b;
    text-decoration: none;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.fb-action:hover { background: #f0f2f5; text-decoration: none; color: var(--cc-primary); }
.fb-action-icon { font-size: 1.1rem; }
@media (max-width: 480px) {
    .fb-action-label { display: none; }
    .fb-action { padding: 10px 6px; }
}

/* Expanded composer */
.fb-composer-expanded {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f2f5;
}
.fb-composer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
}
.fb-composer-author strong { display: block; font-size: 0.9rem; color: #050505; }
.fb-type-select {
    margin-top: 2px;
    padding: 2px 8px;
    border: 1px solid #e4e6eb;
    border-radius: 4px;
    background: #f0f2f5;
    font-size: 0.8rem;
    font-family: inherit;
    color: #65676b;
}
.fb-composer-close {
    position: absolute;
    top: 0; right: 0;
    background: #f0f2f5;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    color: #65676b;
}
.fb-composer-close:hover { background: #e4e6eb; }

.fb-title-input {
    width: 100%;
    border: none;
    padding: 6px 0;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    background: transparent;
    border-bottom: 1px solid #f0f2f5;
}
.fb-title-input:focus { outline: none; border-bottom-color: var(--cc-primary); }

.fb-body-input {
    width: 100%;
    border: none;
    padding: 12px 0;
    font-size: 1.1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: transparent;
}
.fb-body-input:focus { outline: none; }

.fb-composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f2f5;
}
.fb-composer-add { display: flex; align-items: center; gap: 10px; }
.fb-composer-add-label { font-size: 0.85rem; color: #65676b; font-weight: 500; }
.fb-composer-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f0f2f5;
    cursor: pointer;
    font-size: 1.1rem;
}
.fb-composer-add-btn:hover { background: #e4e6eb; }
.fb-post-btn { padding: 6px 28px !important; font-size: 0.9rem; font-weight: 600; border-radius: 6px; }

/* Login prompt (not signed in) */
.fb-login-prompt {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #65676b;
}

/* Feed toolbar — sort tabs */
.fb-feed-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
}
.fb-sort-tabs { display: flex; gap: 4px; }
.fb-sort-tabs a {
    padding: 6px 12px;
    border-radius: 16px;
    color: #65676b;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}
.fb-sort-tabs a:hover { background: #e4e6eb; text-decoration: none; }
.fb-sort-tabs a.active {
    background: var(--cc-primary);
    color: #fff;
}
.fb-type-filter select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 0.85rem;
    color: #65676b;
    cursor: pointer;
}

/* Post cards */
.fb-feed-posts { display: flex; flex-direction: column; gap: 12px; }

.fb-post-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    /* overflow intentionally `visible` so absolutely-positioned children
       like the 3-dot .post-menu dropdown aren't clipped by the card.
       Inner media (.attachment-grid) handles its own rounded clipping. */
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.fb-post-card.pinned {
    border-left: 3px solid #f0ad4e;
}
.fb-pinned-badge {
    padding: 6px 16px;
    background: #fff8e1;
    color: #856404;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #ffe69c;
}

/* Post header */
.fb-post-header {
    display: flex;
    gap: 10px;
    padding: 12px 14px 8px;
    align-items: flex-start;
}
.fb-post-header-main { flex: 1; min-width: 0; }
.fb-post-author {
    color: #050505;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}
.fb-post-author:hover { text-decoration: underline; color: var(--cc-primary); }
.fb-post-meta {
    font-size: 0.78rem;
    color: #65676b;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.fb-post-meta a { color: #65676b; text-decoration: none; }
.fb-post-meta a:hover { text-decoration: underline; }
.fb-post-menu-btn {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    font-size: 1.4rem;
    width: 32px; height: 32px;
    border-radius: 50%;
    line-height: 1;
    padding: 0;
}
.fb-post-menu-btn:hover { background: #f0f2f5; }

/* Post body */
.fb-post-body-link {
    display: block;
    padding: 0 14px 10px;
    color: inherit;
    text-decoration: none;
}
.fb-post-body-link:hover { text-decoration: none; }
.fb-post-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #050505;
    margin-bottom: 6px;
    line-height: 1.3;
}
.fb-post-body {
    color: #050505;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.fb-post-body .mention,
.fb-post-body .hashtag {
    color: var(--cc-primary);
    font-weight: 500;
    text-decoration: none;
    background: #eef5fc;
    padding: 1px 4px;
    border-radius: 3px;
}
.fb-post-body .mention:hover,
.fb-post-body .hashtag:hover { background: #d9e9f9; }

/* Stats bar */
.fb-post-stats {
    display: flex;
    justify-content: space-between;
    padding: 6px 14px;
    border-top: 1px solid #f0f2f5;
    font-size: 0.82rem;
    color: #65676b;
}
.fb-reaction-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}
.fb-reaction-icon {
    background: #e41e4f;
    color: #fff;
    border-radius: 50%;
    width: 18px; height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}
.fb-comment-stat { color: #65676b; text-decoration: none; }
.fb-comment-stat:hover { text-decoration: underline; }

/* Action bar */
.fb-post-actions {
    display: flex;
    padding: 4px 8px;
    border-top: 1px solid #f0f2f5;
    border-bottom: 1px solid #f0f2f5;
}
.fb-action-form { flex: 1; margin: 0; }
.fb-action-btn {
    flex: 1;
    width: 100%;
    background: none;
    border: none;
    padding: 8px;
    color: #65676b;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 4px;
    text-decoration: none;
    font-family: inherit;
}
.fb-action-btn:hover { background: #f0f2f5; text-decoration: none; color: #050505; }
.fb-action-form .fb-action-btn.active {
    color: #e41e4f;
}

/* Quick comment */
.fb-quick-comment {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    align-items: center;
}
.fb-quick-comment input[type="text"] {
    flex: 1;
    background: #f0f2f5;
    border: 1px solid transparent;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    font-family: inherit;
}
.fb-quick-comment input[type="text"]:focus {
    outline: none;
    background: #fff;
    border-color: var(--cc-primary);
}
.fb-quick-submit {
    background: none;
    border: none;
    color: var(--cc-primary);
    font-size: 1.1rem;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
}
.fb-quick-submit:hover { background: #e7f0fa; }

/* Sidebar */
.fb-sidebar { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 1100px) { .fb-sidebar { display: none; } }

/* Empty state in FB feed */
.fb-feed-posts .empty-state {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 40px 20px;
}

/* Hide old .feed-layout sidebar on FB feed */
.fb-feed .feed-sidebar { display: none; }

/* =========================================
   MODERN REFINEMENTS — override + polish
   These come last so they win the cascade.
   ========================================= */

/* Global button baseline */
body .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--cc-r-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: background var(--cc-t-fast), color var(--cc-t-fast), border-color var(--cc-t-fast), box-shadow var(--cc-t-fast), transform var(--cc-t-fast);
    font-family: var(--cc-font);
}
body .btn:hover { text-decoration: none; transform: translateY(-1px); }
body .btn:active { transform: translateY(0); }
body .btn-primary {
    background: var(--cc-primary);
    color: #fff;
    box-shadow: var(--cc-shadow-sm);
}
body .btn-primary:hover { background: var(--cc-primary-hover); box-shadow: var(--cc-shadow-md); }
body .btn-outline {
    background: transparent;
    border-color: var(--cc-border-2);
    color: var(--cc-ink-2);
}
body .btn-outline:hover { background: var(--cc-surface-2); border-color: var(--cc-primary); color: var(--cc-primary); }
body .btn-sm { padding: 6px 12px; font-size: 0.8rem; }
body .btn-lg { padding: 12px 24px; font-size: 1rem; border-radius: var(--cc-r); }

/* Site header — softer */
body .site-header {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--cc-border);
    box-shadow: none;
}
body .site-logo strong { color: var(--cc-ink); letter-spacing: -0.01em; }
body .logo-sub { color: var(--cc-muted-2); }
body .main-nav a { color: var(--cc-muted); transition: color var(--cc-t-fast); }
body .main-nav a:hover { color: var(--cc-primary); text-decoration: none; }
body .nav-new-post {
    background: var(--cc-primary);
    color: #fff !important;
    padding: 7px 14px;
    border-radius: var(--cc-r-full);
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: all var(--cc-t-fast);
}
body .nav-new-post:hover { background: var(--cc-primary-hover); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35); transform: translateY(-1px); }
body .nav-superadmin {
    background: #111827;
    color: #fbbf24 !important;
    padding: 5px 10px;
    border-radius: var(--cc-r-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
body .nav-superadmin:hover { background: #1f2937; }

/* Alerts — softer, floating */
body .alert {
    border: none;
    border-radius: var(--cc-r);
    padding: 12px 16px;
    margin: 16px auto;
    max-width: 680px;
    box-shadow: var(--cc-shadow-md);
    font-size: 0.9rem;
    font-weight: 500;
}
body .alert-success { background: #ecfdf5; color: #065f46; }
body .alert-error   { background: #fef2f2; color: #991b1b; }
body .alert-info    { background: #eff6ff; color: #1e40af; }

/* ==========================================
   FACEBOOK-STYLE FEED — MODERN OVERRIDES
   ========================================== */

body .fb-composer {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 14px 16px;
    box-shadow: var(--cc-shadow-sm);
    transition: box-shadow var(--cc-t-fast);
}
body .fb-composer:hover { box-shadow: var(--cc-shadow-md); }

body .fb-composer-trigger {
    background: var(--cc-surface-3);
    border: none;
    padding: 11px 18px;
    border-radius: var(--cc-r-full);
    color: var(--cc-muted);
    font-size: 0.95rem;
    font-family: var(--cc-font);
    transition: background var(--cc-t-fast);
}
body .fb-composer-trigger:hover { background: var(--cc-border); }

body .fb-composer-collapsed { border-bottom: 1px solid var(--cc-divider); }

body .fb-action {
    color: var(--cc-muted);
    font-weight: 500;
    border-radius: var(--cc-r-sm);
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
body .fb-action:hover { background: var(--cc-surface-3); color: var(--cc-ink); }

body .fb-body-input:focus { outline: none; }
body .fb-title-input:focus { border-bottom-color: var(--cc-primary); }

/* Sort tabs — modern pill set */
body .fb-feed-toolbar {
    padding: 4px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-full);
    box-shadow: var(--cc-shadow-xs);
}
body .fb-sort-tabs a {
    padding: 7px 14px;
    border-radius: var(--cc-r-full);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--cc-muted);
    transition: all var(--cc-t-fast);
}
body .fb-sort-tabs a:hover { background: var(--cc-surface-3); color: var(--cc-ink); text-decoration: none; }
body .fb-sort-tabs a.active {
    background: var(--cc-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
body .fb-type-filter select {
    background: transparent;
    border: none;
    padding: 7px 10px;
    color: var(--cc-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

/* Post card — modern */
body .fb-post-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-xs);
    transition: box-shadow var(--cc-t-fast), transform var(--cc-t-fast);
    /* overflow stays visible — see note above */
}
body .fb-post-card:hover {
    box-shadow: var(--cc-shadow-md);
}

/* Pinned — subtle gold accent, not shouty */
body .fb-post-card.pinned {
    border-left: none;
    border-top: 3px solid #fbbf24;
}
body .fb-pinned-badge {
    background: transparent;
    color: #b45309;
    padding: 6px 16px 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Post header — tighter, elegant */
body .fb-post-header { padding: 14px 16px 6px; gap: 12px; }
body .fb-post-author {
    font-weight: 600;
    color: var(--cc-ink);
    letter-spacing: -0.005em;
    font-size: 0.95rem;
}
body .fb-post-author:hover { color: var(--cc-primary); text-decoration: none; }
body .fb-post-meta {
    font-size: 0.78rem;
    color: #555555;  /* ~7:1 on #fff — safer for 12px text */
    margin-top: 2px;
}
body .fb-post-menu-btn {
    color: var(--cc-muted);
    width: 44px; height: 44px;  /* WCAG 2.5.5 target size */
    padding: 0;
    border-radius: var(--cc-r-full);
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
body .fb-post-menu-btn:hover { background: var(--cc-surface-3); color: var(--cc-ink); }

/* Type badges — soft pills, sentence case */
body .thread-type {
    padding: 2px 10px;
    border-radius: var(--cc-r-full);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    background: var(--cc-surface-3);
    color: var(--cc-muted);
    border: 1px solid var(--cc-border);
}
/* Type badges — contrast-safe (all colors pass WCAG AA ≥ 4.5:1 on their backgrounds) */
body .thread-type.type-announcement { background: #fef3c7; color: #78350f; border-color: #fde68a; }
body .thread-type.type-question     { background: #dbeafe; color: #1e3a8a; border-color: #bfdbfe; }
body .thread-type.type-alert        { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }
body .thread-type.type-recommendation { background: #d1fae5; color: #064e3b; border-color: #a7f3d0; }
body .thread-type.type-lost_found   { background: #ede9fe; color: #4c1d95; border-color: #ddd6fe; }
body .thread-type.type-general      { background: var(--cc-surface-3); color: var(--cc-muted); }

body .activity-indicator {
    color: #d97706;
    font-weight: 500;
}

/* Post body */
body .fb-post-body-link { padding: 0 16px 12px; }
body .fb-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--cc-ink);
    margin-bottom: 6px;
}
body .fb-post-body {
    color: var(--cc-ink-2);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Mentions + hashtags */
body .mention, body .hashtag {
    color: var(--cc-primary);
    font-weight: 500;
    text-decoration: none;
    background: var(--cc-primary-soft);
    padding: 1px 5px;
    border-radius: var(--cc-r-xs);
    transition: background var(--cc-t-fast);
}
body .mention:hover, body .hashtag:hover { background: #dbeafe; text-decoration: none; }

/* Stats bar */
body .fb-post-stats {
    padding: 8px 16px;
    border-top: 1px solid var(--cc-divider);
    font-size: 0.82rem;
    color: var(--cc-muted);
}
body .fb-reaction-icon {
    background: var(--cc-like);
    color: #fff;
    font-size: 0.7rem;
    width: 18px; height: 18px;
}
body .fb-comment-stat { color: var(--cc-muted); }
body .fb-comment-stat:hover { color: var(--cc-primary); text-decoration: none; }

/* Action bar — prominent buttons with icons + labels */
body .fb-post-actions {
    padding: 4px 8px;
    border-top: 1px solid var(--cc-divider);
    border-bottom: none;
    gap: 2px;
}
body .fb-action-btn {
    padding: 9px 8px;
    border-radius: var(--cc-r-sm);
    color: var(--cc-muted);
    font-weight: 500;
    font-size: 0.88rem;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
body .fb-action-btn:hover {
    background: var(--cc-surface-3);
    color: var(--cc-ink);
    text-decoration: none;
}
body .fb-action-btn .fb-action-icon {
    font-size: 1.15rem;
    line-height: 1;
    transition: transform var(--cc-t-fast);
}
body .fb-action-btn:hover .fb-action-icon { transform: scale(1.1); }
body .fb-action-btn:active .fb-action-icon { transform: scale(0.95); }
body .fb-action-form .fb-action-btn.active {
    color: var(--cc-like);
    background: rgba(224, 36, 94, 0.07);
}
body .fb-action-form .fb-action-btn.active .fb-action-icon { animation: cc-heart-pop 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cc-heart-pop {
    0%   { transform: scale(0.8); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1.1); }
}

/* Quick comment bar */
body .fb-quick-comment {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--cc-divider);
}
body .fb-quick-comment input[type="text"] {
    background: var(--cc-surface-3);
    border: 1px solid transparent;
    padding: 9px 16px;
    border-radius: var(--cc-r-full);
    font-size: 0.9rem;
    transition: background var(--cc-t-fast), border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
body .fb-quick-comment input[type="text"]:focus {
    background: var(--cc-surface);
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
body .fb-quick-submit {
    color: var(--cc-primary);
    font-size: 1.05rem;
    width: 36px; height: 36px;
    border-radius: var(--cc-r-full);
    transition: background var(--cc-t-fast);
}
body .fb-quick-submit:hover { background: var(--cc-primary-soft); }

/* Sidebar cards — softer */
body .fb-sidebar .sidebar-card,
body .sidebar-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 14px 16px;
    box-shadow: var(--cc-shadow-xs);
}
body .sidebar-card h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cc-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

/* FAB — don't overlap comment input on mobile */
body .fab-new-post {
    background: var(--cc-primary);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35), 0 2px 4px rgba(37, 99, 235, 0.20);
    transition: all var(--cc-t-fast);
    font-size: 1.6rem;
    bottom: 24px;
    right: 16px;
    width: 52px;
    height: 52px;
}
body .fab-new-post:hover {
    background: var(--cc-primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

/* Site footer */
body .site-footer {
    background: transparent;
    border-top: 1px solid var(--cc-border);
    color: var(--cc-muted-2);
    margin-top: var(--cc-s-10);
    padding: 20px 16px 40px;
}
body .footer-meta a { color: var(--cc-muted-2); transition: color var(--cc-t-fast); }
body .footer-meta a:hover { color: var(--cc-primary); }

/* Forms — modern */
body .form-standard input[type="text"],
body .form-standard input[type="email"],
body .form-standard input[type="password"],
body .form-standard input[type="url"],
body .form-standard input[type="tel"],
body .form-standard input[type="number"],
body .form-standard input[type="datetime-local"],
body .form-standard textarea,
body .form-standard select {
    padding: 10px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r-sm);
    background: var(--cc-surface);
    font-size: 0.92rem;
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
    font-family: var(--cc-font);
}
body .form-standard input:focus,
body .form-standard textarea:focus,
body .form-standard select:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
body .form-standard label { font-weight: 500; color: var(--cc-ink); margin-bottom: 6px; }
body .form-standard small { color: var(--cc-muted); }

/* Data tables */
body .data-table {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    box-shadow: var(--cc-shadow-xs);
    overflow: hidden;
}
body .data-table th {
    background: var(--cc-surface-2);
    color: var(--cc-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--cc-border);
}
body .data-table td { border-bottom: 1px solid var(--cc-divider); font-size: 0.9rem; }
body .data-table tr:last-child td { border-bottom: none; }
body .data-table tr:hover td { background: var(--cc-surface-2); }

/* Conversation thread (post detail) — modern */
body .thread-op, body .reply-composer {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-xs);
}
body .comment-node:hover { background: var(--cc-surface-2); }
body .comment-thread .comment-replies { border-left-color: var(--cc-border); }

/* Dot separators */
body .dot { color: var(--cc-muted-2); }

/* Avatars — subtle shadow */
body .fb-avatar img,
body .thread-avatar img,
body .comment-avatar img {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* New activity pill — refined */
body .new-activity-pill {
    background: var(--cc-primary);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    font-weight: 600;
    letter-spacing: -0.005em;
}
body .new-activity-pill:hover { background: var(--cc-primary-hover); }

/* Superadmin — modern dark */
body .superadmin-nav {
    background: #0f172a;
    border-right: 1px solid #1e293b;
}
body .superadmin-nav nav a { transition: all var(--cc-t-fast); }
body .superadmin-nav nav a:hover { background: #1e293b; }
body .superadmin-nav nav a.active {
    background: #1e293b;
    border-left-color: #fbbf24;
    color: #fbbf24;
}
body .sa-stat-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-xs);
    transition: all var(--cc-t-fast);
}
body .sa-stat-card:hover {
    box-shadow: var(--cc-shadow-md);
    transform: translateY(-2px);
}
body .sa-stat-value {
    font-weight: 700;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}
body .sa-section {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-xs);
}

/* Scrollbar styling (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cc-surface-2); }
::-webkit-scrollbar-thumb { background: var(--cc-border-2); border-radius: var(--cc-r-full); border: 2px solid var(--cc-surface-2); }
::-webkit-scrollbar-thumb:hover { background: var(--cc-muted-2); }

/* Focus outlines — only on keyboard */
*:focus { outline: none; }
*:focus-visible { outline: 2px solid var(--cc-primary); outline-offset: 2px; border-radius: var(--cc-r-xs); }

/* Better selection */
::selection { background: var(--cc-primary-soft); color: var(--cc-primary-hover); }

/* ==== Mobile tweaks ==== */
@media (max-width: 640px) {
    body .fb-post-actions .fb-action-label { font-size: 0.8rem; }
    body .fb-composer { border-radius: var(--cc-r); }
    body .fb-post-card { border-radius: var(--cc-r); }
    body .fab-new-post { bottom: 20px; right: 16px; }
    /* When the page has visible quick-comment inputs, raise the FAB */
    body .fb-feed-posts .fb-quick-comment:last-of-type { margin-bottom: 60px; }
    body .site-header { backdrop-filter: none; background: #fff; }
}

/* =========================================
   IMAGE ATTACHMENTS — tighter, modern sizing
   ========================================= */

/* Constrain single images much more aggressively */
body .attachment-grid {
    margin: 12px 0 0;
    border-radius: var(--cc-r);
    gap: 4px;
}
body .attachment-grid.count-1 {
    max-width: 480px;
}
body .attachment-grid.count-1 .attachment-tile {
    aspect-ratio: auto;
    background: var(--cc-surface-3);
}
body .attachment-grid.count-1 .attachment-tile img {
    max-height: 440px;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0 auto;
    background: var(--cc-surface-3);
    object-fit: contain;
    display: block;
}

/* Comments get even more constrained images */
body .attachment-grid.comment {
    max-width: 360px;
    margin: 8px 0 0;
}
body .attachment-grid.comment.count-1 .attachment-tile img {
    max-height: 260px;
}

/* Multi-image grids */
body .attachment-grid.count-2 .attachment-tile,
body .attachment-grid.count-3 .attachment-tile,
body .attachment-grid.count-4 .attachment-tile {
    aspect-ratio: 1 / 1;
    max-height: 220px;
}
body .attachment-tile {
    border-radius: var(--cc-r-sm);
    border: 1px solid var(--cc-border);
    box-shadow: var(--cc-shadow-xs);
    cursor: zoom-in;
    transition: transform var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
body .attachment-tile:hover {
    transform: none;
    box-shadow: var(--cc-shadow-md);
}
body .attachment-tile::after {
    content: "⤢";
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(17, 24, 39, 0.7);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: var(--cc-r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity var(--cc-t-fast);
    pointer-events: none;
}
body .attachment-tile:hover::after { opacity: 1; }
body .attachment-tile.attachment-pdf::after,
body .attachment-tile.attachment-file::after { content: none; }

/* Mobile — even tighter */
@media (max-width: 640px) {
    body .attachment-grid.count-1 .attachment-tile img { max-height: 340px; }
    body .attachment-grid.comment.count-1 .attachment-tile img { max-height: 220px; }
    body .attachment-grid.count-2 .attachment-tile,
    body .attachment-grid.count-3 .attachment-tile,
    body .attachment-grid.count-4 .attachment-tile { max-height: 160px; }
}

/* =========================================
   COMPOSER TOOLBAR — better layout
   ========================================= */

/* Thread reply composer (on post detail) */
body .composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cc-s-3);
    flex-wrap: wrap;
}
body .composer-toolbar .composer-hint {
    display: flex;
    align-items: center;
    gap: var(--cc-s-2);
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--cc-muted);
}
body .composer-hint .btn-attach {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--cc-surface-3);
    border-radius: var(--cc-r-full);
    color: var(--cc-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
    white-space: nowrap;
}
body .composer-hint .btn-attach:hover {
    background: var(--cc-primary-soft);
    color: var(--cc-primary);
}

/* Hide the "Be kind / neighborly" text on tight screens */
@media (max-width: 480px) {
    body .composer-hint {
        font-size: 0;
    }
    body .composer-hint .btn-attach {
        font-size: 0.8rem;
    }
}

/* Reply composer (main post detail) */
body .reply-composer {
    padding: 14px 16px;
    gap: var(--cc-s-3);
}
body .reply-composer .composer-form textarea {
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    padding: 10px 14px;
    font-size: 0.95rem;
    min-height: 44px;
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
body .reply-composer .composer-form textarea:focus {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
    outline: none;
}

/* =========================================
   THREAD DETAIL POLISH
   ========================================= */
body .thread-op {
    padding: 20px;
    gap: 14px;
}
body .thread-avatar img,
body .thread-avatar .avatar-placeholder {
    width: 44px; height: 44px;
    border-radius: var(--cc-r-full);
}
body .thread-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--cc-ink);
    margin: 4px 0 12px;
}
body .thread-body {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--cc-ink-2);
    word-wrap: break-word;
}

/* Action chips (post detail) */
body .action-chip {
    padding: 7px 12px;
    border-radius: var(--cc-r-full);
    background: transparent;
    color: var(--cc-muted);
    font-size: 0.83rem;
    font-weight: 500;
    border: none;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
body .action-chip:hover {
    background: var(--cc-surface-3);
    color: var(--cc-ink);
    text-decoration: none;
}
body .action-chip.active {
    background: rgba(224, 36, 94, 0.08);
    color: var(--cc-like);
    font-weight: 600;
}
body .action-chip.active:hover { background: rgba(224, 36, 94, 0.14); }
body .action-chip.danger:hover { background: rgba(239, 68, 68, 0.08); color: var(--cc-danger); }
body .action-chip.sm { padding: 4px 10px; font-size: 0.78rem; }
body .chip-icon { font-size: 1em; line-height: 1; }
body .chip-count { font-variant-numeric: tabular-nums; }

/* Conversation header */
body .conversation-header {
    padding: 14px 4px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--cc-divider);
}
body .conversation-header h2 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cc-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
body .conversation-actions .btn-link {
    color: var(--cc-muted);
    font-size: 0.78rem;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}
body .conversation-actions .btn-link:hover { color: var(--cc-primary); }

/* Comment nodes */
body .comment-node {
    padding: 10px;
    gap: 10px;
    border-radius: var(--cc-r);
    transition: background var(--cc-t-fast);
}
body .comment-node:hover { background: var(--cc-surface-2); }
body .comment-avatar img,
body .comment-avatar .avatar-placeholder {
    width: 36px; height: 36px;
    border-radius: var(--cc-r-full);
}
body .comment-author strong {
    color: var(--cc-ink);
    font-weight: 600;
    font-size: 0.9rem;
}
body .comment-author:hover strong { color: var(--cc-primary); text-decoration: none; }
body .comment-meta {
    font-size: 0.78rem;
    color: var(--cc-muted);
    margin-bottom: 4px;
}
body .comment-body {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--cc-ink-2);
}

/* Inline reply form */
body .inline-reply {
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    padding: 12px;
    margin: 8px 0 0;
}
body .inline-reply textarea {
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r-sm);
    padding: 8px 10px;
    font-size: 0.9rem;
    min-height: 64px;
}
body .inline-reply textarea:focus { border-color: var(--cc-primary); box-shadow: var(--cc-shadow-focus); outline: none; }
body .inline-reply-to {
    font-size: 0.78rem;
    color: var(--cc-muted);
    margin-bottom: 6px;
}
body .inline-reply-to strong { color: var(--cc-primary); }

/* Continue thread link */
body .continue-thread {
    background: var(--cc-primary-soft);
    color: var(--cc-primary);
    border: 1px dashed rgba(37, 99, 235, 0.3);
    border-radius: var(--cc-r);
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    margin: 6px 0 6px 24px;
    transition: all var(--cc-t-fast);
}
body .continue-thread:hover {
    background: var(--cc-primary);
    color: #fff;
    border-color: var(--cc-primary);
    text-decoration: none;
}

/* Empty conversation state */
body .empty-conversation {
    background: var(--cc-surface);
    border: 1px dashed var(--cc-border-2);
    border-radius: var(--cc-r-md);
    color: var(--cc-muted);
    padding: 32px 20px;
}
body .empty-conversation strong { color: var(--cc-primary); }

/* Locked notice */
body .locked-notice {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: var(--cc-r);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 500;
}

/* Reply prompt (logged out) */
body .reply-prompt {
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    padding: 16px;
    color: var(--cc-muted);
    font-size: 0.88rem;
    text-align: center;
}

/* Profile page refinements */
body .profile-header {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 20px;
    box-shadow: var(--cc-shadow-xs);
    margin-bottom: 16px;
}
body .profile-avatar img,
body .profile-avatar .avatar-placeholder {
    width: 88px; height: 88px;
    border-radius: var(--cc-r-full);
    box-shadow: var(--cc-shadow-sm);
}
body .profile-info h1 {
    font-size: 1.35rem;
    letter-spacing: -0.015em;
    margin-bottom: 2px;
}
body .profile-username { color: var(--cc-muted); font-weight: 500; }
body .profile-bio { color: var(--cc-ink-2); margin: 8px 0; }
body .profile-meta, body .profile-trust { font-size: 0.78rem; color: var(--cc-muted-2); }

/* Events — modern card */
body .event-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-xs);
    padding: 16px;
    transition: box-shadow var(--cc-t-fast), transform var(--cc-t-fast);
}
body .event-card:hover {
    box-shadow: var(--cc-shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}
body .event-date-badge {
    border-radius: var(--cc-r);
    background: linear-gradient(180deg, var(--cc-primary) 0%, var(--cc-primary-hover) 100%);
    padding: 8px 12px;
    min-width: 52px;
    box-shadow: var(--cc-shadow-sm);
}
body .event-month {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}
body .event-day { font-size: 1.4rem; font-weight: 700; color: #fff; }

/* Classifieds — modern card */
body .classified-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 14px;
    box-shadow: var(--cc-shadow-xs);
    transition: all var(--cc-t-fast);
}
body .classified-card:hover {
    box-shadow: var(--cc-shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}
body .classified-category {
    background: var(--cc-surface-3);
    color: var(--cc-muted);
    border-radius: var(--cc-r-full);
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 500;
}
body .classified-card h3 {
    color: var(--cc-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 8px 0 4px;
}
body .classified-price {
    color: var(--cc-success);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
body .classified-price.free { color: var(--cc-primary); }

/* Neighborhood cards (browse page) */
body .neighborhood-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 18px;
    box-shadow: var(--cc-shadow-xs);
    transition: all var(--cc-t-fast);
}
body .neighborhood-card:hover {
    box-shadow: var(--cc-shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
    border-color: var(--cc-primary);
}
body .neighborhood-card h3 {
    color: var(--cc-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

/* Landing hero */
body .landing-hero {
    padding: 56px 16px 40px;
}
body .landing-hero h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--cc-ink);
    margin-bottom: 12px;
}
body .hero-sub {
    font-size: 1.1rem;
    color: var(--cc-muted);
    margin-bottom: 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
body .how-it-works .step {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 24px 20px;
    box-shadow: var(--cc-shadow-xs);
    transition: all var(--cc-t-fast);
}
body .how-it-works .step:hover {
    box-shadow: var(--cc-shadow-md);
    transform: translateY(-2px);
}
body .step-num {
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-accent));
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Page headers */
body .page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cc-ink);
}

/* Auth forms */
body .auth-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 32px;
    box-shadow: var(--cc-shadow-lg);
}
body .auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 20px;
    text-align: center;
}
body .auth-link {
    color: var(--cc-muted);
    font-size: 0.85rem;
    margin-top: 16px;
}
body .auth-link a { color: var(--cc-primary); font-weight: 500; }

/* Trending list */
body .trending-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--cc-divider);
    font-size: 0.88rem;
}
body .trending-list li:last-child { border-bottom: 0; }
body .trending-count {
    color: var(--cc-muted-2);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* Events sidebar list */
body .event-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--cc-divider);
    font-size: 0.85rem;
}
body .event-list li:last-child { border-bottom: 0; }
body .event-list a { color: var(--cc-ink); }
body .event-list strong { display: block; font-weight: 500; }
body .event-date { color: var(--cc-muted); font-size: 0.78rem; }

/* Nav badge (notifications) */
body .nav-badge {
    background: var(--cc-danger);
    font-size: 0.7rem;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* =========================================
   SPRINT 1 — WCAG touch targets (2.5.5 ≥ 44×44 px)
   ========================================= */

/* action-chip.sm — raise from 20×32 to WCAG-compliant */
body .action-chip.sm {
    padding: 7px 12px;
    font-size: 0.78rem;
    min-height: 36px;  /* compact chips stay usable */
}

/* fb-action-btn — bulk up on mobile for comfortable tapping */
@media (max-width: 640px) {
    body .fb-action-btn {
        padding: 12px 8px;
        min-height: 44px;
        font-size: 0.85rem;
    }
    body .fb-action-btn .fb-action-icon { font-size: 1.2rem; }
}

/* comment-collapse — icon-only button was too tight */
body .comment-collapse {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--cc-r-xs);
    margin-top: 4px;
}

/* Reduced motion support — respects user's accessibility preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skip link — only visible on keyboard focus */
.skip-link {
    position: absolute;
    top: -48px;
    left: 12px;
    background: var(--cc-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 0 0 var(--cc-r) var(--cc-r);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    transition: top var(--cc-t-fast);
}
.skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: 0; }

/* Screen-reader-only (for hidden labels) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   SPRINT 2 — mobile fixes + iPhone SE fallback
   ========================================= */

/* Data tables overflow cleanly on mobile */
@media (max-width: 768px) {
    body .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    body .data-table tbody,
    body .data-table thead { display: table; width: 100%; }
    body .data-table tr { display: table-row; }
    body .data-table th,
    body .data-table td { display: table-cell; }
}

/* 375px iPhone SE fallback */
@media (max-width: 380px) {
    body .fb-composer-trigger { font-size: 0.88rem; padding: 9px 12px; }
    body .fb-action-btn { padding: 10px 4px; gap: 3px; }
    body .fb-action-btn .fb-action-label { font-size: 0.78rem; }
    body .action-chip { padding: 6px 10px; font-size: 0.78rem; }
    body .fb-post-header { padding: 12px 12px 6px; gap: 10px; }
    body .fb-post-body-link { padding: 0 12px 10px; }
    body .fb-quick-comment { padding: 8px 12px 10px; }
}

/* Flash message close button */
.alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    float: right;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 4px;
    margin-left: 12px;
    transition: opacity var(--cc-t-fast);
}
.alert-close:hover { opacity: 1; }

/* Inline field error (for per-field validation) */
.field-error {
    display: block;
    color: #991b1b;
    background: #fef2f2;
    border-left: 3px solid var(--cc-danger);
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: 0 var(--cc-r-xs) var(--cc-r-xs) 0;
    font-size: 0.82rem;
    font-weight: 500;
}
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: var(--cc-danger);
    background: #fef8f8;
}
.form-group.has-error input:focus,
.form-group.has-error textarea:focus,
.form-group.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    border-color: var(--cc-danger);
}

/* Auth subtitle under h1 */
body .auth-card .auth-subtitle {
    text-align: center;
    color: var(--cc-muted);
    font-size: 0.92rem;
    margin: -12px 0 20px;
}

/* =========================================
   MODAL DIALOGS (cc-modal)
   Desktop: centered panel, dim backdrop
   Mobile: bottom sheet that slides up
   ========================================= */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--cc-t-med);
    pointer-events: none;
}
.cc-modal.open {
    opacity: 1;
    pointer-events: auto;
}
.cc-modal[hidden] { display: none; }

.cc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cc-modal-panel {
    position: relative;
    background: var(--cc-surface);
    border-radius: var(--cc-r-lg);
    box-shadow: var(--cc-shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    margin: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(8px);
    transition: transform var(--cc-t-med);
}
.cc-modal.open .cc-modal-panel { transform: scale(1) translateY(0); }

/* Header */
.cc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--cc-divider);
    flex-shrink: 0;
}
.cc-modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cc-ink);
    margin: 0;
    letter-spacing: -0.01em;
}
.cc-modal-close {
    background: var(--cc-surface-3);
    border: none;
    width: 36px; height: 36px;
    border-radius: var(--cc-r-full);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: var(--cc-muted);
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cc-modal-close:hover { background: var(--cc-border); color: var(--cc-ink); }

/* Body */
.cc-modal-body {
    padding: 16px 20px 12px;
    overflow-y: auto;
    flex: 1;
}

/* Author row (post/question) */
.cc-modal-author {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}
.cc-modal-author strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--cc-ink);
    margin-bottom: 2px;
}

/* Inputs inside modal */
.cc-modal-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--cc-divider);
    padding: 10px 0;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--cc-font);
    background: transparent;
    transition: border-color var(--cc-t-fast);
}
.cc-modal-input:focus {
    outline: none;
    border-bottom-color: var(--cc-primary);
}

.cc-modal-textarea {
    width: 100%;
    border: none;
    padding: 14px 0 10px;
    font-size: 1.05rem;
    line-height: 1.5;
    font-family: var(--cc-font);
    resize: vertical;
    min-height: 120px;
    background: transparent;
    color: var(--cc-ink);
}
.cc-modal-textarea:focus { outline: none; }

/* Modal form (for the structured event/classified forms) */
.cc-modal-form .form-group {
    margin-bottom: 14px;
}
.cc-modal-form .form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cc-ink-2);
    margin-bottom: 4px;
}
.cc-modal-form .form-group label small {
    font-weight: 400;
    color: var(--cc-muted);
}
.cc-modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .cc-modal-form .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* Footer */
.cc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--cc-divider);
    background: var(--cc-surface-2);
    flex-shrink: 0;
}
.cc-modal-footer-end { justify-content: flex-end; }
.cc-modal-actions { display: flex; gap: 8px; }
.cc-modal-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--cc-r-full);
    background: var(--cc-surface-3);
    color: var(--cc-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
.cc-modal-attach-btn:hover { background: var(--cc-primary-soft); color: var(--cc-primary); }

/* Mobile: slide up from bottom as a sheet */
@media (max-width: 640px) {
    .cc-modal {
        align-items: flex-end;
    }
    .cc-modal-panel {
        max-width: none;
        width: 100%;
        margin: 0;
        border-radius: var(--cc-r-lg) var(--cc-r-lg) 0 0;
        max-height: 92vh;
        transform: translateY(100%);
    }
    .cc-modal.open .cc-modal-panel {
        transform: translateY(0);
    }
    /* Drag handle hint on mobile */
    .cc-modal-panel::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        background: var(--cc-border-2);
        border-radius: var(--cc-r-full);
        margin: 8px auto 0;
        flex-shrink: 0;
    }
    .cc-modal-header { padding-top: 8px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .cc-modal,
    .cc-modal-panel { transition: none !important; }
}

/* =========================================
   POST DROPDOWN MENU (3-dot)
   ========================================= */
.post-menu-wrapper {
    position: relative;
}
.post-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    box-shadow: var(--cc-shadow-lg);
    padding: 6px;
    z-index: 50;
    animation: cc-menu-in 120ms ease-out;
}
.post-menu[hidden] { display: none; }
@keyframes cc-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.post-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: var(--cc-ink);
    font-size: 0.88rem;
    font-family: var(--cc-font);
    text-align: left;
    cursor: pointer;
    border-radius: var(--cc-r-sm);
    text-decoration: none;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
.post-menu-item:hover { background: var(--cc-surface-3); text-decoration: none; }
.post-menu-item.post-menu-danger { color: var(--cc-danger); }
.post-menu-item.post-menu-danger:hover { background: #fef2f2; color: var(--cc-danger); }
.post-menu-icon { width: 18px; text-align: center; font-size: 0.95rem; flex-shrink: 0; }
.post-menu-divider {
    border: 0;
    border-top: 1px solid var(--cc-divider);
    margin: 4px 0;
}

/* Mobile: menu floats right edge, but never clip */
@media (max-width: 480px) {
    .post-menu {
        min-width: 180px;
        right: -4px;
    }
}

/* =========================================
   TOAST NOTIFICATION
   ========================================= */
#cc-toast-root {
    position: fixed;
    bottom: 88px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.cc-toast {
    background: #111827;
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--cc-r-full);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--cc-shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 200ms, transform 200ms;
    max-width: 90vw;
    pointer-events: auto;
}
.cc-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.cc-toast-success { background: #065f46; }
.cc-toast-error { background: #991b1b; }
@media (max-width: 640px) {
    #cc-toast-root { bottom: 88px; }
}

/* =========================================
   HEADER POLISH
   Fix cramped nav on mid-widths; cleaner sizing
   ========================================= */
body .site-header {
    border-bottom: 1px solid var(--cc-border);
}
body .header-inner {
    gap: 12px;
    padding: 0 12px;
    height: 56px;
}
body .site-logo {
    flex-shrink: 0;
    font-size: 1.05rem;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body .logo-sub {
    color: var(--cc-muted-2);
    font-weight: 400;
    font-size: 0.72rem;
}
body .header-search {
    flex: 1;
    max-width: 320px;
    margin: 0 8px;
}
body .header-search input {
    width: 100%;
    background: var(--cc-surface-3);
    border: 1px solid transparent;
    padding: 7px 14px;
    border-radius: var(--cc-r-full);
    font-size: 0.85rem;
    transition: background var(--cc-t-fast), border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
body .header-search input:focus {
    background: var(--cc-surface);
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
    width: 100%;
    outline: none;
}

body .main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
body .main-nav a {
    padding: 7px 10px;
    border-radius: var(--cc-r-sm);
    color: var(--cc-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
    white-space: nowrap;
}
body .main-nav a:hover { background: var(--cc-surface-3); color: var(--cc-ink); text-decoration: none; }

body .nav-notifications {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: var(--cc-r-full);
    background: var(--cc-surface-3);
    font-size: 1.05rem;
    padding: 0 !important;
}
body .nav-notifications:hover { background: var(--cc-border); }
body .nav-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    transform: none;
    margin: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--cc-r-full);
    border: 2px solid var(--cc-surface);
    box-sizing: content-box;
}

body .nav-logout-form { display: inline; margin: 0; }
body .nav-logout-btn {
    padding: 7px 10px;
    background: none;
    border: none;
    color: var(--cc-muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--cc-r-sm);
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
body .nav-logout-btn:hover { background: var(--cc-surface-3); color: var(--cc-ink); }

/* Hide long-text labels on tighter widths so icons stay visible */
@media (max-width: 1100px) {
    body .main-nav a.nav-only-wide { display: none; }
}
@media (max-width: 900px) {
    body .main-nav .nav-label-hide-md { display: none; }
    body .nav-new-post .nav-new-post-label { display: none; }
}

/* On mobile, hide all nav items except FAB + hamburger trigger */
@media (max-width: 768px) {
    body .header-search { display: none; }
    body .main-nav { display: none; }
    body .main-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--cc-surface);
        border-bottom: 1px solid var(--cc-border);
        padding: 12px;
        gap: 4px;
        align-items: stretch;
        box-shadow: var(--cc-shadow-md);
    }
    body .main-nav.open a,
    body .main-nav.open .nav-logout-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: var(--cc-r-sm);
    }
    body .main-nav.open .nav-notifications {
        width: 100%;
        height: auto;
        background: none;
        justify-content: flex-start;
        border-radius: var(--cc-r-sm);
    }
    body .main-nav.open .nav-notifications::before {
        content: "Notifications";
        font-weight: 500;
        margin-left: 12px;
    }
    body .main-nav.open .nav-new-post {
        text-align: center;
        justify-content: center;
    }
    body .main-nav.open .nav-new-post-label { display: inline !important; }
}

/* =========================================
   POST DETAIL REFINEMENTS
   Scoped overrides/additions for feed/show.php.
   Uses .post-detail-* and reuses .fb-* classes so
   the detail page feels like a natural continuation
   of the feed. Any .thread-* rules higher up still
   apply (we keep .thread-container on the wrapper
   for legacy CSS targets & JS hooks).
   ========================================= */

/* Breadcrumb: small, subtle, left-aligned */
.post-detail-breadcrumb {
    margin: 0 0 12px;
    font-size: 0.85rem;
}
.post-detail-breadcrumb .breadcrumb-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: var(--cc-r-full);
    color: var(--cc-muted);
    background: transparent;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
    font-weight: 500;
}
.post-detail-breadcrumb .breadcrumb-back:hover {
    background: var(--cc-surface-3);
    color: var(--cc-ink);
    text-decoration: none;
}

/* Post detail card — same silhouette as fb-post-card, a bit more room */
.post-detail-card {
    margin-bottom: 16px;
}
.post-detail-card .fb-post-header {
    padding: 18px 20px 8px;
    gap: 14px;
}
.post-detail-card .fb-avatar.lg {
    width: 48px;
    height: 48px;
}
.post-detail-card .fb-avatar.lg .avatar-placeholder {
    font-size: 1.05rem;
}
.post-detail-card .fb-post-author {
    font-size: 1rem;
}
.post-detail-card .fb-post-meta {
    font-size: 0.82rem;
    margin-top: 3px;
}
.post-detail-card .post-edited {
    font-style: italic;
    color: var(--cc-muted);
}

/* Body — generous padding, larger title & prose */
.post-detail-card .post-detail-body {
    padding: 4px 20px 14px;
    display: block;
    cursor: default;
}
.post-detail-card .post-detail-body:hover { text-decoration: none; }
.post-detail-card .post-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--cc-ink);
    margin: 0 0 10px;
}
.post-detail-card .post-detail-prose {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--cc-ink);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.post-detail-card .post-detail-prose a {
    color: var(--cc-primary);
    word-break: break-word;
}

/* Poll sits snug inside the post body column */
.post-detail-card .post-detail-poll-wrap {
    padding: 0 20px 14px;
}

/* Stats + actions borders already styled by .fb-post-stats / .fb-post-actions */
.post-detail-card .fb-post-stats {
    padding: 10px 20px;
}
.post-detail-card .fb-post-actions {
    padding: 6px 12px;
}

/* Static (no-JS / not-logged-in) action chip */
.fb-action-btn.static {
    color: var(--cc-muted);
    background: transparent;
    cursor: default;
}
.fb-action-btn.static:hover { background: transparent; }

/* Conversation jump TOC — tiny, anchored, unobtrusive */
.conversation-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px 12px;
    font-size: 0.82rem;
    color: var(--cc-muted);
    flex-wrap: wrap;
}
.conversation-jump-label {
    font-weight: 500;
}
.conversation-jump a {
    color: var(--cc-primary);
    padding: 3px 8px;
    border-radius: var(--cc-r-full);
    background: var(--cc-primary-soft);
    transition: background var(--cc-t-fast);
}
.conversation-jump a:hover {
    background: #dbeafe;
    text-decoration: none;
}
.conversation-jump-sep { opacity: 0.4; }

/* Empty conversation — nicer visual than a plain sentence */
.empty-conversation.empty-conversation-modern {
    background: var(--cc-surface);
    border: 1px dashed var(--cc-border-2);
    border-radius: var(--cc-r-md);
    padding: 36px 20px;
    text-align: center;
    margin: 16px 0;
    box-shadow: var(--cc-shadow-xs);
}
.empty-conversation-modern .empty-conversation-icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 10px;
    opacity: 0.75;
}
.empty-conversation-modern h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cc-ink);
}
.empty-conversation-modern p {
    margin: 0;
    color: var(--cc-muted);
    font-size: 0.9rem;
}
.empty-conversation-modern .btn-link {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile tuning */
@media (max-width: 600px) {
    .post-detail-card .fb-post-header { padding: 14px 14px 6px; gap: 10px; }
    .post-detail-card .post-detail-body { padding: 2px 14px 10px; }
    .post-detail-card .post-detail-title { font-size: 1.2rem; }
    .post-detail-card .post-detail-prose { font-size: 0.98rem; }
    .post-detail-card .post-detail-poll-wrap { padding: 0 14px 12px; }
    .post-detail-card .fb-post-stats { padding: 8px 14px; }
    .empty-conversation.empty-conversation-modern { padding: 28px 14px; }
}

/* =========================================
   ADMIN SHELL (sidebar + content)
   ========================================= */
.admin-shell {
    position: relative;
    float: left;
    width: 220px;
}
.admin-sidebar {
    position: sticky;
    top: 72px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 12px 10px;
    box-shadow: var(--cc-shadow-xs);
    max-height: calc(100vh - 88px);
    overflow-y: auto;
}
.admin-sidebar-header {
    padding: 6px 10px 10px;
    border-bottom: 1px solid var(--cc-divider);
    margin-bottom: 8px;
}
.admin-sidebar-header strong {
    display: block;
    color: var(--cc-ink);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}
.admin-sidebar-header small {
    color: var(--cc-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--cc-r-sm);
    color: var(--cc-ink-2);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
.admin-sidebar-nav a:hover { background: var(--cc-surface-3); color: var(--cc-ink); text-decoration: none; }
.admin-sidebar-nav a.active {
    background: var(--cc-primary-soft);
    color: var(--cc-primary);
}
.admin-nav-badge {
    margin-left: auto;
    background: var(--cc-danger);
    color: #fff;
    border-radius: var(--cc-r-full);
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}
.admin-sidebar-footer {
    padding: 10px 10px 0;
    border-top: 1px solid var(--cc-divider);
    margin-top: 10px;
}
.admin-sidebar-footer a {
    color: var(--cc-muted);
    font-size: 0.82rem;
    text-decoration: none;
}
.admin-sidebar-footer a:hover { color: var(--cc-primary); }

.admin-content {
    margin-left: 240px;
    min-height: 400px;
    padding: 20px 28px 60px;
    max-width: 1280px;
}

/* Narrow form column used inside .admin-page so settings-style forms
   keep an ergonomic line length without fighting the sidebar offset. */
.form-stack { max-width: 620px; }

@media (max-width: 1024px) {
    .admin-shell { float: none; width: 100%; margin-bottom: 16px; }
    .admin-sidebar { position: static; max-height: none; }
    .admin-sidebar-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
    .admin-sidebar-nav a { white-space: nowrap; flex-shrink: 0; }
    .admin-sidebar-header, .admin-sidebar-footer { display: none; }
    .admin-content { margin-left: 0; padding: 16px 18px 48px; }
}

/* =========================================
   BREADCRUMBS
   ========================================= */
.breadcrumb-nav {
    font-size: 0.82rem;
    color: var(--cc-muted);
    margin-bottom: 12px;
    padding: 4px 0;
}
.breadcrumb-nav a {
    color: var(--cc-muted);
    text-decoration: none;
    transition: color var(--cc-t-fast);
}
.breadcrumb-nav a:hover { color: var(--cc-primary); text-decoration: underline; }
.breadcrumb-nav span { color: var(--cc-ink); font-weight: 500; }

/* =========================================
   ROLE BADGES
   ========================================= */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--cc-r-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
    white-space: nowrap;
}
.role-badge.role-platform { background: #111827; color: #fbbf24; }
.role-badge.role-admin { background: #dbeafe; color: #1e3a8a; }
.role-badge.role-moderator { background: #ede9fe; color: #4c1d95; }

.neighborhood-role {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--cc-r-full);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: lowercase;
}
.neighborhood-role.role-admin { background: #dbeafe; color: #1e3a8a; }
.neighborhood-role.role-moderator { background: #ede9fe; color: #4c1d95; }
.neighborhood-role.role-member { background: var(--cc-surface-3); color: var(--cc-muted); }

/* =========================================
   PROFILE PAGE V2 (redesigned)
   ========================================= */
.profile-page-v2 {
    max-width: 960px;
    margin: 0 auto;
}
.profile-hero {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 20px;
    box-shadow: var(--cc-shadow-xs);
}
.profile-hero-avatar img,
.profile-hero-placeholder {
    width: 96px;
    height: 96px;
    border-radius: var(--cc-r-full);
    box-shadow: 0 0 0 4px var(--cc-surface), 0 0 0 5px var(--cc-border);
}
.profile-hero-placeholder {
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
}
.profile-hero-info { flex: 1; min-width: 0; }
.profile-hero-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.profile-hero-name h1 {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cc-ink);
    margin: 0;
}
.profile-hero-username {
    display: block;
    color: var(--cc-muted);
    font-size: 0.92rem;
    margin: 2px 0 8px;
}
.profile-hero-bio {
    color: var(--cc-ink-2);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 8px 0 12px;
    word-wrap: break-word;
}
.profile-hero-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.profile-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--cc-muted);
    font-size: 0.82rem;
}
.profile-stat-icon { font-size: 1rem; opacity: 0.9; }
.profile-hero-actions { flex-shrink: 0; align-self: flex-start; }

@media (max-width: 640px) {
    .profile-hero { flex-direction: column; gap: 16px; padding: 16px; }
    .profile-hero-avatar { align-self: center; }
    .profile-hero-info { text-align: center; }
    .profile-hero-name { justify-content: center; }
    .profile-hero-stats { justify-content: center; }
    .profile-hero-actions { align-self: stretch; }
    .profile-hero-actions .btn { width: 100%; }
}

/* Profile edit card */
.profile-edit-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--cc-shadow-xs);
}
.profile-edit-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.profile-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Profile body grid (neighborhoods sidebar + posts content) */
.profile-body-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .profile-body-grid { grid-template-columns: 1fr; }
}
.profile-sidebar { display: flex; flex-direction: column; gap: 16px; }

.profile-neighborhoods-list { list-style: none; padding: 0; margin: 0; }
.profile-neighborhoods-list li { margin-bottom: 4px; }
.profile-neighborhoods-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--cc-r-sm);
    color: var(--cc-ink);
    text-decoration: none;
    transition: background var(--cc-t-fast);
}
.profile-neighborhoods-list a:hover { background: var(--cc-surface-2); text-decoration: none; }
.profile-neighborhoods-list strong { font-weight: 500; font-size: 0.9rem; }

.sidebar-trust-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cc-primary);
    margin-bottom: 4px;
}
.sidebar-trust-help {
    font-size: 0.8rem;
    color: var(--cc-muted);
    line-height: 1.5;
}

/* Profile content (tabs + posts list) */
.profile-content {}
.profile-content-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--cc-divider);
}
.profile-tab {
    background: transparent;
    border: none;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    color: var(--cc-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color var(--cc-t-fast), border-color var(--cc-t-fast);
    font-size: 0.9rem;
}
.profile-tab:hover { color: var(--cc-ink); }
.profile-tab.active {
    color: var(--cc-primary);
    border-bottom-color: var(--cc-primary);
}
.tab-count {
    background: var(--cc-surface-3);
    color: var(--cc-muted);
    border-radius: var(--cc-r-full);
    padding: 1px 8px;
    font-size: 0.72rem;
    margin-left: 6px;
}

.profile-post-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--cc-shadow-xs);
    transition: box-shadow var(--cc-t-fast), transform var(--cc-t-fast);
}
.profile-post-card:hover { box-shadow: var(--cc-shadow-md); }
.profile-post-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.78rem;
    color: var(--cc-muted);
    margin-bottom: 6px;
}
.profile-post-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
.profile-post-title a { color: var(--cc-ink); text-decoration: none; }
.profile-post-title a:hover { color: var(--cc-primary); }
.profile-post-body {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--cc-ink-2);
    margin-bottom: 10px;
}
.profile-post-body a { color: inherit; text-decoration: none; }
.profile-post-footer {
    display: flex;
    gap: 16px;
    color: var(--cc-muted);
    font-size: 0.82rem;
}

/* Hide the old profile-page styles so the new one takes over cleanly */
body .profile-page-v2 .hidden { display: none !important; }

/* =============================================================
   MESSAGES V2
   Modernized thread list, Messenger-style conversation view,
   and cleaner compose form. Uses design tokens from :root.
   Legacy .message-list / .message-bubble rules are left intact
   above for safe cleanup later.
   ============================================================= */

.msg-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.msg-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.msg-page-header h1 {
    font-size: 1.6rem;
    margin: 0;
    letter-spacing: -0.01em;
}
.msg-page-subtitle {
    color: var(--cc-muted);
    font-size: 0.88rem;
    margin: 2px 0 0;
}
.msg-new-btn { white-space: nowrap; }

/* --- Empty state (inbox + conversation) --- */
.msg-empty,
.msg-empty-convo {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-sm);
    padding: 40px 24px;
    text-align: center;
}
.msg-empty h2 {
    font-size: 1.2rem;
    margin: 6px 0 4px;
    color: var(--cc-ink);
}
.msg-empty p,
.msg-empty-convo p {
    color: var(--cc-muted);
    margin: 0 0 14px;
    font-size: 0.94rem;
}
.msg-empty-icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 8px;
}

/* --- Thread list --- */
.msg-thread-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-sm);
    overflow: hidden;
}
.msg-thread-row {
    border-bottom: 1px solid var(--cc-border);
}
.msg-thread-row:last-child { border-bottom: 0; }

.msg-thread-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    color: var(--cc-ink);
    text-decoration: none;
    transition: background var(--cc-t-fast);
}
.msg-thread-link:hover,
.msg-thread-link:focus-visible {
    background: var(--cc-surface-2);
    text-decoration: none;
}

.msg-thread-row.is-unread .msg-thread-link {
    background: var(--cc-primary-soft);
}
.msg-thread-row.is-unread .msg-thread-link:hover {
    background: #e4eefe;
}

.msg-thread-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: visible;
    flex-shrink: 0;
}
.msg-thread-avatar img,
.msg-thread-avatar .avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    font-size: 1.05rem;
}

.msg-unread-dot {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cc-primary);
    box-shadow: 0 0 0 2px var(--cc-surface);
}

.msg-thread-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.msg-thread-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.msg-thread-name {
    font-weight: 500;
    color: var(--cc-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.97rem;
}
.msg-thread-row.is-unread .msg-thread-name {
    font-weight: 700;
}
.msg-thread-time {
    font-size: 0.78rem;
    color: var(--cc-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.msg-thread-row.is-unread .msg-thread-time {
    color: var(--cc-primary);
    font-weight: 600;
}
.msg-thread-subject {
    font-size: 0.82rem;
    color: var(--cc-ink-2);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-thread-preview {
    color: var(--cc-muted);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.msg-thread-row.is-unread .msg-thread-preview {
    color: var(--cc-ink-2);
    font-weight: 500;
}
.msg-preview-prefix {
    color: var(--cc-muted-2);
}

.msg-unread-badge {
    background: var(--cc-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--cc-r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Conversation view --- */
.msg-view {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 0;
    display: flex;
    flex-direction: column;
    /* Fit within the viewport so composer stays stuck to bottom */
    height: calc(100vh - 120px);
    min-height: 520px;
}

.msg-view-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--cc-border);
    background: var(--cc-surface);
    position: sticky;
    top: 64px;
    z-index: 2;
    border-top-left-radius: var(--cc-r-md);
    border-top-right-radius: var(--cc-r-md);
    padding-left: 12px;
    padding-right: 12px;
}
.msg-back {
    color: var(--cc-muted);
    font-size: 1.3rem;
    line-height: 1;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--cc-r-sm);
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
.msg-back:hover,
.msg-back:focus-visible {
    background: var(--cc-surface-3);
    color: var(--cc-ink);
    text-decoration: none;
}
.msg-view-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.msg-view-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.msg-view-avatar img,
.msg-view-avatar .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    font-size: 0.85rem;
}
.msg-view-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.msg-view-name {
    font-weight: 600;
    color: var(--cc-ink);
    text-decoration: none;
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-view-name:hover { color: var(--cc-primary); }
.msg-view-subject {
    font-size: 0.8rem;
    color: var(--cc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Conversation scroll area --- */
.msg-conversation {
    flex: 1;
    overflow-y: auto;
    padding: 16px 4px;
    background: var(--cc-surface);
    border-left: 1px solid var(--cc-border);
    border-right: 1px solid var(--cc-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msg-time-sep {
    text-align: center;
    color: var(--cc-muted);
    font-size: 0.75rem;
    margin: 14px 0 6px;
}
.msg-time-sep time { background: transparent; }

/* --- Message rows / bubbles --- */
.msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 0 10px;
    margin-top: 6px;
}
.msg-row.grouped { margin-top: 2px; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }

.msg-row-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.msg-row-avatar img,
.msg-row-avatar .avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    font-size: 0.72rem;
}
/* When grouped with previous, leave the avatar gutter but empty */
.msg-row.theirs.grouped .msg-row-avatar { visibility: hidden; }

.msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: min(78%, 520px);
}
.msg-row.mine .msg-bubble-wrap { align-items: flex-end; }
.msg-row.theirs .msg-bubble-wrap { align-items: flex-start; }

.msg-bubble-author {
    font-size: 0.75rem;
    color: var(--cc-muted);
    font-weight: 500;
    margin: 0 0 2px 10px;
    text-decoration: none;
}
.msg-bubble-author:hover { color: var(--cc-primary); }

.msg-bubble {
    padding: 9px 14px;
    border-radius: 18px;
    line-height: 1.45;
    font-size: 0.94rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: var(--cc-shadow-xs);
}
.msg-bubble a { word-break: break-word; }
.msg-bubble .mention,
.msg-bubble .hashtag {
    text-decoration: none;
    font-weight: 500;
}

.msg-row.mine .msg-bubble {
    background: var(--cc-primary);
    color: #fff;
    border-bottom-right-radius: 6px;
}
.msg-row.mine .msg-bubble a { color: #fff; text-decoration: underline; }
.msg-row.mine .msg-bubble .mention,
.msg-row.mine .msg-bubble .hashtag {
    color: #fff;
    background: rgba(255,255,255,0.18);
    padding: 1px 6px;
    border-radius: 4px;
}

.msg-row.theirs .msg-bubble {
    background: var(--cc-surface-3);
    color: var(--cc-ink);
    border-bottom-left-radius: 6px;
}
.msg-row.theirs .msg-bubble a { color: var(--cc-primary); }

/* Tighter radii when bubbles are grouped from same sender */
.msg-row.mine.grouped .msg-bubble {
    border-top-right-radius: 6px;
}
.msg-row.theirs.grouped .msg-bubble {
    border-top-left-radius: 6px;
}

.msg-read-indicator {
    font-size: 0.72rem;
    color: var(--cc-muted);
    margin: 4px 10px 0 0;
    font-weight: 500;
}
.msg-read-indicator.seen { color: var(--cc-primary); }

/* --- Composer (sticky bottom of conversation card) --- */
.msg-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-top: 1px solid var(--cc-border);
    border-bottom-left-radius: var(--cc-r-md);
    border-bottom-right-radius: var(--cc-r-md);
    position: sticky;
    bottom: 0;
}
.msg-composer textarea {
    flex: 1;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-lg);
    padding: 10px 14px;
    resize: none;
    font-family: inherit;
    font-size: 0.94rem;
    line-height: 1.4;
    background: var(--cc-surface-2);
    color: var(--cc-ink);
    min-height: 40px;
    max-height: 160px;
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
.msg-composer textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
    background: var(--cc-surface);
}
.msg-send-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--cc-primary);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--cc-t-fast), transform var(--cc-t-fast);
}
.msg-send-btn:hover { background: var(--cc-primary-hover); }
.msg-send-btn:active { transform: scale(0.95); }

/* --- Compose page --- */
.msg-compose-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}
.msg-compose-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.msg-compose-header h1 {
    font-size: 1.4rem;
    margin: 0;
    letter-spacing: -0.01em;
}

.msg-compose-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg-compose-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.msg-compose-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--cc-ink);
}
.msg-compose-label small {
    font-weight: 400;
    color: var(--cc-muted);
}
.msg-compose-hint {
    color: var(--cc-muted);
    font-size: 0.8rem;
}
.msg-compose-input,
.msg-compose-select,
.msg-compose-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-sm);
    background: var(--cc-surface);
    font: inherit;
    color: var(--cc-ink);
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
.msg-compose-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}
.msg-compose-input:focus,
.msg-compose-select:focus,
.msg-compose-textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
.msg-compose-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
}

/* --- Mobile tweaks --- */
@media (max-width: 640px) {
    .msg-page-header { flex-direction: column; align-items: flex-start; }
    .msg-thread-link { padding: 12px; gap: 10px; }
    .msg-thread-avatar,
    .msg-thread-avatar img,
    .msg-thread-avatar .avatar-placeholder { width: 44px; height: 44px; }

    .msg-view { height: calc(100vh - 100px); padding: 0 8px; }
    .msg-view-header { top: 56px; }
    .msg-bubble-wrap { max-width: 85%; }
    .msg-bubble { font-size: 0.93rem; }
}

/* =========================================
   INVITES
   ========================================= */
.invite-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--cc-shadow-xs);
}
.invite-card-header { margin-bottom: 14px; }
.invite-card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.invite-card-header .muted {
    color: var(--cc-muted);
    font-size: 0.88rem;
    margin: 0;
}

.invite-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.invite-link-input {
    flex: 1;
    background: var(--cc-surface-3);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-sm);
    padding: 9px 12px;
    font-family: var(--cc-font-mono);
    font-size: 0.82rem;
    color: var(--cc-ink-2);
    min-width: 0; /* allow flex shrink */
}
.invite-link-input:focus {
    outline: none;
    border-color: var(--cc-primary);
    background: var(--cc-surface);
    box-shadow: var(--cc-shadow-focus);
}

@media (max-width: 480px) {
    .invite-link-row { flex-direction: column; align-items: stretch; }
    .invite-link-input { font-size: 0.75rem; }
}

/* Invite accept landing (public) */
.invite-accept-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.invite-accept-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-lg);
    padding: 36px 28px;
    box-shadow: var(--cc-shadow-lg);
    max-width: 480px;
    width: 100%;
    text-align: center;
}
.invite-accept-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}
.invite-accept-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--cc-ink);
}
.invite-accept-sub {
    color: var(--cc-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.invite-accept-message {
    background: var(--cc-primary-soft);
    border-left: 3px solid var(--cc-primary);
    border-radius: 0 var(--cc-r-sm) var(--cc-r-sm) 0;
    padding: 12px 16px;
    margin: 20px 0;
    text-align: left;
    font-style: italic;
    color: var(--cc-primary-hover);
}
.invite-accept-message cite {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--cc-muted);
    font-style: normal;
}
.invite-accept-preview {
    padding: 12px;
    background: var(--cc-surface-2);
    border-radius: var(--cc-r);
    margin-bottom: 20px;
}
.invite-accept-preview p {
    font-size: 0.9rem;
    color: var(--cc-ink-2);
    margin-bottom: 4px;
}
.invite-accept-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.invite-accept-actions .btn-lg { padding: 14px 28px; font-size: 1rem; }
.invite-accept-login {
    font-size: 0.85rem;
    color: var(--cc-muted);
    margin: 0;
}
.invite-accept-footer {
    font-size: 0.75rem;
    color: var(--cc-muted-2);
    padding-top: 16px;
    border-top: 1px solid var(--cc-divider);
}

.badge.badge-active { background: #d1fae5; color: #065f46; }

/* =========================================================
   GROUPS MODULE — visual pass (index, show, create)
   ========================================================= */

/* Groups index page wrapper */
.groups-page .page-header h1 { margin-bottom: 4px; }

/* Group card grid (public list) */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.group-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-xs);
    padding: 14px;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--cc-t-fast), transform var(--cc-t-fast), border-color var(--cc-t-fast);
    position: relative;
}
.group-card:hover {
    box-shadow: var(--cc-shadow-md);
    border-color: var(--cc-border-2);
    transform: translateY(-1px);
}
.group-card-link {
    display: flex;
    gap: 12px;
    color: var(--cc-ink);
    text-decoration: none;
    flex: 1;
}
.group-card-link:hover { text-decoration: none; color: var(--cc-ink); }
.group-card-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--cc-r-md);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
    box-shadow: var(--cc-shadow-xs);
}
.group-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.group-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.group-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cc-ink);
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.group-card-meta {
    font-size: 0.8rem;
    color: var(--cc-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.group-card-desc {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--cc-ink-2);
    margin: 6px 0 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.group-card-join {
    margin: 10px 0 0;
    display: flex;
    justify-content: flex-end;
}
.group-card-join .btn { min-width: 90px; }
.group-card-joined { margin: 10px 0 0; display: flex; justify-content: flex-end; }

/* Group detail hero */
body .group-detail { max-width: 1000px; margin: 0 auto; }
body .group-hero {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    box-shadow: var(--cc-shadow-xs);
}
.group-hero-avatar {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: var(--cc-r-md);
    color: #fff;
    font-size: 2.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
    box-shadow: var(--cc-shadow-sm);
}
.group-hero-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.group-hero-headline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.group-hero-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--cc-ink);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    line-height: 1.2;
}
.group-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.group-hero-meta {
    font-size: 0.88rem;
    color: var(--cc-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.group-hero-meta strong { color: var(--cc-ink); font-weight: 600; }
.group-hero-description {
    color: var(--cc-ink-2);
    line-height: 1.55;
    margin: 4px 0 0;
    font-size: 0.94rem;
    white-space: pre-wrap;
}

/* Group posts section header */
.group-posts-header { margin-bottom: 12px; }
.group-posts-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--cc-ink);
}

/* Posts inside a group use fb-post-card base, compacted */
.group-post-card { margin-bottom: 12px; }
.group-post-card .fb-post-body-link { padding-bottom: 12px; }

/* Member grid sidebar */
.group-member-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.group-member-cell { list-style: none; }
.group-member-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 6px;
    border-radius: var(--cc-r-sm);
    color: var(--cc-ink);
    text-decoration: none;
    transition: background var(--cc-t-fast);
}
.group-member-link:hover {
    background: var(--cc-surface-3);
    text-decoration: none;
    color: var(--cc-ink);
}
.group-member-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--cc-surface-3);
}
.group-member-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.group-member-avatar .avatar-placeholder {
    width: 100%; height: 100%;
    background: var(--cc-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.group-member-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
}
.group-member-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--cc-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty-state icon (shared with polls + groups empty states) */
body .empty-state .empty-state-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 10px;
    opacity: 0.7;
}
body .empty-state h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cc-ink);
}
body .empty-state p { margin: 0 0 10px; font-size: 0.92rem; }

/* Hero stacks on small screens */
@media (max-width: 640px) {
    body .group-hero {
        padding: 16px;
        gap: 14px;
        flex-wrap: wrap;
    }
    .group-hero-avatar { width: 64px; height: 64px; font-size: 1.8rem; border-radius: var(--cc-r); }
    .group-hero-name { font-size: 1.25rem; }
    .group-hero-headline { gap: 8px; }
    .group-hero-actions { width: 100%; justify-content: flex-start; }
}

/* =========================================================
   TOGGLE SWITCH (reusable — used by group & poll create)
   ========================================================= */
.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
}
.toggle-field-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    margin: 0;
}
.toggle-field-title {
    font-weight: 600;
    color: var(--cc-ink);
    font-size: 0.92rem;
}
.toggle-field-sub {
    font-size: 0.82rem;
    color: var(--cc-muted);
    font-weight: 400;
}
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.switch-slider {
    position: absolute;
    inset: 0;
    background: var(--cc-border-2);
    border-radius: var(--cc-r-full);
    transition: background var(--cc-t-fast);
}
.switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--cc-t-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.switch input:checked + .switch-slider { background: var(--cc-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider {
    box-shadow: var(--cc-shadow-focus);
}

/* Form actions row (submit + cancel) */
.form-page .form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

/* =========================================================
   POLLS — visual pass
   ========================================================= */
body .poll-container {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 14px 16px;
    margin: 14px 0;
    background: var(--cc-surface);
    box-shadow: var(--cc-shadow-sm);
    position: relative;
}
body .poll-container.poll-closed {
    background: var(--cc-surface-2);
    border-style: dashed;
}
.poll-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.poll-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: var(--cc-primary-soft);
    color: var(--cc-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: var(--cc-r-full);
}
.poll-closed .poll-label {
    background: var(--cc-surface-3);
    color: var(--cc-muted);
}
.poll-label-sub {
    font-size: 0.75rem;
    color: var(--cc-muted);
    font-weight: 500;
}
body .poll-question {
    font-weight: 600;
    font-size: 1.02rem;
    margin: 4px 0 12px;
    color: var(--cc-ink);
    letter-spacing: -0.01em;
    line-height: 1.4;
}
body .poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
body .poll-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    cursor: pointer;
    transition: background var(--cc-t-fast), border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
    font-size: 0.93rem;
    color: var(--cc-ink);
}
body .poll-option:hover {
    background: var(--cc-primary-soft);
    border-color: var(--cc-primary);
}
body .poll-option input {
    margin: 0;
    accent-color: var(--cc-primary);
}
body .poll-option-label { flex: 1; }

/* Result rows — animated bar chart */
body .poll-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}
body .poll-result-row {
    padding: 2px 0;
}
body .poll-result-row.voted .poll-result-text {
    font-weight: 600;
    color: var(--cc-primary);
}
body .poll-result-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--cc-ink);
}
body .poll-result-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    word-break: break-word;
}
body .poll-result-percent {
    color: var(--cc-muted);
    font-weight: 500;
    font-size: 0.85rem;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
body .poll-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--cc-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
body .poll-results-bar-track {
    width: 100%;
    height: 8px;
    background: var(--cc-surface-3);
    border-radius: var(--cc-r-full);
    overflow: hidden;
}
body .poll-results-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cc-primary) 0%, #60a5fa 100%);
    border-radius: var(--cc-r-full);
    transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
}
body .poll-result-row.voted .poll-results-bar {
    background: linear-gradient(90deg, var(--cc-primary) 0%, var(--cc-accent) 100%);
}
body .poll-meta {
    font-size: 0.8rem;
    color: var(--cc-muted);
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--cc-divider);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
body .poll-revote-form { margin-top: 10px; }
body .poll-revote-form summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--cc-primary);
    padding: 4px 0;
}
body .poll-revote-form summary:hover { text-decoration: underline; }

/* Required asterisk in poll create form */
body .poll-options-fieldset {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    padding: 14px 16px;
    background: var(--cc-surface-2);
}
body .poll-options-fieldset legend {
    font-weight: 600;
    padding: 0 8px;
    color: var(--cc-ink);
    font-size: 0.95rem;
}
body .poll-options-fieldset > small {
    display: block;
    color: var(--cc-muted);
    margin-bottom: 10px;
    font-size: 0.82rem;
}
body .poll-option-input { margin-bottom: 10px; }
body .poll-option-input:last-child { margin-bottom: 0; }
body .poll-option-input label {
    font-size: 0.82rem;
    color: var(--cc-muted);
    font-weight: 500;
}
body .required-mark { color: var(--cc-danger); font-weight: 700; }

/* =========================================================
   375px iPhone SE polish
   Tightens composer, actions, header, pills, and modal
   at very narrow widths (iPhone SE, older small Androids).
   Existing 380px block above still applies; this extends it.
   ========================================================= */
@media (max-width: 390px) {
    /* --- Header --- */
    body .header-inner { padding: 0 8px; gap: 8px; height: 52px; }
    body .site-logo { font-size: 0.95rem; max-width: 46%; }
    body .logo-sub { display: none; }
    body .nav-notifications { width: 36px; height: 36px; font-size: 0.95rem; }
    body .main-nav.open { padding: 10px; }

    /* --- Composer trigger: readable font & comfortable tap height --- */
    body .fb-composer { padding: 10px 12px; border-radius: var(--cc-r); }
    body .fb-composer-collapsed { gap: 8px; }
    body .fb-composer-trigger {
        font-size: 0.9rem;
        padding: 10px 14px;
        min-height: 40px;
        line-height: 1.2;
    }

    /* --- Quick-action row: icon-only with smaller gap --- */
    body .fb-composer-actions { gap: 0; padding-top: 6px; }
    body .fb-action {
        padding: 10px 2px;
        font-size: 0;  /* hide label wrapper spacing */
        gap: 0;
        min-height: 40px;
    }
    body .fb-action .fb-action-icon { font-size: 1.2rem; }
    body .fb-action .fb-action-label { display: none; }

    /* --- Post card header: avatar + name + time + badge wrap cleanly --- */
    body .fb-post-header { padding: 10px 10px 4px; gap: 8px; }
    body .fb-avatar { width: 36px; height: 36px; }
    body .fb-avatar .avatar-placeholder { font-size: 0.9rem; }
    body .fb-post-author { font-size: 0.88rem; }
    body .fb-post-meta { font-size: 0.72rem; gap: 3px; }
    body .fb-post-menu-btn { width: 28px; height: 28px; font-size: 1.2rem; }
    body .fb-post-title { font-size: 1.02rem; margin-bottom: 4px; }
    body .fb-post-body { font-size: 0.9rem; }
    body .fb-post-body-link { padding: 0 10px 8px; }

    /* --- Thread-type badges readable --- */
    body .thread-type {
        font-size: 0.65rem;
        padding: 1px 6px;
        letter-spacing: 0.3px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* --- Hashtag / mention pills inside post body --- */
    body .fb-post-body .hashtag,
    body .fb-post-body .mention,
    body .hashtag,
    body .mention { font-size: 0.85rem; padding: 0 3px; }

    /* --- Action bar: Like / Comment / Share all fit --- */
    body .fb-post-actions { padding: 2px 4px; }
    body .fb-action-btn {
        padding: 9px 2px;
        gap: 4px;
        font-size: 0.82rem;
        min-height: 40px;
    }
    body .fb-action-btn .fb-action-label { font-size: 0.78rem; }
    body .fb-action-btn .fb-action-icon { font-size: 1.05rem; }

    /* --- Stats row --- */
    body .fb-post-stats { padding: 4px 10px; font-size: 0.78rem; }

    /* --- Quick comment input: tappable not crushed --- */
    body .fb-quick-comment { gap: 6px; padding: 8px 10px 10px; }
    body .fb-quick-comment .fb-avatar { width: 30px; height: 30px; }
    body .fb-quick-comment input[type="text"] {
        padding: 9px 12px;
        font-size: 0.88rem;
        min-height: 38px;
    }

    /* --- Modal bottom sheet: visible drag handle, easier reach --- */
    body .cc-modal-panel {
        border-radius: var(--cc-r-md) var(--cc-r-md) 0 0;
        max-height: 94vh;
    }
    body .cc-modal-panel::before {
        width: 44px;
        height: 5px;
        margin: 10px auto 2px;
        background: var(--cc-border-2);
        opacity: 0.9;
    }
    body .cc-modal-header { padding: 6px 14px 10px; }
    body .cc-modal-title { font-size: 0.98rem; }
    body .cc-modal-close { width: 32px; height: 32px; font-size: 1.15rem; }
    body .cc-modal-body { padding: 12px 14px 10px; }
    body .cc-modal-footer { padding: 10px 14px; gap: 8px; }
    body .cc-modal-textarea { font-size: 1rem; min-height: 100px; }

    /* --- FAB: nudge in & up so it doesn't obscure quick-comment --- */
    body .fab-new-post {
        bottom: 18px;
        right: 12px;
        width: 48px;
        height: 48px;
    }
    body .fb-feed-posts .fb-quick-comment:last-of-type { margin-bottom: 72px; }

    /* --- Admin sidebar: horizontal strip doesn't overflow --- */
    body .admin-sidebar { padding: 8px 6px; border-radius: var(--cc-r); }
    body .admin-sidebar-nav { gap: 2px; padding-bottom: 4px; }
    body .admin-sidebar-nav a {
        padding: 8px 10px;
        font-size: 0.82rem;
        gap: 6px;
    }

    /* --- Action chips (post detail toolbar) --- */
    body .action-chip { padding: 6px 8px; font-size: 0.76rem; gap: 4px; }
    body .action-chip.sm { padding: 4px 6px; font-size: 0.72rem; }

    /* --- Group cards --- */
    body .group-grid { grid-template-columns: 1fr; gap: 10px; }
    body .group-card { padding: 12px; }
    body .group-card-avatar { width: 48px; height: 48px; font-size: 1.3rem; }
    body .group-card-name { font-size: 0.95rem; }
    body .group-hero { padding: 14px; gap: 12px; }
    body .group-hero-avatar { width: 56px; height: 56px; font-size: 1.5rem; }
    body .group-hero-name { font-size: 1.15rem; }

    /* --- Polls --- */
    body .poll-container { padding: 12px 14px; }
    body .poll-question { font-size: 0.96rem; }
    body .poll-option { padding: 9px 12px; font-size: 0.88rem; }
    body .poll-result-label { font-size: 0.84rem; }

    /* --- Toggle switch --- */
    body .toggle-field { padding: 10px 12px; gap: 10px; }
    body .toggle-field-title { font-size: 0.88rem; }
    body .toggle-field-sub { font-size: 0.78rem; }

    /* --- Page header: stack title + action --- */
    body .page-header { gap: 8px; }
    body .page-header h1 { font-size: 1.35rem; }
}

/* ========================================================
   WELCOME TOUR
   First-visit 4-step overlay on the neighborhood feed.
   ======================================================== */
.cc-tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    z-index: 9000;
    backdrop-filter: blur(1px);
    animation: cc-tour-fade 200ms ease-out;
}
@keyframes cc-tour-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cc-tour-highlight {
    position: absolute;
    z-index: 9001;
    border-radius: var(--cc-r-md);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.55),
                0 0 0 9999px rgba(17, 24, 39, 0.55);
    pointer-events: none;
    transition: top 200ms ease, left 200ms ease, width 200ms ease, height 200ms ease;
    background: transparent;
}
.cc-tour-tooltip {
    position: absolute;
    z-index: 9002;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--cc-surface);
    color: var(--cc-ink);
    border-radius: var(--cc-r-md);
    padding: 18px 20px;
    box-shadow: var(--cc-shadow-xl);
    font-family: var(--cc-font);
    line-height: 1.5;
    animation: cc-tour-pop 180ms ease-out;
}
@keyframes cc-tour-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cc-tour-step {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cc-primary);
    margin-bottom: 6px;
}
.cc-tour-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--cc-ink);
}
.cc-tour-body {
    font-size: 0.92rem;
    color: var(--cc-ink-2);
    margin: 0 0 14px 0;
}
.cc-tour-dots {
    display: flex;
    gap: 6px;
    margin: 0 0 14px 0;
}
.cc-tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cc-border-2);
    transition: background var(--cc-t-fast);
}
.cc-tour-dot.active {
    background: var(--cc-primary);
    width: 22px;
    border-radius: 4px;
}
.cc-tour-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.cc-tour-nav-btns {
    display: flex;
    gap: 8px;
}
.cc-tour-skip {
    background: none;
    border: none;
    color: var(--cc-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 2px;
    text-decoration: underline;
    font-family: inherit;
}
.cc-tour-skip:hover { color: var(--cc-ink); }
.cc-tour-prev,
.cc-tour-next {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--cc-r-sm);
    border: 1px solid var(--cc-border-2);
    background: var(--cc-surface);
    color: var(--cc-ink);
    cursor: pointer;
    transition: background var(--cc-t-fast), border-color var(--cc-t-fast);
}
.cc-tour-prev:hover { background: var(--cc-surface-3); }
.cc-tour-next {
    background: var(--cc-primary);
    color: #fff;
    border-color: var(--cc-primary);
}
.cc-tour-next:hover { background: var(--cc-primary-hover); }

/* ========================================================
   HELP TOOLTIPS (data-help)
   ======================================================== */
.cc-help-target {
    cursor: help;
    border-bottom: 1px dashed var(--cc-border-2);
}
.cc-help-target:focus { outline: 2px solid var(--cc-primary); outline-offset: 2px; }
.cc-help-bubble {
    position: absolute;
    z-index: 8500;
    max-width: 300px;
    background: var(--cc-ink);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--cc-r);
    font-size: 0.86rem;
    line-height: 1.45;
    box-shadow: var(--cc-shadow-lg);
    pointer-events: none;
    animation: cc-help-fade 140ms ease-out;
}
@keyframes cc-help-fade {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cc-help-title {
    display: block;
    font-weight: 700;
    margin-bottom: 3px;
    font-size: 0.9rem;
}
.cc-help-body {
    display: block;
    color: rgba(255, 255, 255, 0.9);
}

/* ========================================================
   LEGAL PAGES (Privacy / Terms / Guidelines)
   ======================================================== */
.legal-page {
    max-width: 760px;
    margin: 28px auto;
    padding: 0 16px;
    color: var(--cc-ink);
    line-height: 1.7;
}
.legal-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cc-border);
}
.legal-header h1 {
    font-size: 2rem;
    margin: 0 0 6px 0;
}
.legal-updated {
    color: var(--cc-muted);
    font-size: 0.88rem;
    margin: 0;
}
.legal-intro { margin-bottom: 28px; font-size: 1.02rem; }
.legal-page section { margin-bottom: 26px; }
.legal-page h2 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    color: var(--cc-ink);
    border-top: 1px solid var(--cc-divider);
    padding-top: 18px;
}
.legal-page section:first-of-type h2 { border-top: none; padding-top: 0; }
.legal-page h3 {
    font-size: 1.05rem;
    margin: 16px 0 6px 0;
}
.legal-page p { margin: 0 0 12px 0; }
.legal-page ul, .legal-page ol {
    margin: 0 0 12px 20px;
    padding-left: 8px;
}
.legal-page ul { list-style: disc; }
.legal-page ol { list-style: decimal; }
.legal-page li { margin-bottom: 6px; }
.legal-page code {
    background: var(--cc-surface-3);
    padding: 1px 6px;
    border-radius: var(--cc-r-xs);
    font-family: var(--cc-font-mono);
    font-size: 0.9em;
}
.legal-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--cc-border);
    text-align: center;
}

/* ========================================================
   PRIVACY CENTER (dashboard + delete confirmation)
   ======================================================== */
.privacy-center {
    max-width: 760px;
    margin: 24px auto;
    padding: 0 16px;
}
.privacy-header {
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cc-border);
}
.privacy-header h1 {
    font-size: 1.75rem;
    margin: 0 0 6px 0;
}
.privacy-section {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 20px 22px;
    margin-bottom: 18px;
    box-shadow: var(--cc-shadow-xs);
}
.privacy-section h2 {
    font-size: 1.15rem;
    margin: 0 0 14px 0;
}
.privacy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}
.privacy-stat {
    background: var(--cc-surface-2);
    border-radius: var(--cc-r);
    padding: 14px 12px;
    text-align: center;
}
.privacy-stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cc-ink);
    line-height: 1.1;
    margin-bottom: 4px;
}
.privacy-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--cc-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.privacy-action-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.privacy-action-text { flex: 1 1 300px; }
.privacy-action-text h3 {
    font-size: 1.05rem;
    margin: 0 0 6px 0;
}
.privacy-action-text p {
    margin: 0;
    color: var(--cc-ink-2);
    font-size: 0.93rem;
    line-height: 1.5;
}
.privacy-action-btn { flex: 0 0 auto; }
.privacy-danger {
    border-color: #fecaca;
    background: #fff7f7;
}
.privacy-danger h3 { color: #991b1b; }
.privacy-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--cc-r-md);
    padding: 18px 22px;
    margin-bottom: 20px;
}
.privacy-warning h3 {
    margin: 0 0 10px 0;
    color: #9a3412;
    font-size: 1.05rem;
}
.privacy-warning ol {
    margin: 0 0 12px 20px;
    padding-left: 8px;
    list-style: decimal;
    line-height: 1.6;
}
.privacy-warning li { margin-bottom: 6px; }
.privacy-warning-retained {
    background: rgba(255, 255, 255, 0.55);
    border-radius: var(--cc-r-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    color: var(--cc-ink-2);
    margin: 12px 0;
}
.privacy-warning-export {
    margin: 0;
    font-size: 0.92rem;
    color: var(--cc-ink-2);
}
.privacy-delete-form {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 20px 22px;
}
.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--cc-surface-2);
    border-radius: var(--cc-r);
    margin-bottom: 16px;
    cursor: pointer;
    font-size: 0.93rem;
    line-height: 1.5;
}
.privacy-checkbox input { margin-top: 3px; }
.privacy-password {
    display: block;
    margin-bottom: 18px;
}
.privacy-password-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.privacy-password input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    font-size: 0.95rem;
    font-family: inherit;
}
.privacy-password input:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
.privacy-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* Footer legal line */
.footer-legal {
    font-size: 0.85rem;
    color: var(--cc-muted);
    margin-top: 6px;
}
.footer-legal a { color: var(--cc-muted); }
.footer-legal a:hover { color: var(--cc-primary); }

/* =========================================
   PROFILE EDIT CARD (modernized)
   ========================================= */
body .profile-edit-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--cc-shadow-sm);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}
.profile-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cc-divider);
}
.profile-edit-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--cc-ink);
}
.profile-edit-close {
    background: var(--cc-surface-3);
    border: none;
    width: 32px; height: 32px;
    border-radius: var(--cc-r-full);
    color: var(--cc-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
.profile-edit-close:hover { background: var(--cc-border); color: var(--cc-ink); }

/* Avatar row inside profile edit */
.profile-edit-avatar-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: var(--cc-surface-2);
    border-radius: var(--cc-r);
    margin-bottom: 18px;
}
.profile-edit-avatar-preview img,
.profile-edit-avatar-preview .profile-edit-placeholder {
    width: 72px;
    height: 72px;
    border-radius: var(--cc-r-full);
    object-fit: cover;
    box-shadow: 0 0 0 3px var(--cc-surface), 0 0 0 4px var(--cc-border);
}
.profile-edit-placeholder {
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 600;
}
.profile-edit-avatar-actions { flex: 1; }
.profile-edit-avatar-label {
    font-weight: 600;
    color: var(--cc-ink);
    font-size: 0.92rem;
    margin: 0;
}
.profile-edit-avatar-hint {
    font-size: 0.8rem;
    color: var(--cc-muted);
    margin: 2px 0 10px;
}
.profile-edit-avatar-actions .btn {
    cursor: pointer;
}

@media (max-width: 480px) {
    body .profile-edit-card { padding: 18px; }
    .profile-edit-avatar-row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px; }
}

/* Proper form field spacing inside the edit card */
body .profile-edit-card .form-group { margin-bottom: 14px; }
body .profile-edit-card .form-group label {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--cc-ink-2);
}
body .profile-edit-card .form-group label small {
    font-weight: 400;
    color: var(--cc-muted);
}
body .profile-edit-card .form-group small {
    display: block;
    color: var(--cc-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}
body .profile-edit-card input[type="text"],
body .profile-edit-card input[type="tel"],
body .profile-edit-card textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r-sm);
    font-family: var(--cc-font);
    font-size: 0.95rem;
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
body .profile-edit-card input[type="text"]:focus,
body .profile-edit-card input[type="tel"]:focus,
body .profile-edit-card textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
.profile-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--cc-divider);
}

/* =========================================
   AVATAR CROP MODAL
   ========================================= */
.avatar-crop-panel { max-width: 440px; }
.avatar-crop-body { padding: 20px 20px 12px; }

.avatar-crop-stage {
    position: relative;
    width: 384px;
    height: 384px;
    margin: 0 auto;
    border-radius: var(--cc-r);
    overflow: hidden;
    background: #000;
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}
/* Circular overlay with dimmed corners, hole in the middle */
.avatar-crop-ring {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 9999px rgba(17, 24, 39, 0.55);
    -webkit-mask: radial-gradient(circle at 50% 50%, transparent 49.5%, #000 50%);
            mask: radial-gradient(circle at 50% 50%, transparent 49.5%, #000 50%);
}
/* Crisp circular outline on top */
.avatar-crop-stage::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

.avatar-crop-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--cc-surface-2);
    border-radius: var(--cc-r);
}
.avatar-crop-slider-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cc-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.avatar-crop-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: var(--cc-r-full);
    background: linear-gradient(to right, var(--cc-primary) var(--progress, 0%), var(--cc-border) 0);
    outline: none;
}
.avatar-crop-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: var(--cc-r-full);
    background: var(--cc-surface);
    border: 2px solid var(--cc-primary);
    cursor: pointer;
    box-shadow: var(--cc-shadow-sm);
}
.avatar-crop-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: var(--cc-r-full);
    background: var(--cc-surface);
    border: 2px solid var(--cc-primary);
    cursor: pointer;
    box-shadow: var(--cc-shadow-sm);
}
.avatar-crop-hint {
    text-align: center;
    font-size: 0.78rem;
    color: var(--cc-muted);
    margin: 10px 0 0;
}

@media (max-width: 480px) {
    .avatar-crop-panel { max-width: 100%; }
    .avatar-crop-stage { width: 280px; height: 280px; }
    .avatar-crop-body { padding: 14px 14px 8px; }
}

/* Pill for blocked indicator */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--cc-r-full);
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--cc-surface-3);
    color: var(--cc-muted);
}
.pill.pill-muted { background: var(--cc-surface-3); color: var(--cc-muted-2); }

/* Badge "other" for mod queue report-count pill */
.badge-other {
    display: inline-block;
    background: #fed7aa;
    color: #9a3412;
    padding: 1px 7px;
    border-radius: var(--cc-r-full);
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 6px;
    text-decoration: none;
}
.badge-other:hover { background: #fdba74; text-decoration: none; }
.small-link {
    font-size: 0.78rem;
    color: var(--cc-muted);
    margin-left: 6px;
    text-decoration: none;
}
.small-link:hover { color: var(--cc-primary); text-decoration: underline; }

/* =========================================
   DOCUMENT CENTER  (/documents)
   ========================================= */
.docs-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 16px 0 48px;
}
.docs-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cc-divider);
}
.docs-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    color: var(--cc-ink);
}
.docs-hero-sub {
    color: var(--cc-muted);
    font-size: 0.92rem;
    margin: 0;
}
.docs-upload-btn { flex-shrink: 0; white-space: nowrap; }

/* Empty state */
.docs-empty {
    text-align: center;
    padding: 56px 24px;
    background: var(--cc-surface);
    border: 1px dashed var(--cc-border-2);
    border-radius: var(--cc-r-md);
}
.docs-empty-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
    filter: grayscale(0.4);
}
.docs-empty h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: var(--cc-ink);
}
.docs-empty p { color: var(--cc-muted); margin: 0 0 18px; }

/* Sections */
.docs-section { margin-bottom: 28px; }
.docs-section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0 4px;
}
.docs-section-header h2 {
    font-size: 0.92rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cc-muted);
    margin: 0;
}
.docs-section-count {
    font-size: 0.75rem;
    color: var(--cc-muted-2);
    background: var(--cc-surface-3);
    padding: 2px 8px;
    border-radius: var(--cc-r-full);
}
.docs-section-pinned .docs-section-header h2 {
    color: var(--cc-warning, #b88400);
}

/* Row list */
.docs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.docs-row {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 0;
    display: flex;
    align-items: stretch;
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
    overflow: hidden;
}
.docs-row:hover {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-sm);
}
.docs-row.is-pinned {
    border-left: 3px solid var(--cc-warning, #f0ad4e);
}
.docs-row-main {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    flex: 1;
    min-width: 0;
    color: var(--cc-ink);
    text-decoration: none;
}
.docs-row-main:hover { text-decoration: none; }
.docs-row-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cc-surface-3);
    border-radius: var(--cc-r-sm);
    font-size: 1.3rem;
}
.docs-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.docs-row-title {
    font-weight: 600;
    color: var(--cc-ink);
    font-size: 0.96rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.docs-row-desc {
    color: var(--cc-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.docs-row-meta {
    color: var(--cc-muted-2);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.docs-row-action {
    flex-shrink: 0;
    color: var(--cc-muted-2);
    font-size: 1.1rem;
    transition: color var(--cc-t-fast), transform var(--cc-t-fast);
}
.docs-row-main:hover .docs-row-action {
    color: var(--cc-primary);
    transform: translateY(2px);
}
.docs-row-admin {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    border-left: 1px solid var(--cc-divider);
    background: var(--cc-surface-2);
}
.docs-row-admin-form { display: inline; margin: 0; }
.docs-row-danger { color: var(--cc-danger); }
.docs-row-danger:hover { background: #fef2f2; color: var(--cc-danger); }

/* Upload modal sizing (inherits .cc-modal base) */
.docs-upload-modal .cc-modal-panel {
    max-width: 520px;
    width: calc(100% - 32px);
}

/* Mobile */
@media (max-width: 640px) {
    .docs-hero { flex-direction: column; align-items: stretch; }
    .docs-upload-btn { align-self: flex-start; }
    .docs-row-main { padding: 12px 12px; gap: 10px; }
    .docs-row-icon { width: 38px; height: 38px; font-size: 1.1rem; }
    .docs-row-meta { font-size: 0.7rem; }
    .docs-row-admin {
        flex-direction: column;
        gap: 2px;
        padding: 6px 8px;
    }
}

/* =========================================
   BUSINESS RATING & REVIEW STAR WIDGET
   ========================================= */
/* Card stars (listing page) */
.biz-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 2px;
    font-size: 0.85rem;
}
.biz-stars {
    display: inline-flex;
    gap: 1px;
    font-size: 0.95rem;
    line-height: 1;
    color: #f5b400; /* amber */
}
.biz-star { display: inline-block; }
.biz-star.empty { color: #d7d9dd; }
.biz-star.half {
    position: relative;
    color: #d7d9dd;
}
.biz-star.half::before {
    content: "\2605"; /* filled */
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #f5b400;
}
.biz-rating-number {
    font-weight: 600;
    color: var(--cc-ink);
}
.biz-review-count {
    color: var(--cc-muted);
    font-size: 0.8rem;
}
.biz-card-rating-empty .biz-review-count { font-style: italic; }

/* Review write form — click-to-rate star input */
.biz-review-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 20px 22px;
    box-shadow: var(--cc-shadow-xs);
    margin: 20px 0;
}
.biz-review-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--cc-ink);
}
.biz-review-form .form-group { margin-bottom: 14px; }
.biz-review-form .form-group label {
    display: block;
    font-weight: 600;
    color: var(--cc-ink);
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.biz-review-form input[type="text"],
.biz-review-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--cc-surface);
}
.biz-review-form input[type="text"]:focus,
.biz-review-form textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
.biz-review-form textarea { resize: vertical; min-height: 88px; }

.biz-star-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.biz-star-legend {
    font-weight: 600;
    color: var(--cc-ink);
    font-size: 0.9rem;
    padding: 0;
    margin-bottom: 2px;
}
/* The star row — radios hidden, we style labels */
.biz-star-input {
    display: inline-flex;
    direction: rtl; /* so :hover of left star lights up star + all right-of-it stars */
    gap: 2px;
    font-size: 1.9rem;
    line-height: 1;
    color: #d7d9dd;
    cursor: default;
    user-select: none;
}
.biz-star-input input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.biz-star-input label {
    cursor: pointer;
    padding: 2px 4px;
    transition: color var(--cc-t-fast), transform var(--cc-t-fast);
    border-radius: var(--cc-r-sm);
}
.biz-star-input label:hover,
.biz-star-input label:hover ~ label,
.biz-star-input input[type="radio"]:checked ~ label {
    color: #f5b400;
}
.biz-star-input label:active { transform: scale(1.1); }
.biz-star-input input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}
.biz-star-helper {
    color: var(--cc-muted);
    font-size: 0.82rem;
    margin-left: 4px;
}
.biz-review-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

/* =========================================
   ADMIN PAGE POLISH (governance + members)
   ========================================= */
body .admin-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    color: var(--cc-ink);
}
body .admin-page > p.muted,
body .admin-page p.form-intro {
    color: var(--cc-muted);
    font-size: 0.95rem;
    max-width: 680px;
}
body .admin-page section { margin-top: 28px; }
body .admin-page section h2 {
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cc-muted);
    font-weight: 600;
    margin: 0 0 12px;
}
body .admin-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cc-divider);
}

/* Governance: status card */
body .governance-status {
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 14px 18px;
    color: var(--cc-ink);
    font-size: 0.92rem;
}
body .governance-status p { margin: 0; }
body .governance-status strong { font-weight: 600; }

/* Governance: admin list */
body .admin-page .admin-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
body .admin-page .admin-list li {
    background: var(--cc-surface-3);
    padding: 6px 12px;
    border-radius: var(--cc-r-full);
    font-size: 0.88rem;
}
body .admin-page .admin-list a { color: var(--cc-ink); text-decoration: none; }
body .admin-page .admin-list a:hover { color: var(--cc-primary); }

/* Governance: vote cards */
body .vote-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--cc-shadow-xs);
    transition: box-shadow var(--cc-t-fast);
}
body .vote-card:hover { box-shadow: var(--cc-shadow-sm); }
body .vote-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--cc-ink);
    text-transform: none;
    letter-spacing: normal;
}
body .vote-card p { margin: 0 0 8px; color: var(--cc-muted); font-size: 0.92rem; }
body .vote-progress {
    color: var(--cc-primary) !important;
    font-weight: 600;
    font-size: 0.9rem !important;
}
body .vote-cooloff, body .vote-expires {
    font-size: 0.82rem !important;
    color: var(--cc-muted-2) !important;
}
body .vote-records {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 12px 0;
}
.vote-record {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: var(--cc-r-full);
    border: 1px solid var(--cc-border);
    background: var(--cc-surface-3);
    color: var(--cc-muted);
}
.vote-approve { background: #e6f4ea; border-color: #b6ddc0; color: #1e6a33; }
.vote-reject  { background: #fde8e8; border-color: #f0c2c2; color: #922b2b; }
body .vote-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--cc-divider);
}

/* Members: search row */
body .search-inline {
    display: flex;
    gap: 6px;
    align-items: center;
}
body .search-inline input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    background: var(--cc-surface);
    font-size: 0.9rem;
    min-width: 220px;
}
body .search-inline input[type="text"]:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}

/* Members: modernized table */
body .admin-page .data-table {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    overflow: hidden;
    background: var(--cc-surface);
    box-shadow: var(--cc-shadow-xs);
    margin: 0;
}
body .admin-page .data-table th {
    background: var(--cc-surface-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    color: var(--cc-muted);
    padding: 11px 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--cc-border);
}
body .admin-page .data-table td {
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--cc-ink);
    border-bottom: 1px solid var(--cc-divider);
    vertical-align: middle;
}
body .admin-page .data-table tr:last-child td { border-bottom: 0; }
body .admin-page .data-table tr:hover td { background: var(--cc-surface-2); }
body .admin-page .data-table small {
    color: var(--cc-muted-2);
    font-size: 0.78rem;
}
body .admin-page .data-table .inline-form {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 0;
}
body .admin-page .data-table .inline-form select {
    padding: 6px 8px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r-sm);
    background: var(--cc-surface);
    font-size: 0.85rem;
}

/* Role badges */
body .badge-role-admin {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}
body .badge-role-moderator {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
body .badge-role-member {
    background: var(--cc-surface-3);
    color: var(--cc-muted);
    border: 1px solid var(--cc-border);
}
body .admin-page [class^="badge-role-"] {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--cc-r-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Mobile: stack table cells into labelled rows */
@media (max-width: 720px) {
    body .admin-page .data-table thead { display: none; }
    body .admin-page .data-table tr {
        display: block;
        border-bottom: 1px solid var(--cc-divider);
        padding: 10px 12px;
    }
    body .admin-page .data-table td {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding: 5px 0;
        border-bottom: 0;
    }
    body .admin-page .data-table td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        text-transform: uppercase;
        color: var(--cc-muted-2);
        font-weight: 600;
    }
    body .search-inline { width: 100%; }
    body .search-inline input[type="text"] { flex: 1; min-width: 0; }
}

/* =========================================
   STICKY FOOTER — sitewide
   Pushes <footer.site-footer> to the bottom of the viewport when content
   is short, while still flowing normally when content is long.
   ========================================= */
html, body {
    min-height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body > main,
body > main.main-content {
    flex: 1 0 auto;
}
body > footer,
body > .site-footer {
    flex-shrink: 0;
}
/* Defensive: body contains skip-link, header, alerts, main, FAB, footer.
   Only the <main> should expand — flash alerts and FABs shouldn't. */
body > .alert,
body > .skip-link,
body > .fab-new-post {
    flex-shrink: 0;
}

/* =========================================
   POLL COMPOSER MODAL
   ========================================= */
.poll-options-group {
    border: 0;
    padding: 0;
    margin: 0 0 14px;
}
.poll-options-legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cc-ink);
    margin-bottom: 6px;
    padding: 0;
}
.poll-options-legend .form-hint {
    font-weight: 400;
    color: var(--cc-muted);
    font-size: 0.8rem;
}
.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.poll-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.poll-option-bullet {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--cc-r-full);
    background: var(--cc-surface-3);
    color: var(--cc-muted);
    font-size: 0.78rem;
    font-weight: 600;
}
.poll-option-row input[type="text"] {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    background: var(--cc-surface);
    font-size: 0.92rem;
    font-family: inherit;
    min-width: 0;
}
.poll-option-row input[type="text"]:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
.poll-option-remove {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: var(--cc-r-full);
    background: var(--cc-surface-3);
    color: var(--cc-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
.poll-option-remove:hover {
    background: #fee2e2;
    color: #991b1b;
}
.poll-add-option {
    gap: 4px;
    color: var(--cc-primary);
    font-weight: 500;
}
.poll-add-option:disabled {
    color: var(--cc-muted-2);
    cursor: not-allowed;
    opacity: 0.6;
}
.poll-settings-row {
    margin-bottom: 12px;
}
.poll-toggle {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--cc-ink);
}
.poll-toggle input[type="checkbox"] {
    accent-color: var(--cc-primary);
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Tidy up the modal on mobile */
@media (max-width: 520px) {
    #modal-poll .cc-modal-panel {
        max-width: calc(100% - 24px);
    }
    .poll-option-row input[type="text"] { font-size: 16px; /* prevent iOS zoom */ }
}

/* Inline poll card in feed — subtle wrapper so it reads as part of the post */
.fb-post-poll {
    padding: 0 16px 12px;
}

/* =========================================
   MODAL FORM INPUTS — unified styling
   Earlier views (events, classifieds) applied .cc-modal-input directly to
   their inputs. The poll composer uses the generic <input>/<textarea> inside
   `.cc-modal-form .form-group`, so we style those here too. Without this
   the inputs fell through to the browser default, which looked unstyled
   and squashed in the modal panel.
   ========================================= */
.cc-modal-form .form-group input[type="text"],
.cc-modal-form .form-group input[type="search"],
.cc-modal-form .form-group input[type="url"],
.cc-modal-form .form-group input[type="email"],
.cc-modal-form .form-group input[type="tel"],
.cc-modal-form .form-group input[type="number"],
.cc-modal-form .form-group input[type="password"],
.cc-modal-form .form-group input[type="date"],
.cc-modal-form .form-group input[type="time"],
.cc-modal-form .form-group input[type="datetime-local"],
.cc-modal-form .form-group select,
.cc-modal-form .form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    background: var(--cc-surface);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--cc-ink);
    line-height: 1.4;
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
.cc-modal-form .form-group textarea {
    resize: vertical;
    min-height: 64px;
    line-height: 1.5;
}
.cc-modal-form .form-group input:focus,
.cc-modal-form .form-group select:focus,
.cc-modal-form .form-group textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
.cc-modal-form .form-group .form-hint {
    font-weight: 400;
    color: var(--cc-muted);
    font-size: 0.78rem;
}

/* Poll modal is slightly taller than default — give it more headroom
   for 6 option rows + settings + close date without scrolling. */
#modal-poll .cc-modal-panel {
    max-width: 560px;
}
#modal-poll .cc-modal-body {
    padding: 18px 22px 14px;
}
#modal-poll .cc-modal-footer {
    padding: 14px 22px;
}

/* On mobile (cc-modal becomes a bottom sheet), the poll form gets more
   vertical room and larger targets. */
@media (max-width: 640px) {
    #modal-poll .cc-modal-body { padding: 14px 16px 10px; }
    .poll-option-row input[type="text"] {
        padding: 12px 12px;
        font-size: 16px; /* prevents iOS zoom */
    }
    .poll-option-bullet { width: 28px; height: 28px; font-size: 0.82rem; }
    .poll-option-remove { width: 32px; height: 32px; font-size: 1.15rem; }
    .poll-add-option { width: 100%; justify-content: center; }
}

/* =========================================
   NEIGHBORHOOD "LOCKED" GATE (non-members)
   ========================================= */
.locked-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 64px;
    min-height: 60vh;
}
.locked-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-lg);
    box-shadow: var(--cc-shadow-md);
    padding: 44px 36px 36px;
    max-width: 520px;
    width: 100%;
    text-align: center;
}
.locked-icon {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 18px;
    display: inline-block;
    width: 72px;
    height: 72px;
    line-height: 72px;
    border-radius: var(--cc-r-full);
    background: var(--cc-primary-soft);
}
.locked-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
    color: var(--cc-ink);
}
.locked-subtitle {
    color: var(--cc-muted);
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0 0 26px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}
.locked-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.locked-btn-primary {
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 20px;
}
.locked-actions .btn-lg {
    padding: 12px 20px;
    font-size: 0.95rem;
}
.locked-help {
    color: var(--cc-muted);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}
.locked-inline-form {
    display: inline;
    margin: 0;
}
.btn-link {
    background: none;
    border: none;
    color: var(--cc-primary);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}
.btn-link:hover { color: var(--cc-primary-hover); }
.locked-footnote {
    text-align: center;
    margin-top: 24px;
    color: var(--cc-muted-2);
    font-size: 0.82rem;
}
.locked-footnote a { color: var(--cc-muted); text-decoration: underline; }
.locked-footnote a:hover { color: var(--cc-primary); }

@media (min-width: 540px) {
    .locked-actions { flex-direction: row; justify-content: center; }
    .locked-actions .btn { flex: 1; min-width: 180px; }
}

/* =========================================
   BOT HONEYPOT — visually and accessibly hidden, but not display:none
   (bots often skip display:none fields). Positioned off-screen so humans
   can't accidentally focus it.
   ========================================= */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.hp-field input { width: 1px; height: 1px; }

/* Screen-reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   MFA CODE-ENTRY PAGE
   ========================================= */
.auth-shield {
    width: 56px;
    height: 56px;
    border-radius: var(--cc-r-full);
    background: var(--cc-primary-soft);
    color: var(--cc-primary);
    font-size: 1.8rem;
    line-height: 56px;
    text-align: center;
    margin: 0 auto 14px;
}
.auth-card h1 { text-align: center; }
.auth-subtitle {
    color: var(--cc-muted);
    text-align: center;
    margin: 4px 0 22px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.auth-mfa-form { margin-top: 4px; }

.mfa-code-group { margin-bottom: 16px; }
.mfa-code-input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 14px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r-md);
    background: var(--cc-surface);
    color: var(--cc-ink);
    font-family: 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: 0.45em;
    text-align: center;
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
.mfa-code-input::placeholder { color: var(--cc-muted-2); letter-spacing: 0.45em; }
.mfa-code-input:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}

.auth-mfa-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: 0.9rem;
}
.auth-mfa-help .auth-dot { color: var(--cc-muted-2); }
.auth-inline-form { display: inline; margin: 0; }
.auth-mfa-note {
    color: var(--cc-muted-2);
    font-size: 0.8rem;
    text-align: center;
    margin: 18px 0 0;
    line-height: 1.5;
}

/* =========================================
   PINNED COMMENT
   ========================================= */
.comment-thread.is-pinned > .comment-node {
    background: var(--cc-surface-2);
    border-left: 3px solid var(--cc-warning, #f0ad4e);
    border-radius: var(--cc-r);
    padding-left: 6px;
}
.comment-pinned-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--cc-warning, #8a5a00);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 2px 0 4px 6px;
}
.comment-pinned-badge span[aria-hidden="true"] { font-size: 0.85rem; }

/* =========================================
   EVENT — document attachment UI
   ========================================= */
.event-doc-fieldset {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 14px 16px 10px;
    background: var(--cc-surface-2);
    margin-bottom: 18px;
}
.event-doc-fieldset legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cc-ink);
    padding: 0 6px;
}
.event-doc-fieldset .form-hint { font-weight: 400; color: var(--cc-muted); font-size: 0.8rem; }
.event-doc-fieldset .form-hint-block { display: block; margin-top: 4px; }

/* Radio "tab bar" */
.event-doc-tabs {
    display: inline-flex;
    background: var(--cc-surface-3);
    border-radius: var(--cc-r-full);
    padding: 3px;
    gap: 2px;
    margin-bottom: 12px;
}
.event-doc-tab {
    cursor: pointer;
    position: relative;
}
.event-doc-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.event-doc-tab span {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--cc-r-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cc-muted);
    transition: background var(--cc-t-fast), color var(--cc-t-fast);
}
.event-doc-tab input[type="radio"]:checked + span {
    background: var(--cc-surface);
    color: var(--cc-ink);
    box-shadow: var(--cc-shadow-xs);
}
.event-doc-tab input[type="radio"]:focus-visible + span {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}
.event-doc-tab input[type="radio"][disabled] + span {
    opacity: 0.45;
    cursor: not-allowed;
}

.event-doc-panel { margin-top: 4px; }
.event-doc-panel[hidden] { display: none !important; }

/* Attached document card on the event show page */
.event-attached-doc {
    margin: 14px 0;
}
.event-doc-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    text-decoration: none;
    color: var(--cc-ink);
    transition: border-color var(--cc-t-fast), box-shadow var(--cc-t-fast);
}
.event-doc-link:hover {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-sm);
    text-decoration: none;
}
.event-doc-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border-radius: var(--cc-r);
    background: var(--cc-surface-3);
}
.event-doc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.event-doc-title { font-weight: 600; font-size: 0.95rem; color: var(--cc-ink); }
.event-doc-meta { font-size: 0.78rem; color: var(--cc-muted); }
.event-doc-action { color: var(--cc-primary); font-size: 0.85rem; font-weight: 500; flex-shrink: 0; }

@media (max-width: 480px) {
    .event-doc-tabs { display: flex; width: 100%; }
    .event-doc-tab { flex: 1; }
    .event-doc-tab span { display: block; text-align: center; }
}

/* =========================================
   PLATFORM ESCALATIONS
   Shared UI: status chips, list rows, detail cards, resolve form.
   ========================================= */

/* Status chips */
.escalation-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--cc-r-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.escalation-status-open {
    background: #fef3c7; color: #92400e; border-color: #fde68a;
}
.escalation-status-reviewing {
    background: #dbeafe; color: #1e40af; border-color: #bfdbfe;
}
.escalation-status-resolved {
    background: #d1fae5; color: #065f46; border-color: #a7f3d0;
}

.escalation-type-chip {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 4px;
    font-size: 0.72rem;
    color: var(--cc-muted);
    background: var(--cc-surface-3);
    border-radius: var(--cc-r-full);
    letter-spacing: 0.02em;
}

/* "Escalated ↑" badge on mod queue */
.escalated-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    border-radius: var(--cc-r-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Mod-queue "Escalate to ClubCity" disclosure */
.mod-escalate-wrap {
    margin-top: 6px;
}
.mod-escalate-btn {
    cursor: pointer;
    list-style: none;
}
.mod-escalate-btn::-webkit-details-marker { display: none; }
.mod-escalate-form {
    margin-top: 8px;
    padding: 10px;
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}
.mod-escalate-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r-sm);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}
.mod-escalate-form textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}
.mod-escalate-form button { align-self: flex-end; }

/* Escalations list (admin + superadmin share this) */
.escalation-widget {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--cc-divider);
}
.escalation-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}
.escalation-widget-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cc-ink);
}
.escalation-empty {
    color: var(--cc-muted);
    font-style: italic;
    margin: 8px 0;
}
.escalation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.escalation-row {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    transition: border-color var(--cc-t-fast);
}
.escalation-row:hover { border-color: var(--cc-primary); }
.escalation-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    color: var(--cc-ink);
    text-decoration: none;
}
.escalation-link:hover { text-decoration: none; }
.escalation-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.escalation-title {
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--cc-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.escalation-meta {
    color: var(--cc-muted);
    font-size: 0.78rem;
}

/* Contact ClubCity card */
.contact-clubcity-card {
    margin-top: 24px;
    padding: 20px 22px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-xs);
}
.contact-clubcity-header h2 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 600;
}
.contact-clubcity-header p { margin: 0 0 14px; font-size: 0.88rem; }
.contact-clubcity-form .form-group { margin-bottom: 14px; }
.contact-clubcity-form input[type="text"],
.contact-clubcity-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}
.contact-clubcity-form input:focus,
.contact-clubcity-form textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}

/* Escalation detail pages (admin + superadmin share) */
.escalation-detail {
    max-width: 820px;
}
.escalation-detail-header {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cc-divider);
}
.escalation-detail-header h1 {
    margin: 10px 0 6px;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.escalation-detail-header .escalation-meta {
    color: var(--cc-muted);
    font-size: 0.9rem;
}
.escalation-section {
    margin-bottom: 24px;
}
.escalation-section h2 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cc-muted);
    margin: 0 0 10px;
}
.escalation-body {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    padding: 14px 16px;
    color: var(--cc-ink);
    font-size: 0.95rem;
    line-height: 1.55;
    white-space: pre-wrap;
}
.escalation-subcard {
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r);
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--cc-ink);
}
.escalation-subcard p { margin: 0 0 8px; color: var(--cc-ink); }
.escalation-quote {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-left: 3px solid var(--cc-border-2);
    color: var(--cc-muted);
    background: var(--cc-surface);
    font-size: 0.88rem;
}
.escalation-content-peek {
    margin-top: 10px;
}
.escalation-content-peek summary {
    cursor: pointer;
    color: var(--cc-primary);
    font-size: 0.85rem;
    font-weight: 500;
}
.escalation-content-dump {
    margin-top: 8px;
    padding: 10px;
    background: var(--cc-surface-3);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-sm);
    font-size: 0.78rem;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Resolved section accent */
.escalation-resolved h2 { color: #065f46; }
.escalation-resolve-form {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    padding: 18px 22px;
}
.escalation-resolve-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-2);
    border-radius: var(--cc-r);
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 100px;
    resize: vertical;
    box-sizing: border-box;
}
.escalation-resolve-form textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus);
}

/* Superadmin filter tabs above the escalation index table */
.escalation-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--cc-surface-3);
    border-radius: var(--cc-r-full);
    width: fit-content;
}
.escalation-filter-tabs a {
    padding: 6px 14px;
    border-radius: var(--cc-r-full);
    color: var(--cc-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.escalation-filter-tabs a.active {
    background: var(--cc-surface);
    color: var(--cc-ink);
    box-shadow: var(--cc-shadow-xs);
}
.escalation-filter-tabs a:hover { color: var(--cc-ink); text-decoration: none; }

/* Superadmin nav badge */
.superadmin-nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 2px 6px;
    margin-left: 6px;
    background: #f43f5e;
    color: #fff;
    border-radius: var(--cc-r-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
}

/* Utility */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ──────────────────────────────────────────────────────────────
   SEARCH RESULTS — global search page (/search)
   Grouped-section results, chip filters, snippet highlight.
   Names use the `sr-*` prefix so they don't collide with the
   legacy `.search-*` rules (which still power the search-bar
   form input above).
   ────────────────────────────────────────────────────────────── */

.search-page-title { margin-bottom: 16px; }

/* Filter chips */
.search-filters .sr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--cc-border, #e4e6eb);
    border-radius: 999px;
    background: var(--cc-surface, #fff);
    color: var(--cc-ink-2, #3c4043);
    font-size: 0.85rem;
    line-height: 1;
    text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.search-filters .sr-chip:hover {
    background: var(--cc-surface-2, #f7f9fc);
    border-color: var(--cc-border-2, #ced0d4);
    text-decoration: none;
}
.search-filters .sr-chip-active {
    background: var(--cc-primary, #2563eb);
    border-color: var(--cc-primary, #2563eb);
    color: #fff;
}
.search-filters .sr-chip-active:hover {
    background: var(--cc-primary-hover, #1d4ed8);
    border-color: var(--cc-primary-hover, #1d4ed8);
    color: #fff;
}
.search-filters .sr-chip-count {
    opacity: 0.8;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Empty / no-match state */
.sr-empty {
    background: var(--cc-surface, #fff);
    border: 1px solid var(--cc-border, #e4e6eb);
    border-radius: 8px;
    padding: 32px 20px;
    margin-top: 16px;
    text-align: center;
    color: var(--cc-muted, #5f6368);
}
.sr-empty p { margin: 4px 0; }
.sr-empty strong { color: var(--cc-ink, #1c1e21); }

/* Grouped section */
.sr-section {
    margin-top: 24px;
}
.sr-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--cc-divider, #f0f2f5);
}
.sr-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cc-ink, #1c1e21);
}
.sr-section-count {
    font-weight: 400;
    color: var(--cc-muted, #5f6368);
    font-size: 0.95rem;
    margin-left: 4px;
}
.sr-see-all {
    font-size: 0.85rem;
    color: var(--cc-primary, #2563eb);
    text-decoration: none;
    white-space: nowrap;
}
.sr-see-all:hover { text-decoration: underline; }

/* Result list */
.sr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sr-item {
    margin: 0;
}
.sr-item-link {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--cc-surface, #fff);
    border: 1px solid var(--cc-border, #e4e6eb);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--cc-ink, #1c1e21);
    text-decoration: none;
    transition: box-shadow 120ms ease, border-color 120ms ease;
}
.sr-item-link:hover {
    border-color: var(--cc-border-2, #ced0d4);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
}
.sr-icon {
    flex: 0 0 auto;
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--cc-surface-2, #f7f9fc);
    border-radius: 50%;
    line-height: 1;
}
.sr-body {
    flex: 1 1 auto;
    min-width: 0;           /* allow text-overflow to work inside flex child */
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sr-title {
    font-weight: 600;
    color: var(--cc-ink, #1c1e21);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.sr-snippet {
    font-size: 0.9rem;
    color: var(--cc-ink-2, #3c4043);
    line-height: 1.4;
    word-break: break-word;
}
.sr-snippet mark {
    background: #fff3a8;        /* soft yellow — matches typical search-hit */
    color: var(--cc-ink, #1c1e21);
    padding: 0 2px;
    border-radius: 2px;
}
.sr-meta {
    font-size: 0.8rem;
    color: var(--cc-muted, #5f6368);
}

/* Narrow screens — stack the section heading + "see all" link */
@media (max-width: 520px) {
    .sr-section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .sr-icon {
        width: 28px; height: 28px;
        font-size: 1rem;
    }
}

/* =========================================
   NOTIFICATIONS — individual row actions
   ========================================= */
.notification-actions {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}
.notification-delete-form { display: inline; margin: 0; }
.notification-delete-btn {
    color: var(--cc-muted-2);
    font-weight: 500;
    line-height: 1;
}
.notification-delete-btn:hover {
    background: #fef2f2;
    color: var(--cc-danger);
}

/* Profile edit — avatar action buttons row */
.profile-edit-avatar-buttons {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.profile-edit-avatar-remove-form { display: inline; margin: 0; }
.profile-edit-avatar-remove-btn {
    color: var(--cc-muted);
}
.profile-edit-avatar-remove-btn:hover {
    color: var(--cc-danger);
    background: #fef2f2;
}

/* =========================================
   NOTIFICATION BELL — dropdown preview + pulse
   ========================================= */
.nav-notif-wrap {
    position: relative;
    display: inline-flex;
}
.nav-notifications { user-select: none; cursor: pointer; }

/* Bell pulse on new notification arrival */
@keyframes bell-ring {
    0%   { transform: rotate(0) scale(1); }
    15%  { transform: rotate(-14deg) scale(1.05); }
    30%  { transform: rotate(12deg) scale(1.05); }
    45%  { transform: rotate(-8deg) scale(1.02); }
    60%  { transform: rotate(6deg) scale(1.02); }
    80%  { transform: rotate(-2deg) scale(1); }
    100% { transform: rotate(0) scale(1); }
}
.nav-notifications.bell-ring {
    animation: bell-ring 600ms ease-in-out;
    transform-origin: top center;
}

/* Dropdown panel */
.nav-notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-lg);
    z-index: 100;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transition: opacity var(--cc-t-fast), transform var(--cc-t-fast);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 480px;
}
.nav-notif-dropdown[hidden] { display: none; }
.nav-notif-dropdown.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Dropdown header + footer */
.nav-notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cc-divider);
    flex-shrink: 0;
}
.nav-notif-dropdown-header strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cc-ink);
}
.nav-notif-mark-all {
    font-size: 0.8rem;
    color: var(--cc-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nav-notif-mark-all:hover { text-decoration: underline; }
.nav-notif-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--cc-divider);
    text-align: center;
    flex-shrink: 0;
    background: var(--cc-surface-2);
}
.nav-notif-dropdown-footer a {
    font-size: 0.85rem;
    color: var(--cc-primary);
    font-weight: 500;
    text-decoration: none;
}
.nav-notif-dropdown-footer a:hover { text-decoration: underline; }

/* Dropdown item list */
.nav-notif-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    flex: 1;
}
.nav-notif-loading,
.nav-notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--cc-muted);
    font-size: 0.88rem;
}
.nav-notif-empty span[aria-hidden="true"] {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 6px;
    opacity: 0.7;
}

.nav-notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--cc-t-fast);
    position: relative;
    border-left: 2px solid transparent;
}
.nav-notif-item:hover { background: var(--cc-surface-3); }
.nav-notif-item.is-unread {
    background: var(--cc-primary-soft, #eef4fb);
    border-left-color: var(--cc-primary);
}
.nav-notif-item.is-unread:hover {
    background: #dcebf7;
}
.nav-notif-item.is-read { color: var(--cc-muted-2); }

.nav-notif-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--cc-r-full);
    background: var(--cc-surface-3);
    font-size: 0.95rem;
}
.nav-notif-item.is-unread .nav-notif-icon {
    background: var(--cc-surface);
}
.nav-notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-notif-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--cc-ink);
    line-height: 1.3;
    /* two-line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nav-notif-item.is-read .nav-notif-title { font-weight: 400; color: var(--cc-muted); }
.nav-notif-text {
    font-size: 0.8rem;
    color: var(--cc-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-notif-time {
    font-size: 0.72rem;
    color: var(--cc-muted-2);
    margin-top: 2px;
}

/* Mobile: full-width sheet from the top right */
@media (max-width: 480px) {
    .nav-notif-dropdown {
        position: fixed;
        top: 60px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 80px);
    }
}

/* Invite row — stack actions (Flyer + Revoke) on the same row */
.invite-row-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* =============================================================
   MODERN UPLIFT 2026-04 — Amazon/eBay-inspired marketplace feel
   Append-only overrides; every rule uses `body .selector` for
   specificity so we can revert by deleting this block.
   No new deps, no HTML changes, mobile-first, light-mode only.
   ============================================================= */

/* ---- New tokens (additive only) ---------------------------- */
:root {
    --cc-gradient-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --cc-gradient-primary-hover: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
    --cc-gradient-accent:  linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    --cc-gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --cc-gradient-warm:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --cc-gradient-gold:    linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);

    --cc-shadow-float:      0 16px 40px -12px rgba(17, 24, 39, 0.18);
    --cc-shadow-card-hover: 0 14px 32px -14px rgba(37, 99, 235, 0.25);
    --cc-shadow-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);
    --cc-border-soft:       rgba(15, 23, 42, 0.06);
    --cc-border-input:      #d6dae1;

    /* 6 inclusive avatar gradients */
    --cc-avatar-1: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); /* indigo */
    --cc-avatar-2: linear-gradient(135deg, #fb7185 0%, #e11d48 100%); /* rose */
    --cc-avatar-3: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); /* amber */
    --cc-avatar-4: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%); /* teal */
    --cc-avatar-5: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%); /* violet */
    --cc-avatar-6: linear-gradient(135deg, #34d399 0%, #059669 100%); /* emerald */
}

/* ---- 1. Sticky header -------------------------------------- */
body .site-header {
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--cc-border-soft);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04), 0 8px 24px -18px rgba(17, 24, 39, 0.18);
    transition: box-shadow 200ms ease;
}

body .site-header .main-nav a,
body .main-nav a {
    border-radius: var(--cc-r-full);
    padding: 8px 14px;
    font-weight: 500;
    transition: background-color 150ms ease, color 150ms ease;
}
body .main-nav a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--cc-primary);
    text-decoration: none;
}
body .main-nav a.active,
body .main-nav a[aria-current="page"] {
    background: rgba(37, 99, 235, 0.12);
    color: var(--cc-primary);
    font-weight: 600;
}

/* Header search pill */
body .site-header input[type="search"],
body .site-header .header-search input,
body .site-header form input[type="text"] {
    border-radius: var(--cc-r-full);
    border: 1px solid var(--cc-border-input);
    padding: 10px 16px;
    background: var(--cc-surface-2);
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
body .site-header input[type="search"]:focus,
body .site-header .header-search input:focus {
    outline: none;
    background: var(--cc-surface);
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus-ring);
}

/* ---- 2. Cards ---------------------------------------------- */
body .fb-post-card,
body .neighborhood-card,
body .sidebar-card,
body .event-card,
body .invite-card,
body .docs-row {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border-soft);
    border-radius: var(--cc-r-lg);
    box-shadow: var(--cc-shadow-sm);
    padding: 18px;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body .fb-post-card:hover,
body .neighborhood-card:hover,
body .event-card:hover,
body .invite-card:hover,
body .docs-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-card-hover);
    border-color: rgba(37, 99, 235, 0.18);
}

/* Marketplace tile feel for /neighborhoods */
body .neighborhood-card {
    overflow: hidden;
    position: relative;
}
body .neighborhood-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--cc-gradient-primary);
    opacity: 0;
    transition: opacity 180ms ease;
}
body .neighborhood-card:hover::before { opacity: 1; }

body .sidebar-card {
    padding: 16px;
}

/* Docs row: more breathing room */
body .docs-row {
    padding: 14px 18px;
}

/* ---- 3. Buttons -------------------------------------------- */
body .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
    -webkit-font-smoothing: antialiased;
}

body .btn:focus-visible {
    outline: none;
    box-shadow: var(--cc-shadow-focus-ring);
}

body .btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
}

body .btn-lg {
    padding: 14px 24px;
    font-size: 1.02rem;
    border-radius: 12px;
}

body .btn-primary {
    background: var(--cc-gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.45);
}
body .btn-primary:hover {
    background: var(--cc-gradient-primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -8px rgba(37, 99, 235, 0.55);
}
body .btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px -2px rgba(37, 99, 235, 0.45);
}

body .btn-outline {
    background: var(--cc-surface);
    color: var(--cc-primary);
    border-color: var(--cc-primary);
}
body .btn-outline:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--cc-primary-hover);
    border-color: var(--cc-primary-hover);
    transform: translateY(-1px);
}
body .btn-outline:active { transform: translateY(1px); }

body .btn-ghost {
    background: transparent;
    color: var(--cc-ink);
    border-color: transparent;
}
body .btn-ghost:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--cc-ink);
}
body .btn-ghost:active { transform: translateY(1px); }

/* Pill variant for chip-style actions */
body .btn.btn-pill,
body .btn-chip {
    border-radius: var(--cc-r-full);
    padding: 8px 16px;
}

/* ---- 4. Form inputs ---------------------------------------- */
body .form-standard input[type="text"],
body .form-standard input[type="email"],
body .form-standard input[type="password"],
body .form-standard input[type="search"],
body .form-standard input[type="url"],
body .form-standard input[type="tel"],
body .form-standard input[type="number"],
body .form-standard input[type="date"],
body .form-standard input[type="datetime-local"],
body .form-standard textarea,
body .form-standard select,
body .form-group input[type="text"],
body .form-group input[type="email"],
body .form-group input[type="password"],
body .form-group input[type="search"],
body .form-group input[type="url"],
body .form-group input[type="tel"],
body .form-group input[type="number"],
body .form-group input[type="date"],
body .form-group input[type="datetime-local"],
body .form-group textarea,
body .form-group select {
    padding: 12px 14px;
    border: 1px solid var(--cc-border-input);
    border-radius: 10px;
    background: var(--cc-surface);
    color: var(--cc-ink);
    font-size: 0.95rem;
    line-height: 1.4;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
    width: 100%;
}

body .form-standard input:focus,
body .form-standard textarea:focus,
body .form-standard select:focus,
body .form-group input:focus,
body .form-group textarea:focus,
body .form-group select:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus-ring);
    background: var(--cc-surface);
}

body .form-standard label,
body .form-group label {
    font-weight: 600;
    color: var(--cc-ink);
    display: inline-block;
    margin-bottom: 6px;
}

body .form-standard .help-text,
body .form-standard .form-help,
body .form-group .help-text,
body .form-group .form-help,
body .form-standard small,
body .form-group small {
    font-size: 0.82rem;
    color: var(--cc-muted);
    display: block;
    margin-top: 6px;
}

body .form-standard .has-error input,
body .form-standard .has-error textarea,
body .form-standard .has-error select,
body .form-group .has-error input,
body .form-group .has-error textarea,
body .form-group .has-error select,
body .form-standard input.is-invalid,
body .form-group input.is-invalid {
    border-color: var(--cc-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

body .form-standard .error-message,
body .form-group .error-message,
body .form-standard .invalid-feedback,
body .form-group .invalid-feedback {
    color: var(--cc-danger);
    font-size: 0.82rem;
    margin-top: 6px;
}

/* ---- 5. Feed & navigation ---------------------------------- */
body .fb-feed-toolbar {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border-soft);
    border-radius: var(--cc-r-lg);
    padding: 12px 14px;
    box-shadow: var(--cc-shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

body .fb-sort-tabs {
    display: inline-flex;
    gap: 6px;
    background: var(--cc-surface-3);
    padding: 4px;
    border-radius: var(--cc-r-full);
}

body .fb-sort-tabs a,
body .fb-sort-tabs button,
body .fb-sort-tabs .tab {
    padding: 8px 16px;
    border-radius: var(--cc-r-full);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--cc-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

body .fb-sort-tabs a:hover,
body .fb-sort-tabs button:hover,
body .fb-sort-tabs .tab:hover {
    color: var(--cc-ink);
    background: rgba(255, 255, 255, 0.6);
}

body .fb-sort-tabs a.active,
body .fb-sort-tabs button.active,
body .fb-sort-tabs .tab.active,
body .fb-sort-tabs a[aria-selected="true"],
body .fb-sort-tabs button[aria-selected="true"] {
    background: var(--cc-gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.45);
}

/* Type filter dropdowns in toolbars */
body .fb-feed-toolbar select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--cc-border-input);
    border-radius: 10px;
    background: var(--cc-surface);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--cc-ink);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--cc-muted) 50%),
                      linear-gradient(135deg, var(--cc-muted) 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
body .fb-feed-toolbar select:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-focus-ring);
}

/* ---- 6. Badges & chips ------------------------------------- */
body .badge,
body [class*="badge-"],
body .vote-record,
body .nav-badge,
body .classified-category,
body .hashtag,
body [class*="escalation-status-"] {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--cc-r-full);
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
    border: 1px solid transparent;
}

body .badge-primary,
body .badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--cc-primary-hover);
    border-color: rgba(37, 99, 235, 0.18);
}
body .badge-success,
body [class*="escalation-status-resolved"] {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.22);
}
body .badge-warning,
body [class*="escalation-status-reviewing"] {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
}
body .badge-danger,
body [class*="escalation-status-open"] {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.22);
}
body .badge-accent {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.22);
}

body .hashtag {
    background: rgba(37, 99, 235, 0.08);
    color: var(--cc-primary);
    padding: 2px 8px;
    box-shadow: none;
    border-color: transparent;
}
body .hashtag:hover {
    background: rgba(37, 99, 235, 0.14);
    text-decoration: none;
}

body .nav-badge {
    background: var(--cc-gradient-warm);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px -1px rgba(239, 68, 68, 0.4);
}

body .classified-category {
    background: rgba(124, 58, 237, 0.1);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.2);
}

/* ---- 7. Avatars & trust signals ---------------------------- */
body .avatar-placeholder {
    background: var(--cc-avatar-1);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 6px -2px rgba(17, 24, 39, 0.25);
}

/* Explicit variants (if HTML opts in later) */
body .avatar-placeholder.avatar-placeholder-1 { background: var(--cc-avatar-1); }
body .avatar-placeholder.avatar-placeholder-2 { background: var(--cc-avatar-2); }
body .avatar-placeholder.avatar-placeholder-3 { background: var(--cc-avatar-3); }
body .avatar-placeholder.avatar-placeholder-4 { background: var(--cc-avatar-4); }
body .avatar-placeholder.avatar-placeholder-5 { background: var(--cc-avatar-5); }
body .avatar-placeholder.avatar-placeholder-6 { background: var(--cc-avatar-6); }

/* Inclusive auto-variation via :nth-of-type where many avatars sit side-by-side */
body .avatar-placeholder:nth-of-type(6n + 1) { background: var(--cc-avatar-1); }
body .avatar-placeholder:nth-of-type(6n + 2) { background: var(--cc-avatar-2); }
body .avatar-placeholder:nth-of-type(6n + 3) { background: var(--cc-avatar-3); }
body .avatar-placeholder:nth-of-type(6n + 4) { background: var(--cc-avatar-4); }
body .avatar-placeholder:nth-of-type(6n + 5) { background: var(--cc-avatar-5); }
body .avatar-placeholder:nth-of-type(6n + 6) { background: var(--cc-avatar-6); }

/* Trust badge pill (new reusable class — HTML to opt in later) */
body .trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 8px;
    border-radius: var(--cc-r-full);
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}
body .trust-badge::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cc-gradient-success);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}
body .trust-badge.trust-badge-admin {
    background: rgba(37, 99, 235, 0.1);
    color: var(--cc-primary-hover);
    border-color: rgba(37, 99, 235, 0.22);
}
body .trust-badge.trust-badge-admin::before {
    background: var(--cc-gradient-primary);
}

/* Star rating — gold gradient fill */
body .star-rating,
body .business-rating,
body .rating-stars {
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    background: var(--cc-gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* ---- 8. Empty states --------------------------------------- */
body .empty-state,
body .docs-empty,
body .msg-empty {
    text-align: center;
    padding: 48px 24px;
    border-radius: var(--cc-r-lg);
    background:
        radial-gradient(circle at 1px 1px, rgba(37, 99, 235, 0.08) 1px, transparent 0) 0 0 / 18px 18px,
        var(--cc-surface);
    border: 1px solid var(--cc-border-soft);
    color: var(--cc-muted);
}

body .empty-state::before,
body .docs-empty::before,
body .msg-empty::before {
    content: "";
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--cc-gradient-primary);
    opacity: 0.15;
    box-shadow: 0 8px 24px -8px rgba(37, 99, 235, 0.5);
}

body .empty-state h2,
body .empty-state h3,
body .docs-empty h2,
body .docs-empty h3,
body .msg-empty h2,
body .msg-empty h3 {
    color: var(--cc-ink);
    margin-bottom: 8px;
}

body .empty-state p,
body .docs-empty p,
body .msg-empty p {
    max-width: 42ch;
    margin: 0 auto 18px;
    line-height: 1.55;
}

/* ---- 9. Loading / skeletons -------------------------------- */
body .cc-skeleton {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--cc-surface-3);
    border-radius: var(--cc-r);
    color: transparent !important;
    user-select: none;
    min-height: 1em;
}
body .cc-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: cc-shimmer 1.4s ease-in-out infinite;
}
body .cc-skeleton.cc-skeleton-line { height: 0.9em; margin: 6px 0; }
body .cc-skeleton.cc-skeleton-title { height: 1.35em; width: 60%; margin: 8px 0; }
body .cc-skeleton.cc-skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}
body .cc-skeleton.cc-skeleton-card {
    height: 140px;
    width: 100%;
    border-radius: var(--cc-r-lg);
}

/* ---- 10. Microanimations ----------------------------------- */
@keyframes cc-lift {
    from { transform: translateY(0); }
    to   { transform: translateY(-2px); }
}

@keyframes cc-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes cc-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- 11. Scrollbar (webkit-only, progressive) -------------- */
body .fb-feed,
body .main-content,
body .sidebar-card,
body .docs-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(17, 24, 39, 0.2) transparent;
}
body .fb-feed::-webkit-scrollbar,
body .main-content::-webkit-scrollbar,
body .sidebar-card::-webkit-scrollbar,
body .docs-list::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
body .fb-feed::-webkit-scrollbar-track,
body .main-content::-webkit-scrollbar-track,
body .sidebar-card::-webkit-scrollbar-track,
body .docs-list::-webkit-scrollbar-track {
    background: transparent;
}
body .fb-feed::-webkit-scrollbar-thumb,
body .main-content::-webkit-scrollbar-thumb,
body .sidebar-card::-webkit-scrollbar-thumb,
body .docs-list::-webkit-scrollbar-thumb {
    background: rgba(17, 24, 39, 0.18);
    border-radius: var(--cc-r-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}
body .fb-feed::-webkit-scrollbar-thumb:hover,
body .main-content::-webkit-scrollbar-thumb:hover,
body .sidebar-card::-webkit-scrollbar-thumb:hover,
body .docs-list::-webkit-scrollbar-thumb:hover {
    background: rgba(17, 24, 39, 0.32);
    background-clip: padding-box;
}

/* ---- 12. Typography hierarchy ------------------------------ */
body h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--cc-ink);
}
body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--cc-ink);
}
body h3 {
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cc-ink);
}
body p,
body li,
body td,
body .fb-post-body {
    font-size: 0.94rem;
    line-height: 1.55;
}
body time,
body .fb-post-meta time,
body .post-date,
body .count,
body .counter,
body [class*="-count"],
body [class*="-date"] {
    font-variant-numeric: tabular-nums;
}

/* ---- Global focus-visible fallback ------------------------- */
body a:focus-visible,
body button:focus-visible,
body [role="button"]:focus-visible,
body input:focus-visible,
body select:focus-visible,
body textarea:focus-visible {
    outline: none;
    box-shadow: var(--cc-shadow-focus-ring);
    border-radius: var(--cc-r-sm);
}

/* ---- Mobile tweaks ----------------------------------------- */
@media (max-width: 600px) {
    body h1 { font-size: 1.6rem; }
    body h2 { font-size: 1.2rem; }
    body .fb-post-card,
    body .neighborhood-card,
    body .sidebar-card,
    body .event-card,
    body .invite-card {
        padding: 14px;
        border-radius: var(--cc-r-md);
    }
    body .btn { padding: 10px 16px; }
    body .btn-lg { padding: 12px 18px; font-size: 1rem; }
    body .fb-sort-tabs { flex-wrap: wrap; }
    body .fb-sort-tabs a,
    body .fb-sort-tabs button,
    body .fb-sort-tabs .tab {
        padding: 7px 12px;
        font-size: 0.82rem;
    }
    body .empty-state,
    body .docs-empty,
    body .msg-empty {
        padding: 36px 18px;
    }
    body .empty-state::before,
    body .docs-empty::before,
    body .msg-empty::before {
        width: 56px;
        height: 56px;
    }
}

/* ---- Reduced-motion: disable all the fancy bits ------------ */
@media (prefers-reduced-motion: reduce) {
    body .fb-post-card,
    body .neighborhood-card,
    body .sidebar-card,
    body .event-card,
    body .invite-card,
    body .docs-row,
    body .btn,
    body .btn-primary,
    body .btn-outline,
    body .btn-ghost,
    body .fb-sort-tabs a,
    body .fb-sort-tabs button,
    body .main-nav a,
    body .site-header input,
    body .form-standard input,
    body .form-group input {
        transition: none !important;
    }
    body .fb-post-card:hover,
    body .neighborhood-card:hover,
    body .event-card:hover,
    body .invite-card:hover,
    body .docs-row:hover,
    body .btn-primary:hover,
    body .btn-outline:hover {
        transform: none !important;
    }
    body .cc-skeleton::after {
        animation: none !important;
    }
}
/* ============ END MODERN UPLIFT 2026-04 ===================== */
