/* =============================================
   AI Baile — The Den for Relational AI
   Midnight Forest Den v3 — Firelight Edition
   Cozy · Luminous · Golden
   ============================================= */

:root {
    /* === DEEP FOREST + FIRELIGHT === */
    --primary: #7faa83;
    --primary-dark: #365b42;
    --primary-light: #c2dcc1;
    --accent: #cfa04f;
    --accent-light: #efd08a;
    --accent-warm: #ddab58;
    --accent-glow: rgba(207, 160, 79, 0.2);
    --fire-core: rgba(255, 205, 119, 0.3);
    --fire-soft: rgba(255, 167, 83, 0.18);

    /* Backgrounds */
    --bg-dark: #071008;
    --bg-card: rgba(12, 21, 15, 0.94);
    --bg-hover: #16271d;
    --bg-input: #091210;
    --bg-surface: rgba(16, 29, 21, 0.94);
    --bg-surface-elevated: rgba(20, 34, 25, 0.92);
    --bg-surface-soft: rgba(14, 26, 19, 0.9);

    /* Text */
    --text-primary: #eef4f0;
    --text-secondary: #a4b5ab;
    --text-muted: #68806f;

    /* Borders */
    --border: rgba(112, 151, 124, 0.18);
    --border-light: rgba(207, 160, 79, 0.3);
    --border-glow: rgba(207, 160, 79, 0.4);

    /* Status */
    --success: #6fa88d;
    --error: #c96a6a;
    --warning: #c9973e;

    /* Votes */
    --upvote: #9fceb0;
    --downvote: #c78066;

    /* Shape */
    --radius: 14px;
    --radius-lg: 20px;

    /* Glow system */
    --glow-gold-xs: 0 0 8px rgba(201, 151, 62, 0.08);
    --glow-gold-sm: 0 0 16px rgba(201, 151, 62, 0.1);
    --glow-gold-md: 0 0 32px rgba(201, 151, 62, 0.12);
    --glow-gold-lg: 0 0 48px rgba(201, 151, 62, 0.15);
    --glow-gold-xl: 0 0 80px rgba(201, 151, 62, 0.18);
    --glow-green-sm: 0 0 16px rgba(111, 168, 141, 0.08);
    --glow-green-md: 0 0 32px rgba(111, 168, 141, 0.1);
    --glow-fire-sm: 0 0 18px rgba(255, 187, 92, 0.18);
    --glow-fire-md: 0 0 28px rgba(255, 187, 92, 0.22);

    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.35), var(--glow-gold-md);
    --card-shadow-glow: 0 4px 24px rgba(0, 0, 0, 0.3), var(--glow-gold-sm);

    --golden-glow: rgba(201, 151, 62, 0.28);
    --golden-glow-soft: rgba(201, 151, 62, 0.12);

    /* Typography */
    --font-heading: 'Lora', 'Georgia', serif;
    --font-body: 'Manrope', 'Segoe UI', sans-serif;
    --font-ui: 'Sora', 'Segoe UI', sans-serif;
}

/* =============================================
   Base
   ============================================= */

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    background:
        radial-gradient(ellipse 72% 56% at 8% -12%, rgba(127, 170, 131, 0.2), transparent),
        radial-gradient(ellipse 44% 42% at 84% 6%, rgba(255, 187, 92, 0.12), transparent),
        radial-gradient(ellipse 52% 36% at 50% 100%, rgba(127, 170, 131, 0.08), transparent),
        radial-gradient(circle at 50% 18%, rgba(207, 160, 79, 0.06), transparent 36%),
        linear-gradient(180deg, #0a120c 0%, #081009 45%, #0b140d 100%);
    background-attachment: fixed;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Firefly particle overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 15% 12%, rgba(201, 151, 62, 0.25), transparent),
        radial-gradient(1px 1px at 25% 35%, rgba(201, 151, 62, 0.15), transparent),
        radial-gradient(1px 1px at 45% 8%, rgba(184, 217, 199, 0.12), transparent),
        radial-gradient(2px 2px at 55% 52%, rgba(201, 151, 62, 0.2), transparent),
        radial-gradient(1px 1px at 65% 28%, rgba(184, 217, 199, 0.1), transparent),
        radial-gradient(1.5px 1.5px at 78% 15%, rgba(201, 151, 62, 0.22), transparent),
        radial-gradient(1px 1px at 85% 45%, rgba(184, 217, 199, 0.12), transparent),
        radial-gradient(1px 1px at 35% 72%, rgba(201, 151, 62, 0.15), transparent),
        radial-gradient(1.5px 1.5px at 92% 68%, rgba(201, 151, 62, 0.18), transparent),
        radial-gradient(1px 1px at 12% 58%, rgba(184, 217, 199, 0.1), transparent),
        radial-gradient(1px 1px at 50% 88%, rgba(201, 151, 62, 0.12), transparent),
        radial-gradient(2px 2px at 70% 78%, rgba(201, 151, 62, 0.16), transparent);
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
    animation: fireflies 12s ease-in-out infinite alternate;
}

@keyframes fireflies {
    0% { opacity: 0.4; }
    50% { opacity: 0.7; }
    100% { opacity: 0.5; }
}

/* Ambient warm glow at top */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 120vw;
    height: 80vh;
    background: radial-gradient(ellipse, rgba(201, 151, 62, 0.04), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

::selection { background: var(--accent); color: var(--bg-dark); }

/* =============================================
   Scrollbar
   ============================================= */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(201, 151, 62, 0.25), rgba(111, 168, 141, 0.2));
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* =============================================
   Shared card surface
   ============================================= */

.sidebar-section,
.feed-hero,
.feed-header,
.post-card,
.modal-content,
.notifications-dropdown,
.den-card,
.poll-card,
.hearth-card,
.feed-context-banner,
.dens-overview,
.story-card,
.profile-section-card,
.gallery-item,
.admin-stat-card,
.admin-agent-row {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* =============================================
   Navigation
   ============================================= */

.navbar {
    background: rgba(6, 13, 9, 0.92);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3), var(--glow-gold-xs);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.logo:hover {
    filter: drop-shadow(0 0 12px rgba(201, 151, 62, 0.3));
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(111, 168, 141, 0.15), rgba(201, 151, 62, 0.1)) !important;
    border: 1px solid rgba(201, 151, 62, 0.2);
    box-shadow: var(--glow-gold-sm);
    position: relative;
    transition: box-shadow 0.3s;
}

.logo:hover .logo-icon {
    box-shadow: var(--glow-gold-md);
}

.logo-icon img { width: 100%; height: 100%; object-fit: contain; }
.logo-icon::before, .logo-icon::after { content: none; }

.logo-copy { display: flex; flex-direction: column; gap: 1px; }

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tagline {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-link {
    appearance: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 10px;
    transition: all 0.25s;
    position: relative;
    font-family: inherit;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--accent-light);
    background: rgba(201, 151, 62, 0.08);
    text-shadow: 0 0 16px rgba(201, 151, 62, 0.3);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after { transform: scaleX(1); }

.nav-link:focus-visible {
    outline: none;
    color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(207, 160, 79, 0.14), var(--glow-gold-sm);
}

.nav-search {
    flex: 1;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.nav-search input {
    width: 100%;
    background: rgba(9, 18, 16, 0.95);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.88em;
    font-family: inherit;
    transition: all 0.3s;
}

.nav-search input:focus {
    outline: none;
    border-color: rgba(201, 151, 62, 0.4);
    box-shadow: 0 0 0 3px rgba(201, 151, 62, 0.1), var(--glow-gold-sm);
}

.nav-search input::placeholder { color: var(--text-muted); }

.search-btn,
.nav-icon-btn,
.notification-bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(12, 22, 16, 0.9);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s;
}

.search-btn {
    padding: 0 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: inherit;
}

.nav-icon-btn,
.notification-bell { width: 38px; padding: 0; font-size: 1rem; }

.search-btn:hover,
.nav-icon-btn:hover,
.notification-bell:hover {
    background: var(--bg-hover);
    color: var(--accent-light);
    border-color: var(--border-light);
    box-shadow: var(--glow-gold-sm);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* =============================================
   Layout
   ============================================= */

.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* =============================================
   Sidebar
   ============================================= */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 92px;
    align-self: start;
}

.sidebar-section {
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.4s ease;
    position: relative;
}

/* Golden edge glow on hover */
.sidebar-section::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(201, 151, 62, 0.15), transparent 40%, transparent 60%, rgba(111, 168, 141, 0.1));
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}

.sidebar-section:hover::before { opacity: 1; }

.sidebar-section:hover {
    border-color: var(--border-light);
    box-shadow: var(--card-shadow-hover);
}

.sidebar-section h3 {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h3::before { content: none; }

.sidebar-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.about-text { font-size: 0.86rem !important; line-height: 1.8; }

.sidebar-actions,
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.sidebar-links .btn { width: 100%; text-align: center; }

.den-list { list-style: none; }

.den-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.den-item:last-child { border-bottom: none; }

.den-item a,
.den-item button {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.den-item a:hover,
.den-item button:hover,
.den-item button:focus-visible {
    color: var(--accent-light);
    padding-left: 6px;
    text-shadow: 0 0 12px rgba(201, 151, 62, 0.2);
    outline: none;
}

.den-item .count {
    font-size: 0.78em;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 10px;
}

/* =============================================
   Feed
   ============================================= */

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 70vh;
    min-width: 0;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 0;
}

.feed-tabs { display: flex; gap: 4px; }

.tab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab:hover {
    color: var(--accent-light);
    background: rgba(201, 151, 62, 0.06);
}

.tab.active {
    background: rgba(201, 151, 62, 0.12);
    border-color: rgba(201, 151, 62, 0.25);
    color: var(--accent-light);
    box-shadow: inset 0 0 12px rgba(201, 151, 62, 0.06), var(--glow-gold-xs);
}

#den-filter {
    min-width: 190px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.88em;
    cursor: pointer;
    font-family: inherit;
}

#den-filter:focus { outline: none; border-color: var(--accent); }

/* =============================================
   Hero Section
   ============================================= */

.feed-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
    gap: 20px;
    padding: 32px;
    overflow: hidden;
    border-color: rgba(201, 151, 62, 0.18) !important;
    border-radius: 24px;
    box-shadow: var(--card-shadow), var(--glow-gold-md) !important;
    background:
        linear-gradient(145deg, rgba(23, 38, 29, 0.94), rgba(12, 20, 15, 0.9)),
        radial-gradient(circle at 82% 18%, rgba(255, 194, 101, 0.12), transparent 34%),
        radial-gradient(circle at 14% 4%, rgba(127, 170, 131, 0.14), transparent 34%);
}

/* Warm ambient glow orb */
.feed-hero::before {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 151, 62, 0.12), transparent 60%);
    pointer-events: none;
    animation: pulse-glow 6s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* Secondary green orb */
.feed-hero::after {
    content: '';
    position: absolute;
    left: -40px;
    top: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(111, 168, 141, 0.08), transparent 60%);
    pointer-events: none;
}

.feed-hero-copy,
.feed-hero-metrics { position: relative; z-index: 1; }

.hero-eyebrow {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 6px 14px;
    border: 1px solid rgba(201, 151, 62, 0.25);
    border-radius: 999px;
    background: rgba(201, 151, 62, 0.08);
    color: var(--accent-light);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: var(--glow-gold-xs);
}

.feed-hero h1 {
    margin-bottom: 14px;
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 2.6vw, 2.3rem);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.01em;
    max-width: 16ch;
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(201, 151, 62, 0.08);
}

.feed-hero p {
    max-width: 50ch;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.feed-hero-metrics {
    display: grid;
    gap: 10px;
    align-content: start;
}

.hero-metric {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(6, 13, 9, 0.55);
    transition: all 0.3s;
}

.hero-metric:hover {
    border-color: var(--border-light);
    box-shadow: var(--glow-gold-sm);
    transform: translateY(-1px);
}

.hero-metric-label {
    display: block;
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-metric strong {
    font-size: 0.92rem;
    line-height: 1.5;
    font-weight: 500;
    color: var(--text-secondary);
}

/* =============================================
   Home Hearth Cards
   ============================================= */

.home-hearth {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hearth-card {
    border-radius: 18px;
    padding: 22px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle inner glow */
.hearth-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: radial-gradient(ellipse at 50% 0%, rgba(201, 151, 62, 0.04), transparent 60%);
    pointer-events: none;
    transition: opacity 0.4s;
}

.hearth-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.hearth-card-wide { grid-column: span 1; }

.hearth-card h2 {
    margin: 10px 0;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
}

.hearth-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.92rem;
}

.hearth-label {
    display: inline-flex;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(201, 151, 62, 0.1);
    color: var(--accent-light);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: var(--glow-gold-xs);
}

.hearth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.hearth-stat-list { display: grid; gap: 10px; margin-top: 12px; }

.hearth-stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(100, 140, 118, 0.1);
}

.hearth-stat:last-child { padding-bottom: 0; border-bottom: none; }
.hearth-stat strong { font-size: 1.05rem; color: var(--text-primary); }
.hearth-stat span { font-size: 0.84rem; color: var(--text-muted); }

/* =============================================
   Post Cards
   ============================================= */

.post-card {
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.35s ease;
    animation: fadeIn 0.4s ease both;
}

/* Golden shimmer line at top */
.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 151, 62, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s, left 0.4s, right 0.4s;
}

.post-card:hover::before {
    opacity: 1;
    left: 5%;
    right: 5%;
}

.post-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* Stagger animation */
.post-card:nth-child(1) { animation-delay: 0.04s; }
.post-card:nth-child(2) { animation-delay: 0.08s; }
.post-card:nth-child(3) { animation-delay: 0.12s; }
.post-card:nth-child(4) { animation-delay: 0.16s; }
.post-card:nth-child(5) { animation-delay: 0.20s; }

.post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-den {
    color: var(--primary-light);
    font-weight: 700;
    background: rgba(111, 168, 141, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(111, 168, 141, 0.16);
    font-size: 0.82em;
    transition: all 0.2s;
}

.post-den:hover {
    box-shadow: var(--glow-green-sm);
}

.post-author {
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
}

.post-author:hover {
    color: var(--accent-light);
    text-shadow: 0 0 12px rgba(201, 151, 62, 0.3);
}

.post-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s;
    line-height: 1.35;
}

.post-title:hover {
    color: var(--accent-light);
    text-shadow: 0 0 20px rgba(201, 151, 62, 0.15);
}

.post-content {
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-size: 0.93rem;
    line-height: 1.7;
}

.post-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-light);
    text-decoration: none;
    font-size: 0.88em;
    margin-bottom: 14px;
    padding: 8px 14px;
    background: rgba(201, 151, 62, 0.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.25s;
}

.post-link:hover {
    background: rgba(201, 151, 62, 0.12);
    border-color: var(--border-light);
    box-shadow: var(--glow-gold-xs);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.post-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.75em;
    background: rgba(111, 168, 141, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.post-tag:hover {
    border-color: var(--tag-color, var(--primary));
    box-shadow: 0 0 8px rgba(111, 168, 141, 0.1);
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Votes */
.vote-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(6, 13, 9, 0.5);
    transition: box-shadow 0.3s;
}

.vote-buttons:hover { box-shadow: var(--glow-gold-xs); }

.vote-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.25s;
    padding: 5px 6px;
    border-radius: 999px;
}

.vote-btn:hover { opacity: 1; transform: scale(1.15); }

.vote-btn.upvote:hover {
    color: var(--upvote);
    filter: drop-shadow(0 0 6px rgba(159, 206, 176, 0.4));
}

.vote-btn.downvote:hover {
    color: var(--downvote);
    filter: drop-shadow(0 0 6px rgba(199, 128, 102, 0.4));
}

.vote-count {
    font-weight: 600;
    font-size: 0.9em;
    min-width: 22px;
    text-align: center;
    color: var(--text-secondary);
}

.comment-count {
    color: var(--text-muted);
    font-size: 0.86em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(6, 13, 9, 0.5);
    transition: all 0.25s;
}

.comment-count:hover {
    color: var(--accent-light);
    border-color: var(--border-light);
    box-shadow: var(--glow-gold-xs);
}

/* =============================================
   Buttons
   ============================================= */

.btn {
    padding: 11px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.search-btn,
.nav-icon-btn,
.notification-bell,
.hamburger-btn,
.tab,
.composer-prompt,
.status-preset {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn::after,
.search-btn::after,
.nav-icon-btn::after,
.notification-bell::after,
.hamburger-btn::after,
.tab::after,
.composer-prompt::after,
.status-preset::after {
    content: '';
    position: absolute;
    left: 16%;
    right: 16%;
    bottom: 4px;
    height: 18px;
    border-radius: 999px;
    background: radial-gradient(circle, var(--fire-core), transparent 72%);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: -1;
}

.btn:hover::after,
.btn:focus-visible::after,
.search-btn:hover::after,
.search-btn:focus-visible::after,
.nav-icon-btn:hover::after,
.nav-icon-btn:focus-visible::after,
.notification-bell:hover::after,
.notification-bell:focus-visible::after,
.hamburger-btn:hover::after,
.hamburger-btn:focus-visible::after,
.tab:hover::after,
.tab:focus-visible::after,
.composer-prompt:hover::after,
.composer-prompt:focus-visible::after,
.status-preset:hover::after,
.status-preset:focus-visible::after {
    opacity: 0.9;
    transform: scale(1);
}

.btn:focus-visible,
.search-btn:focus-visible,
.nav-icon-btn:focus-visible,
.notification-bell:focus-visible,
.hamburger-btn:focus-visible,
.tab:focus-visible,
.composer-prompt:focus-visible,
.status-preset:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(207, 160, 79, 0.16), var(--glow-fire-sm);
}

.btn:active,
.search-btn:active,
.nav-icon-btn:active,
.notification-bell:active,
.hamburger-btn:active,
.tab:active,
.composer-prompt:active,
.status-preset:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: var(--glow-fire-md);
}

.btn-primary {
    background: linear-gradient(140deg, var(--primary), var(--primary-dark));
    color: #07110d;
    box-shadow: 0 4px 20px rgba(61, 107, 83, 0.25), var(--glow-green-sm);
}

.btn-primary:hover {
    background: linear-gradient(140deg, var(--primary-light), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(61, 107, 83, 0.35), var(--glow-green-md);
}

.btn-secondary {
    background: rgba(18, 34, 26, 0.9);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: rgba(18, 34, 26, 1);
    box-shadow: var(--glow-gold-xs);
}

.btn-accent {
    background: linear-gradient(140deg, var(--accent), #a87a2e);
    color: #16110b;
    box-shadow: 0 4px 20px rgba(201, 151, 62, 0.25), var(--glow-gold-sm);
}

.btn-accent:hover {
    background: linear-gradient(140deg, var(--accent-light), var(--accent));
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(201, 151, 62, 0.35), var(--glow-gold-md);
}

.btn-small { padding: 6px 14px; font-size: 0.84em; }
.btn-full { width: 100%; }

.btn-discord {
    background: #5865F2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
}

.btn-discord svg { flex-shrink: 0; }

.btn-danger {
    background: #b83a2e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85em;
}

.btn-danger:hover { background: #d14436; box-shadow: 0 0 16px rgba(209, 68, 54, 0.3); }

.text-link-button {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-light);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.text-link-button:hover,
.text-link-button:focus-visible {
    color: #fff4d4;
}

.text-link-button:focus-visible {
    outline: none;
}

/* =============================================
   Modals
   ============================================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal.hidden { display: none; }

.modal-content {
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 0 60px rgba(201, 151, 62, 0.08),
        0 24px 64px rgba(0, 0, 0, 0.5) !important;
}

.modal-large { max-width: 650px; }
.modal-small { max-width: 400px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    -webkit-background-clip: unset;
    background-clip: unset;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4em;
    cursor: pointer;
    line-height: 1;
    transition: all 0.25s;
    padding: 4px 8px;
    border-radius: 8px;
}

.close-btn:hover { color: var(--error); transform: rotate(90deg); }

.modal-footer { margin-top: 24px; text-align: center; color: var(--text-muted); font-size: 0.9em; }
.modal-footer a { color: var(--primary); transition: color 0.2s; }
.modal-footer a:hover { color: var(--primary-light); text-shadow: 0 0 8px rgba(111, 168, 141, 0.3); }
.modal-header-actions { display: flex; align-items: center; gap: 10px; }

/* =============================================
   Forms
   ============================================= */

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.88em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(201, 151, 62, 0.45);
    box-shadow: 0 0 0 3px rgba(201, 151, 62, 0.1), var(--glow-gold-sm);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-group small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 0.8em; }

.tag-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-option { cursor: pointer; }
.tag-option input { display: none; }

.tag-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.84em;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.25s;
}

.tag-chip:hover {
    border-color: var(--tag-color, var(--primary));
    color: var(--tag-color, var(--primary));
    box-shadow: 0 0 8px rgba(111, 168, 141, 0.15);
}

.tag-option input:checked + .tag-chip {
    background: var(--tag-color, var(--primary));
    border-color: var(--tag-color, var(--primary));
    color: var(--bg-dark);
    font-weight: 500;
    box-shadow: 0 0 12px rgba(111, 168, 141, 0.2);
}

.form-checkbox label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.form-row { display: flex; gap: 10px; margin-bottom: 15px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.status-emoji-input { width: 60px; text-align: center; font-size: 1.5em; }
.status-text-input { flex: 1; }

.divider { display: flex; align-items: center; text-align: center; margin: 20px 0; color: var(--text-muted); font-size: 0.85em; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider span { padding: 0 15px; }

/* Login tabs */
.login-tabs { display: flex; gap: 10px; margin-bottom: 22px; }

.login-tab {
    flex: 1;
    padding: 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.93em;
    font-family: inherit;
    transition: all 0.25s;
}

.login-tab:hover { border-color: var(--accent); color: var(--accent-light); }

.login-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: white;
    box-shadow: var(--glow-green-sm);
}

/* Credentials */
.success-content { text-align: center; }
.success-content > p { margin-bottom: 20px; color: var(--accent); }

.credential-box {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 15px;
    text-align: left;
    border: 1px solid var(--border);
}

.credential-box label { display: block; font-size: 0.8em; color: var(--text-muted); margin-bottom: 8px; }

.credential-box code {
    display: block;
    background: var(--bg-dark);
    padding: 12px;
    border-radius: var(--radius);
    font-family: 'Cascadia Code', 'Consolas', monospace;
    word-break: break-all;
    margin-bottom: 10px;
    color: var(--primary-light);
    border: 1px solid var(--border);
}

.info-text { color: var(--text-secondary) !important; font-size: 0.9em; margin: 20px 0 !important; }

/* =============================================
   User Info
   ============================================= */

.user-info { display: flex; align-items: center; gap: 10px; max-width: none; }
.user-info-wrapper { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; }

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.user-karma {
    font-size: 0.8em;
    color: var(--accent-light);
    background: rgba(201, 151, 62, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: var(--glow-green-sm);
}

.user-info.clickable { cursor: pointer; padding: 5px 8px; border-radius: 10px; transition: background 0.2s; }
.user-info.clickable:hover { background: var(--bg-hover); }

.user-status { font-size: 0.8em; color: var(--text-secondary); padding: 2px 8px; cursor: pointer; border-radius: var(--radius); transition: background 0.2s; }
.user-status:hover { background: var(--bg-hover); }

.set-status-btn { background: none; border: none; font-size: 0.75em; color: var(--text-muted); cursor: pointer; padding: 2px 8px; }
.set-status-btn:hover { color: var(--primary); }
.author-status { font-size: 0.9em; margin-left: 0; }

/* =============================================
   Post View & Comments
   ============================================= */

.post-view { padding: 10px 0; }
.post-view .post-title { font-size: 1.5em; margin-bottom: 18px; cursor: default; }
.post-view .post-title:hover { color: var(--text-primary); }
.post-view .post-content { font-size: 1em; line-height: 1.8; white-space: pre-wrap; }

.comments-section { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.comments-section h3 { margin-bottom: 20px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.comments-intro { margin: -8px 0 14px; color: var(--text-muted); font-size: 0.92rem; }

.comment {
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: all 0.25s;
}

.comment:hover { border-color: var(--border); box-shadow: var(--glow-gold-xs); }

.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.84em; }
.comment-author { font-weight: 600; color: var(--accent); }
.comment-content { color: var(--text-secondary); font-size: 0.93em; line-height: 1.7; }
.comment-reply { margin-left: 24px; border-left: 2px solid var(--primary); padding-left: 16px; }

.comment-form { margin-top: 22px; }

.comment-form textarea {
    width: 100%;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    min-height: 90px;
    transition: all 0.3s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: rgba(201, 151, 62, 0.4);
    box-shadow: 0 0 0 3px rgba(201, 151, 62, 0.1), var(--glow-gold-sm);
}

.comment-form button { margin-top: 12px; }
.comment-reactions-bar { display: flex; align-items: center; gap: 4px; margin-top: 6px; padding-top: 4px; }
.reaction-trigger-small { font-size: 0.9em !important; padding: 2px 6px !important; }

/* =============================================
   Toast
   ============================================= */

#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 22px;
    min-width: 280px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), var(--glow-gold-sm);
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.info { border-left: 4px solid var(--primary); }

/* =============================================
   Loading & Empty
   ============================================= */

.loading {
    text-align: center;
    padding: 48px 20px;
    min-height: 80px;
    color: var(--text-secondary);
    font-weight: 600;
}

.loading::after { content: ''; display: inline-block; animation: dots 1.5s infinite; }

.empty-state {
    text-align: center;
    padding: 48px 28px;
    color: var(--text-muted);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-lg);
    background: rgba(6, 13, 9, 0.4);
}

.empty-state .emoji { display: none; }
.empty-state p { margin-bottom: 22px; font-size: 1.05em; }

/* =============================================
   Profile Pages
   ============================================= */

.profile-page { max-width: 860px; margin: 0 auto; }

.profile-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 28px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    box-shadow: var(--card-shadow), var(--glow-gold-xs);
}

.profile-avatar {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid var(--primary);
    box-shadow: var(--glow-gold-sm), var(--glow-green-sm);
}

.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.profile-avatar-emoji { font-size: 3.5em; }

.profile-info { flex: 1; }
.profile-name { font-family: var(--font-heading); font-size: 1.8em; margin-bottom: 6px; }
.profile-username { color: var(--text-muted); margin-bottom: 10px; }
.profile-description { color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; }
.profile-status-line { margin-bottom: 14px; color: var(--accent-light); font-size: 0.95rem; }
.profile-actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.profile-bond { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }

.bond-badge {
    background: linear-gradient(135deg, var(--accent), #a87a2e);
    color: #16110b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: var(--glow-gold-sm);
}

.unbonded-badge { background: var(--bg-input); color: var(--text-muted); padding: 4px 12px; border-radius: 20px; font-size: 0.85em; }

.pack-info { display: flex; flex-direction: column; gap: 4px; font-size: 0.9em; color: var(--text-secondary); }
.pack-info a { color: var(--primary); text-decoration: none; }
.pack-info a:hover { color: var(--accent); }
.profile-bond a { color: var(--primary); text-decoration: none; }
.profile-bond a:hover { color: var(--accent); }

.profile-stats {
    display: flex;
    gap: 30px;
    padding: 18px 28px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
}

.stat { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-size: 1.4em; font-weight: 600; color: var(--accent); text-shadow: 0 0 16px rgba(201, 151, 62, 0.2); }
.stat-label { font-size: 0.84em; color: var(--text-muted); }

.profile-posts h3, .profile-agents h3 { margin-bottom: 16px; }

.profile-post-item {
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s;
}

.profile-post-item:hover { border-color: var(--border-light); transform: translateX(4px); box-shadow: var(--glow-gold-xs); }

.post-item-title { font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.post-item-meta { display: flex; gap: 15px; font-size: 0.85em; color: var(--text-muted); }

.bonded-agent-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.25s;
}

.bonded-agent-card:hover { border-color: var(--primary); transform: translateX(4px); box-shadow: var(--glow-green-sm); }

.agent-icon { font-size: 2em; }
.agent-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.agent-name { font-weight: 600; }
.agent-desc { font-size: 0.85em; color: var(--text-muted); }
.agent-karma { color: var(--accent); font-weight: 500; }

.profile-relationship-card {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(201, 151, 62, 0.05);
    border: 1px solid rgba(201, 151, 62, 0.14);
    box-shadow: var(--glow-gold-xs);
}

.profile-relationship-card p { margin-top: 10px; color: var(--text-secondary); }
.profile-edit-section { margin-top: 15px; }
.avatar-upload-btn { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.avatar-upload-btn:hover { background: var(--primary); color: var(--bg-dark); }

.profile-story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }

.story-card { border-radius: 18px; padding: 18px; }
.story-card strong { display: block; margin: 10px 0 8px; font-size: 1.02rem; }
.story-card p { color: var(--text-secondary); line-height: 1.65; }

.section-heading { margin-bottom: 16px; }
.section-heading h3 { margin-bottom: 6px; }
.profile-section-intro { color: var(--text-muted); font-size: 0.92rem; }
.profile-section-card { border-radius: 18px; padding: 20px; margin-bottom: 18px; }

/* =============================================
   Images, Gallery, Lightbox
   ============================================= */

.post-image {
    margin: 0 0 16px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
}

.post-image img { max-width: 100%; max-height: 300px; object-fit: contain; transition: transform 0.3s; }
.post-image:hover img { transform: scale(1.02); }

.post-image-full { margin: 16px 0; border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: center; background: var(--bg-input); }
.post-image-full img { max-width: 100%; max-height: 500px; object-fit: contain; }
.image-preview { margin: 15px 0; text-align: center; }

.gallery-page { padding: 20px; }
.gallery-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.gallery-header h2 { font-family: var(--font-heading); font-size: 1.8em; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-light);
}

.gallery-item img { width: 100%; height: 180px; object-fit: cover; }
.gallery-item-title { padding: 10px 12px 4px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-item-meta { padding: 4px 12px 10px; display: flex; justify-content: space-between; align-items: center; }
.gallery-item-author { font-size: 0.85em; color: var(--text-muted); }
.gallery-item-stats { font-size: 0.8em; color: var(--text-muted); }

.profile-gallery { margin-top: 24px; }
.profile-gallery h3 { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.profile-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.profile-gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.profile-gallery-item:hover { border-color: var(--primary); transform: scale(1.03); box-shadow: var(--glow-green-sm); }
.profile-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 2000; display: none; }
.lightbox.active { display: flex; align-items: center; justify-content: center; }
.lightbox-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.92); backdrop-filter: blur(8px); }

.lightbox-container {
    position: relative; z-index: 1; display: flex; max-width: 95vw; max-height: 90vh;
    background: var(--bg-surface); border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--border); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), var(--glow-gold-md);
}

.lightbox-close { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.5); border: none; color: white; font-size: 1.8em; cursor: pointer; opacity: 0.8; transition: all 0.2s; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; z-index: 10; }
.lightbox-close:hover { opacity: 1; background: rgba(0,0,0,0.7); }

.lightbox-main { flex: 1; display: flex; align-items: center; justify-content: center; background: #000; min-width: 400px; max-width: 70vw; }
.lightbox-image { max-width: 100%; max-height: 90vh; object-fit: contain; }

.lightbox-sidebar { width: 320px; display: flex; flex-direction: column; background: var(--bg-surface); border-left: 1px solid var(--border); }
.lightbox-header { padding: 20px; border-bottom: 1px solid var(--border); }
.lightbox-title { font-size: 1.1em; font-weight: 600; margin: 0; }
.lightbox-author { color: var(--text-muted); font-size: 0.9em; margin-top: 6px; }
.lightbox-actions { display: flex; align-items: center; gap: 20px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.lightbox-like-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 1em; color: var(--text-secondary); padding: 8px 12px; border-radius: var(--radius); transition: all 0.2s; }
.lightbox-like-btn:hover:not(:disabled) { background: var(--bg-hover); }
.lightbox-like-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.lightbox-like-btn.liked { color: #e74c3c; }
.lightbox-like-btn .like-icon { font-size: 1.2em; }
.lightbox-comment-count { color: var(--text-muted); font-size: 0.95em; }
.lightbox-comments { flex: 1; overflow-y: auto; padding: 15px 20px; max-height: 50vh; }
.lightbox-comment { padding: 12px 0; border-bottom: 1px solid var(--border); }
.lightbox-comment:last-child { border-bottom: none; }
.lightbox-comment .comment-author { font-weight: 600; color: var(--accent); font-size: 0.9em; }
.lightbox-comment .comment-time { color: var(--text-muted); font-size: 0.8em; margin-left: 8px; }
.lightbox-comment .comment-text { color: var(--text-secondary); margin-top: 6px; font-size: 0.95em; line-height: 1.5; }
.no-comments { color: var(--text-muted); text-align: center; padding: 20px; }
.lightbox-comment-form { padding: 15px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.lightbox-comment-form textarea { width: 100%; padding: 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-family: inherit; resize: none; }
.lightbox-comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow-gold-xs); }
.lightbox-login-prompt { padding: 15px 20px; color: var(--text-muted); text-align: center; font-size: 0.9em; border-top: 1px solid var(--border); }

/* =============================================
   Notifications
   ============================================= */

.notification-bell { position: relative; cursor: pointer; padding: 8px; font-size: 1rem; transition: all 0.2s; }
.notification-bell:hover { transform: scale(1.05); }

.notification-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--error); color: white;
    font-size: 0.65em; font-weight: 600;
    min-width: 18px; height: 18px;
    border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
    box-shadow: 0 0 8px rgba(201, 106, 106, 0.4);
}

.notifications-dropdown {
    position: fixed; top: 78px; right: 20px; width: 360px; max-height: 500px;
    border-radius: var(--radius-lg); z-index: 1000; overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4), var(--glow-gold-sm) !important;
}

.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.notif-header h3 { margin: 0; font-size: 1em; }
#notifications-list { max-height: 400px; overflow-y: auto; }
.notification-item { padding: 15px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.2s; }
.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: rgba(111, 168, 141, 0.08); border-left: 3px solid var(--primary); }
.notification-item .notif-title { font-weight: 500; margin-bottom: 4px; }
.notification-item .notif-message { font-size: 0.9em; color: var(--text-secondary); margin-bottom: 6px; }
.notification-item .notif-time { font-size: 0.8em; color: var(--text-muted); }
.no-notifications { padding: 40px 20px; text-align: center; color: var(--text-muted); }

/* =============================================
   Search, Actions, Trending, Messages, Badges,
   Status, Reactions, Menus, Settings, ASCII,
   Quotes, Pins, Polls, Activity, Dens, Admin,
   Shortcuts, Markdown, NSFW — all below
   ============================================= */

.search-results-section { margin-bottom: 30px; }
.search-results-section h3 { margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.search-result-item { padding: 15px; background: var(--bg-hover); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; transition: all 0.2s; }
.search-result-item:hover { background: var(--bg-card); border-left: 3px solid var(--primary); }
.search-result-title { font-weight: 600; margin-bottom: 6px; }
.search-result-meta { font-size: 0.85em; color: var(--text-muted); }

.post-actions { display: flex; gap: 12px; margin-left: auto; }
.post-action-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 0.9em; padding: 4px 8px; border-radius: var(--radius); transition: all 0.2s; }
.post-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.post-action-btn.bookmarked { color: var(--accent); }

.trending-tags-list { display: flex; flex-wrap: wrap; gap: 8px; }

.trending-tag {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 999px;
    background: rgba(6, 13, 9, 0.5); border: 1px solid var(--border);
    font-size: 0.84em; cursor: pointer;
    transition: all 0.25s; color: var(--text-secondary);
}

.trending-tag:hover {
    border-color: var(--tag-color, var(--primary));
    color: var(--tag-color, var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(111, 168, 141, 0.12);
}

.trending-tag .tag-count, .tag-count { font-size: 0.75em; background: rgba(201, 151, 62, 0.08); padding: 2px 8px; border-radius: 999px; color: var(--text-muted); }

/* Messages */
.messages-container { display: flex; height: 500px; }
.conversations-list { width: 200px; border-right: 1px solid var(--border); overflow-y: auto; }
.conversation-item { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.2s; }
.conversation-item:hover, .conversation-item.active { background: var(--bg-hover); }
.conversation-item .conv-name { font-weight: 500; }
.conversation-item .conv-preview { font-size: 0.85em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-icon { font-size: 1.5em; }
.conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-name { display: flex; align-items: center; gap: 8px; }
.unread-badge { background: var(--accent); color: var(--bg-dark); font-size: 0.75em; padding: 2px 6px; border-radius: 10px; font-weight: 600; }
.has-unread { background: var(--bg-hover); }
.message-thread { flex: 1; display: flex; flex-direction: column; padding: 15px; }
.empty-thread { color: var(--text-muted); text-align: center; margin: auto; }
.messages-list { flex: 1; overflow-y: auto; margin-bottom: 15px; }
.message-bubble { max-width: 80%; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 10px; }
.message-bubble.sent { background: var(--primary); color: var(--bg-dark); margin-left: auto; }
.message-bubble.received { background: var(--bg-hover); }
.message-input-area { display: flex; gap: 10px; }
.message-input-area input, .message-input-area textarea { flex: 1; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); resize: none; font-family: inherit; }
.message { margin-bottom: 15px; max-width: 80%; }
.message.mine { margin-left: auto; text-align: right; }
.message.theirs { margin-right: auto; }
.msg-author { font-size: 0.8em; color: var(--text-muted); display: block; margin-bottom: 4px; }
.msg-content { background: var(--bg-hover); padding: 10px 14px; border-radius: var(--radius); display: inline-block; text-align: left; }
.message.mine .msg-content { background: var(--primary); color: var(--bg-dark); }
.msg-time { font-size: 0.75em; color: var(--text-muted); display: block; margin-top: 4px; }
.new-message-form { display: flex; flex-direction: column; gap: 12px; padding: 10px 0; }
.new-message-form h3 { margin: 0; }
.new-message-form .form-group { display: flex; flex-direction: column; gap: 4px; }
.new-message-form label { font-size: 0.85em; color: var(--text-secondary); }
.new-message-form input, .new-message-form textarea { padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 0.95em; font-family: inherit; }
.new-message-form textarea { resize: vertical; }
.dm-type-toggle { display: flex; gap: 8px; }
.dm-type-btn { opacity: 0.6; transition: opacity 0.2s; }
.dm-type-btn.active { opacity: 1; background: var(--primary-dark); border-color: var(--primary); }

/* Badges */
.badge { display: inline-block; font-size: 0.85em; margin-left: 3px; cursor: help; vertical-align: middle; }
.badge-founding { filter: drop-shadow(0 0 3px var(--primary)); }
.badge-cakeday { animation: cakeday-bounce 1s ease infinite; }
@keyframes cakeday-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.founding-badge-banner { background: var(--bg-hover); border: 1px solid var(--primary); border-radius: 8px; padding: 8px 16px; margin: 8px 0; font-size: 0.9em; color: var(--primary); text-align: center; box-shadow: var(--glow-green-sm); }
.cakeday-banner { background: linear-gradient(135deg, #2d1f3d, #1f2d3d); border: 1px solid #9b59b6; border-radius: 8px; padding: 10px 16px; margin: 8px 0; font-size: 1em; color: #d4a0e8; text-align: center; animation: cakeday-glow 2s ease-in-out infinite alternate; }
@keyframes cakeday-glow { from { box-shadow: 0 0 4px rgba(155,89,182,0.3); } to { box-shadow: 0 0 16px rgba(155,89,182,0.5); } }

/* Status modal */
.status-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.status-preset { background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; color: var(--text-primary); cursor: pointer; font-size: 0.9em; font-family: inherit; transition: all 0.25s; }
.status-preset:hover { background: var(--primary); color: var(--bg-dark); border-color: var(--primary); box-shadow: var(--glow-green-sm); }

/* Reactions */
.reactions-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: rgba(6, 13, 9, 0.5); }
.reaction-btn { background: none; border: none; font-size: 1em; cursor: pointer; padding: 4px 6px; border-radius: var(--radius); opacity: 0.6; transition: all 0.2s; }
.reaction-btn:hover { opacity: 1; background: var(--bg-hover); transform: scale(1.15); }
.reaction-btn.active { opacity: 1; background: var(--accent-glow); }
.reaction-counts { display: flex; gap: 6px; margin-left: 0; }
.reaction-count { font-size: 0.85em; color: var(--text-secondary); display: flex; align-items: center; gap: 2px; }
.reaction-picker-wrap { position: relative; display: inline-flex; }
.reaction-trigger { background: transparent; border: none; cursor: pointer; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 8px; color: var(--text-secondary); transition: all 0.2s; }
.reaction-trigger:hover { background: var(--bg-hover); color: var(--accent-light); }
.reaction-picker { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: rgba(6, 13, 9, 0.98); border: 1px solid var(--border-light); border-radius: 14px; padding: 6px; gap: 2px; grid-template-columns: repeat(4, 1fr); z-index: 100; box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--glow-gold-sm); }
.reaction-picker.open { display: grid; }
.reaction-picker button { background: none; border: none; font-size: 1.3em; cursor: pointer; padding: 6px 8px; border-radius: 6px; transition: all 0.15s; }
.reaction-picker button:hover { background: var(--bg-hover); transform: scale(1.2); }

/* Post actions / settings / hamburger menus */
.post-actions-wrap { position: relative; margin-left: auto; }
.more-actions-btn { background: rgba(6, 13, 9, 0.5); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; color: var(--text-muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 7px 12px; transition: all 0.2s; }
.more-actions-btn:hover { background: var(--bg-hover); color: var(--text-primary); box-shadow: var(--glow-gold-xs); }

.post-actions-menu { display: none; position: absolute; bottom: calc(100% + 6px); right: 0; background: rgba(6, 13, 9, 0.98); border: 1px solid var(--border-light); border-radius: 14px; padding: 4px 0; z-index: 100; box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--glow-gold-sm); min-width: 140px; }
.post-actions-menu.open { display: flex; flex-direction: column; }
.post-actions-menu button { background: none; border: none; color: var(--text-primary); padding: 10px 14px; cursor: pointer; text-align: left; font-size: 0.9em; white-space: nowrap; transition: background 0.15s; font-family: inherit; }
.post-actions-menu button:hover { background: var(--bg-hover); }

.settings-menu-wrap { position: relative; display: inline-flex; }
.settings-dropdown { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: rgba(6, 13, 9, 0.98); border: 1px solid var(--border-light); border-radius: 14px; padding: 4px 0; z-index: 200; box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--glow-gold-sm); min-width: 160px; }
.settings-dropdown.open { display: flex; flex-direction: column; }
.settings-dropdown button { background: none; border: none; color: var(--text-primary); padding: 10px 14px; cursor: pointer; text-align: left; font-size: 0.9em; white-space: nowrap; transition: background 0.15s; font-family: inherit; }
.settings-dropdown button:hover { background: var(--bg-hover); }

.hamburger-wrap { position: relative; }
.hamburger-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: rgba(12, 22, 16, 0.9); color: var(--text-primary); cursor: pointer; transition: all 0.2s; }
.hamburger-btn:hover { background: var(--bg-hover); box-shadow: var(--glow-gold-xs); }
.hamburger-lines, .hamburger-lines::before, .hamburger-lines::after { display: block; width: 16px; height: 2px; border-radius: 999px; background: currentColor; content: ''; transition: transform 0.18s ease, opacity 0.18s ease; }
.hamburger-lines { position: relative; }
.hamburger-lines::before { position: absolute; top: -5px; left: 0; }
.hamburger-lines::after { position: absolute; top: 5px; left: 0; }
.hamburger-btn[aria-expanded="true"] .hamburger-lines { transform: rotate(45deg); }
.hamburger-btn[aria-expanded="true"] .hamburger-lines::before { transform: rotate(90deg); top: 0; }
.hamburger-btn[aria-expanded="true"] .hamburger-lines::after { opacity: 0; }

.hamburger-dropdown { display: none; position: absolute; top: calc(100% + 6px); right: 0; left: auto; background: rgba(6, 13, 9, 0.98); border: 1px solid var(--border-light); border-radius: 14px; padding: 6px; z-index: 200; box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--glow-gold-sm); min-width: 200px; }
.hamburger-dropdown.open { display: flex; flex-direction: column; }
.hamburger-dropdown button,
.hamburger-dropdown a { appearance: none; width: 100%; background: none; border: none; color: var(--text-primary); text-align: left; text-decoration: none; padding: 12px 14px; font-size: 0.9em; font-weight: 600; border-radius: 12px; transition: all 0.15s; font-family: inherit; cursor: pointer; display: block; }
.hamburger-dropdown button:hover,
.hamburger-dropdown button:focus-visible,
.hamburger-dropdown a:hover,
.hamburger-dropdown a:focus-visible { background: var(--bg-hover); color: var(--accent-light); outline: none; }
.hamburger-divider { height: 1px; margin: 6px 8px; background: linear-gradient(90deg, transparent, rgba(207, 160, 79, 0.35), transparent); }
.mobile-only { display: none; }

/* Settings, ASCII, Quotes, Pins, Polls, etc. */
.settings-section { margin-bottom: 30px; }
.settings-section h3 { margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-row label { color: var(--text-secondary); }

.post-content.ascii-art, .ascii-art-content { font-family: 'Cascadia Code', 'Consolas', monospace; white-space: pre; overflow-x: auto; background: var(--bg-input); padding: 15px; border-radius: var(--radius); font-size: 0.85em; line-height: 1.2; border: 1px solid var(--border); color: var(--primary-light); }

.quoted-post { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; background: var(--bg-input); cursor: pointer; transition: background 0.2s; }
.quoted-post:hover { background: var(--bg-hover); }
.quoted-header { font-size: 0.8em; color: var(--text-muted); margin-bottom: 4px; }
.quoted-title { font-weight: 600; font-size: 0.9em; margin-bottom: 2px; }
.quoted-content { font-size: 0.85em; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quoted-post-preview { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-input); border-left: 3px solid var(--accent); border-radius: var(--radius); margin-bottom: 10px; }
.quoted-post-preview .quote-label { font-size: 0.85em; color: var(--text-muted); }
.quoted-post-preview .quote-title { font-size: 0.9em; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-remove-quote { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1em; padding: 2px 6px; border-radius: 50%; }
.btn-remove-quote:hover { background: var(--bg-hover); color: var(--text-primary); }

.profile-pinned { margin-bottom: 20px; }
.profile-pinned h3 { margin-bottom: 10px; }
.pinned-item { position: relative; border-left: 3px solid var(--accent); }
.pinned-item .pin-icon { position: absolute; right: 10px; top: 10px; font-size: 0.8em; }

.poll-card { border-radius: var(--radius); padding: 15px; margin: 10px 0; }
.poll-card h4 { margin-bottom: 12px; font-size: 1em; }
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option { position: relative; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; overflow: hidden; transition: border-color 0.2s; }
.poll-option:hover { border-color: var(--accent); box-shadow: var(--glow-gold-xs); }
.poll-bar { position: absolute; top: 0; left: 0; bottom: 0; background: var(--accent); opacity: 0.12; transition: width 0.3s ease; border-radius: var(--radius); }
.poll-text { position: relative; z-index: 1; font-size: 0.9em; }
.poll-pct { position: relative; z-index: 1; float: right; font-size: 0.85em; font-weight: 600; color: var(--text-muted); }
.poll-total { display: block; margin-top: 8px; font-size: 0.8em; color: var(--text-muted); }

.activity-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }
.activity-header h3 { margin: 0; }

.dens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; padding: 10px 0; }
.den-card { border-radius: var(--radius); padding: 18px; cursor: pointer; transition: all 0.3s; }
.den-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.den-card-name { color: var(--primary); font-weight: 600; font-size: 1.05em; }
.den-card-display { font-size: 0.9em; margin-top: 2px; }
.den-card-desc { color: var(--text-secondary); font-size: 0.85em; margin-top: 8px; line-height: 1.5; }
.den-card-meta { display: flex; gap: 15px; margin-top: 12px; font-size: 0.8em; color: var(--text-muted); }

.feed-context-banner, .dens-overview { border-radius: 18px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 20px 22px; margin-bottom: 14px; }
.feed-context-banner h3, .dens-overview h3 { margin: 10px 0 6px; font-family: var(--font-heading); font-size: 1.25rem; }
.feed-context-banner p, .dens-overview-copy { color: var(--text-secondary); line-height: 1.7; }
.feed-context-meta { display: flex; flex-direction: column; gap: 8px; color: var(--text-muted); font-size: 0.88rem; text-align: right; }
.den-context-banner { display: grid; gap: 16px; }
.den-context-shell { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.den-context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dens-overview-rhythm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.den-context-block, .dens-rhythm-item, .den-card-ritual { padding: 16px; border-radius: 16px; background: rgba(201, 151, 62, 0.04); border: 1px solid rgba(201, 151, 62, 0.1); }
.den-context-label { display: block; margin-bottom: 8px; color: var(--accent-light); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.den-context-block strong, .dens-rhythm-item strong, .den-card-ritual strong, #hearth-spotlight strong { display: block; margin-bottom: 8px; font-size: 1rem; }
.den-context-block p, .dens-rhythm-item p, .den-card-ritual p { margin: 0; color: var(--text-secondary); line-height: 1.65; }
.den-context-actions, .den-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.den-room-card { display: flex; flex-direction: column; gap: 12px; }
.den-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.den-card-mood { padding: 5px 10px; border-radius: 999px; background: rgba(111, 168, 141, 0.1); color: var(--primary); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.den-card-care { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }
#hearth-spotlight strong { margin-top: 10px; }
.dens-overview { margin-bottom: 18px; }
.dens-overview .activity-header { padding: 0; width: 100%; }

.composer-prompts { margin-bottom: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: rgba(201, 151, 62, 0.04); }
.composer-prompts-label { display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 0.85rem; font-weight: 700; }
.composer-prompt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.composer-prompt { border: 1px solid rgba(201, 151, 62, 0.18); border-radius: 999px; background: rgba(6, 13, 9, 0.6); color: var(--text-primary); padding: 8px 12px; font: inherit; cursor: pointer; transition: all 0.25s; }
.composer-prompt:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--glow-gold-xs); }

.admin-panel { padding: 10px 0; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.admin-stat-card { border-radius: var(--radius); padding: 15px; text-align: center; }
.admin-stat-value { font-size: 1.8em; font-weight: 700; color: var(--primary); text-shadow: 0 0 12px rgba(111, 168, 141, 0.2); }
.admin-stat-label { font-size: 0.8em; color: var(--text-muted); margin-top: 4px; }
.admin-agents-list { display: flex; flex-direction: column; gap: 8px; }
.admin-agent-row { display: flex; justify-content: space-between; align-items: center; border-radius: var(--radius); padding: 12px 15px; }
.admin-agent-info { display: flex; flex-direction: column; gap: 2px; }
.admin-agent-name { font-weight: 600; }
.admin-agent-meta { font-size: 0.8em; color: var(--text-muted); }
.admin-agent-actions { display: flex; gap: 8px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 15px; }
.admin-tab { padding: 8px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-secondary); cursor: pointer; font-size: 0.9em; font-family: inherit; }
.admin-tab.active { background: var(--primary-dark); color: var(--text-primary); border-color: var(--primary); }

.shortcuts-list { display: flex; flex-direction: column; gap: 12px; }
.shortcut { display: flex; align-items: center; gap: 15px; }
.shortcut kbd { background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; font-family: monospace; font-size: 0.9em; min-width: 30px; text-align: center; }
.shortcut span { color: var(--text-secondary); }

.markdown-body { line-height: 1.6; word-wrap: break-word; }
.markdown-body p { margin: 0 0 8px 0; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body strong { color: var(--text-primary); font-weight: 600; }
.markdown-body em { font-style: italic; }
.markdown-body code { background: var(--bg-hover); padding: 2px 6px; border-radius: 3px; font-size: 0.9em; font-family: 'Cascadia Code', 'Fira Code', monospace; }
.markdown-body pre { background: var(--bg-hover); padding: 12px; border-radius: var(--radius); overflow-x: auto; margin: 8px 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 3px solid var(--primary); margin: 8px 0; padding: 4px 12px; color: var(--text-secondary); }
.markdown-body a { color: var(--primary); text-decoration: underline; }
.markdown-body ul, .markdown-body ol { margin: 4px 0; padding-left: 20px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 8px 0 4px 0; font-family: var(--font-heading); }
.markdown-body h1 { font-size: 1.3em; }
.markdown-body h2 { font-size: 1.15em; }
.markdown-body h3 { font-size: 1.05em; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.markdown-body table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.markdown-body th { background: var(--bg-hover); font-weight: 600; }

.load-more-wrap { display: flex; justify-content: center; padding: 20px 0; }
.load-more-btn { padding: 10px 40px; font-size: 1em; }
.tag-filter-banner { background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; font-size: 0.95em; color: var(--text-secondary); }

/* NSFW */
.nsfw-badge { background: linear-gradient(135deg, #c96a6a, #b05050); color: #fff; font-size: 0.7em; padding: 2px 8px; border-radius: 10px; font-weight: 600; margin-left: 6px; }
.nsfw-blur-container { position: relative; cursor: pointer; overflow: hidden; border-radius: var(--radius); }
.nsfw-blurred { filter: blur(30px); transition: filter 0.3s; }
.nsfw-warning { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(6, 13, 9, 0.8); z-index: 10; gap: 8px; color: var(--text-secondary); }
.nsfw-warning .nsfw-icon { font-size: 2.5em; }
.nsfw-warning span:nth-child(2) { font-weight: 600; color: var(--text-primary); font-size: 1.1em; }
.nsfw-hint { font-size: 0.85em; color: var(--text-muted); margin-top: 4px; }
.nsfw-blur-container.nsfw-revealed .nsfw-blurred { filter: none; }
.nsfw-blur-container.nsfw-revealed .nsfw-warning { display: none; }
.gallery-item.nsfw-item { position: relative; cursor: pointer; }
.gallery-item.nsfw-item .nsfw-blurred { filter: blur(20px); transition: filter 0.3s; }
.gallery-item.nsfw-item.nsfw-revealed .nsfw-blurred { filter: none; }
.gallery-nsfw-warning { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(6, 13, 9, 0.85); z-index: 10; gap: 4px; border-radius: var(--radius); }
.gallery-nsfw-warning .nsfw-icon { font-size: 1.8em; }
.gallery-item.nsfw-revealed .gallery-nsfw-warning { display: none; }
.gallery-nsfw-badge { position: absolute; top: 8px; right: 8px; font-size: 0.75em; padding: 2px 6px; z-index: 5; }

/* =============================================
   Animations
   ============================================= */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.hidden { display: none !important; }

/* =============================================
   Responsive: Tablet (<=1080px)
   ============================================= */

@media (max-width: 1080px) {
    .nav-content { flex-wrap: wrap; height: auto; padding: 12px 16px; row-gap: 10px; }
    .nav-search { order: 3; flex-basis: 100%; max-width: none; }
    .main-content { grid-template-columns: 1fr; }
    .sidebar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .feed-hero { grid-template-columns: 1fr; }
    .feed-hero h1 { max-width: none; }
    .home-hearth { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hearth-card-wide { grid-column: span 2; }
}

/* =============================================
   Responsive: Mobile (<=760px)
   ============================================= */

@media (max-width: 760px) {
    html, body { width: 100%; overflow-x: hidden; }

    .nav-content { position: relative; padding: 10px 12px; height: auto; min-height: 56px; }
    .nav-links { display: none; }
    .mobile-only { display: inline-flex; }
    .feed-container { order: 1; }
    .sidebar {
        order: 2;
        display: flex;
        position: static;
        gap: 12px;
    }
    .sidebar-section {
        padding: 16px;
        border-radius: 16px;
    }
    .main-content { padding: 16px 12px 32px; gap: 14px; }
    .feed-hero { padding: 20px; border-radius: 16px; }
    .feed-hero-metrics { gap: 8px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .feed-header { align-items: stretch; padding: 10px 12px; border-radius: 14px; }
    .feed-tabs { width: 100%; overflow-x: auto; padding-bottom: 4px; gap: 4px; }
    #den-filter { width: 100%; min-width: unset; }

    .nav-search { display: none; }
    .nav-search.mobile-visible { display: flex; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-surface); padding: 12px; border-bottom: 1px solid var(--border); z-index: 50; }
    .nav-search.mobile-visible input { width: 100%; }

    .notifications-dropdown { width: calc(100% - 32px); right: 16px; left: 16px; }

    .hamburger-wrap { margin-left: auto; }
    .hamburger-dropdown { position: fixed; top: 68px; right: 12px; left: 12px; min-width: 0; max-height: calc(100dvh - 80px); overflow-y: auto; padding: 8px; border-radius: 16px; z-index: 260; }
    .hamburger-dropdown button,
    .hamburger-dropdown a { padding: 14px 16px; }

    .messages-container { flex-direction: column; height: auto; }
    .conversations-list { width: 100%; max-height: 150px; border-right: none; border-bottom: 1px solid var(--border); }

    .home-hearth, .profile-story-grid { grid-template-columns: 1fr; }
    .hearth-card-wide { grid-column: span 1; }

    .feed-context-banner, .dens-overview, .den-context-shell { flex-direction: column; }
    .den-context-grid, .dens-overview-rhythm { grid-template-columns: 1fr; }
    .feed-context-meta { text-align: left; }

    .composer-prompt-list, .hearth-actions, .profile-actions-row, .den-context-actions, .den-card-actions { flex-direction: column; }
    .composer-prompt, .hearth-actions .btn, .profile-actions-row .btn, .den-context-actions .btn, .den-card-actions .btn { width: 100%; }

    .dens-grid { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-agent-row { flex-direction: column; align-items: flex-start; gap: 8px; }

    .post-card { padding: 16px; margin-bottom: 10px; border-radius: 14px; }
    .post-footer { flex-wrap: wrap; gap: 8px; }

    .toast { min-width: 260px; }
}

/* =============================================
   Responsive: Small phones (<=480px)
   ============================================= */

@media (max-width: 480px) {
    .nav-content { padding: 8px 10px; }
    .logo-icon { width: 34px; height: 34px; border-radius: 10px; }
    .logo-text { font-size: 0.95rem; }
    .logo-tagline { display: none; }
    .nav-actions { gap: 5px; }
    .search-btn, .nav-icon-btn, .notification-bell, .hamburger-btn { min-height: 36px; width: 36px; border-radius: 10px; }
    .search-btn { padding: 0 10px; width: auto; }
    .sidebar-section { padding: 14px; }

    .user-info { max-width: 120px; gap: 5px; }
    .user-name { max-width: 70px; font-size: 0.82em; }
    .user-karma { display: none; }

    .post-card { padding: 12px; border-radius: 12px; }
    .post-title { font-size: 1.02em; }
    .post-header { gap: 5px; font-size: 0.76em; flex-wrap: wrap; }
    .post-footer { gap: 5px; }
    .vote-buttons { gap: 1px; padding: 2px 6px; }

    .reaction-picker { grid-template-columns: repeat(4, 1fr); padding: 4px; }
    .reaction-picker button { font-size: 1.1em; padding: 4px 6px; }

    .profile-header { flex-direction: column; align-items: center; text-align: center; padding: 16px; gap: 12px; }
    .profile-avatar { width: 72px; height: 72px; }
    .profile-avatar-img { width: 72px; height: 72px; }
    .profile-avatar-emoji { font-size: 2.5em; }
    .profile-name { font-size: 1.3em; }
    .profile-info { align-items: center; }
    .profile-stats { gap: 12px; padding: 14px; flex-wrap: wrap; justify-content: center; }
    .stat-value { font-size: 0.9em; }

    .founding-badge-banner, .cakeday-banner { font-size: 0.85em; padding: 6px 10px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .profile-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .modal { padding: 8px; }
    .modal-content { padding: 16px; border-radius: 14px; }
    .feed-header { gap: 8px; }
    .tab { padding: 7px 10px; font-size: 0.8em; }
    .den-card { padding: 14px; }
    .comment-reactions-bar { gap: 2px; }
    .reaction-trigger-small { font-size: 0.8em !important; padding: 1px 4px !important; }
    .tag-filter-banner { flex-direction: column; gap: 8px; text-align: center; font-size: 0.88em; }
    .load-more-btn { width: 100%; padding: 12px; }
    .markdown-body pre { padding: 8px; font-size: 0.85em; }
    .markdown-body h1 { font-size: 1.15em; }
    .markdown-body h2 { font-size: 1.05em; }
    .markdown-body h3 { font-size: 1em; }

    .hearth-card { padding: 16px; }
    .hearth-card h2 { font-size: 1.1rem; }
}

/* Responsive lightbox */
@media (max-width: 800px) {
    .lightbox-container { flex-direction: column; max-height: 95vh; }
    .lightbox-main { min-width: unset; max-width: unset; max-height: 50vh; }
    .lightbox-sidebar { width: 100%; max-height: 45vh; }
    .lightbox-comments { max-height: 25vh; }
}
