:root {
    --bg: #000000;
    --surface: #111111;
    --surface2: #1a1a1a;
    --border: #2a2a2a;
    --text: #e4e6ed;
    --text-dim: #8b8fa3;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --hot: #ef4444;
    --warm: #f97316;
    --mild: #eab308;
    --cold: #6b7280;
    --green: #22c55e;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* NAV */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }
nav .logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-right: 2rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
nav .logo:hover { color: var(--text); text-decoration: none; }
nav .logo span { color: var(--accent); }
nav .logo .logo-img {
    height: 36px;
    width: 36px;
    object-fit: contain;
}
nav .nav-links { display: flex; gap: 1.5rem; flex-shrink: 0; }
nav .nav-links a {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
    white-space: nowrap;
}
nav .nav-links a:hover, nav .nav-links a.active { color: var(--text); text-decoration: none; }
nav .nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    padding-left: 2rem;
    padding-right: 0.5rem;
}
nav .stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}
nav .stats .stat-val { color: var(--green); font-weight: 600; }
nav .nav-auth-btn {
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}
nav .nav-auth-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
nav .admin-link { color: var(--accent); opacity: 0.7; }
nav .admin-link:hover { opacity: 1; }

/* MAP */
#map {
    width: 100%;
    height: calc(100vh - 56px);
}
.leaflet-popup-content-wrapper {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.popup-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.popup-city { color: var(--text-dim); font-size: 0.85rem; }
.popup-calls { color: var(--green); font-weight: 600; font-size: 0.95rem; margin: 4px 0; }
.popup-scale { font-size: 0.85rem; color: var(--text-dim); }
.popup-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

/* MAP CONTROLS */
.map-controls {
    position: absolute;
    top: 70px;
    right: 16px;
    z-index: 999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}
.map-controls label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}
.map-controls select, .map-controls input {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 100%;
}

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* CARDS */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}
.card:hover { border-color: var(--accent); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.card-title { font-weight: 700; font-size: 1.05rem; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-hot { background: rgba(239,68,68,0.15); color: var(--hot); }
.badge-warm { background: rgba(249,115,22,0.15); color: var(--warm); }
.badge-mild { background: rgba(234,179,8,0.15); color: var(--mild); }
.badge-cold { background: rgba(107,114,128,0.15); color: var(--cold); }

/* HOTSPOTS */
.district-group { margin-bottom: 2rem; }
.district-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}
.local-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 80px 80px;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.local-row:hover { background: var(--surface2); }
.local-num { font-weight: 700; color: var(--accent); }
.calls-count { font-weight: 600; }
.calls-hot { color: var(--hot); }
.calls-warm { color: var(--warm); }
.calls-mild { color: var(--mild); }

/* LOCAL DETAIL */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.detail-label { color: var(--text-dim); font-size: 0.8rem; font-weight: 500; }
.detail-value { font-size: 1rem; font-weight: 600; }
.call-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.call-contractor { font-weight: 700; font-size: 1rem; }
.call-meta { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }
.call-positions {
    display: inline-block;
    background: rgba(59,130,246,0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.call-reqs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.req-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* PAGE HEADER */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}
.page-header .subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* CHAT */
.chat-frame {
    width: 100%;
    height: calc(100vh - 56px);
    border: none;
}

/* LOADING */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-dim);
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
    nav .stats { display: none; }
    .detail-grid { grid-template-columns: 1fr; }
    .local-row { grid-template-columns: 60px 1fr 60px; }
    .local-row > :nth-child(4), .local-row > :nth-child(5) { display: none; }
    .map-controls { top: 64px; right: 8px; min-width: 150px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   FORUM
   ═══════════════════════════════════════════════════════════════════════ */

.forum-hero {
    text-align: center;
    padding: 2.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.forum-hero h1 { font-size: 2rem; margin-bottom: 0.3rem; }
.forum-hero p { color: var(--text-dim); font-size: 1rem; }
.forum-hero-actions { margin-top: 0.8rem; display: flex; gap: 0.6rem; justify-content: center; align-items: center; }

.forum-user-badge {
    background: var(--surface2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.forum-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Groups */
.forum-group { margin-bottom: 1.8rem; }
.forum-group-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 0.6rem;
    padding-left: 4px;
}

/* Category cards */
.forum-categories { display: grid; gap: 0.5rem; }
.forum-cat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s;
    color: var(--text);
    text-decoration: none;
}
.forum-cat:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.forum-cat-icon { font-size: 1.6rem; width: 40px; text-align: center; flex-shrink: 0; }
.forum-cat-info { flex: 1; }
.forum-cat-info h3 { font-size: 1rem; margin-bottom: 1px; }
.forum-cat-info p { color: var(--text-dim); font-size: 0.8rem; }
.forum-cat-meta { text-align: right; flex-shrink: 0; min-width: 60px; }
.forum-cat-meta .count { font-size: 1.3rem; font-weight: 700; color: var(--text-dim); }
.forum-cat-meta .label { font-size: 0.7rem; color: var(--text-dim); }
.forum-cat-meta .count-sm { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }

/* Breadcrumb */
.forum-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1.2rem;
}
.forum-breadcrumb a { color: var(--accent); }
.forum-bc-group { color: var(--text-dim); }

/* Category header */
.forum-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.forum-cat-header h1 { font-size: 1.6rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-danger { border-color: var(--hot); color: var(--hot); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; text-align: center; }

/* New thread form */
.forum-new-thread {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.hidden { display: none !important; }

.forum-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 0.6rem;
    resize: vertical;
}
.forum-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-actions { display: flex; gap: 0.5rem; }

/* Thread listing */
.forum-thread-list { display: grid; gap: 0; }
.forum-thread-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
}
.forum-thread-row:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.forum-thread-info h3 { font-size: 0.95rem; font-weight: 600; }
.thread-meta { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.forum-thread-stats {
    display: flex;
    gap: 1.2rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    flex-shrink: 0;
}
.stat-num { font-weight: 700; color: var(--text); }
.pin-badge { margin-right: 4px; }
.forum-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.forum-load-more { text-align: center; padding: 1.5rem 0; }

/* Thread header */
.forum-thread-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.forum-thread-header h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.thread-header-meta { font-size: 0.82rem; color: var(--text-dim); }
.lock-badge {
    display: inline-block;
    background: rgba(239,68,68,0.15);
    color: var(--hot);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 6px;
}

/* Post list */
.forum-post-list { display: grid; gap: 0; }
.forum-post {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.forum-post.post-op {
    border-left: 3px solid var(--accent);
}

/* Post sidebar — card layout */
.post-sidebar {
    width: 150px;
    flex-shrink: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 1.2rem 0.8rem;
    background: var(--surface);
    border-right: 1px solid var(--border);
}
.post-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    flex-shrink: 0;
}
img.post-avatar-img {
    width: 100px !important;
    height: 100px !important;
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    background: none;
    border: 2px solid var(--border);
}
.post-author-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    word-break: break-all;
    line-height: 1.2;
}
.post-author-name:hover { color: var(--accent); text-decoration: none; }

.badge-admin {
    display: inline-block;
    background: linear-gradient(135deg, rgba(234,179,8,0.2), rgba(168,85,247,0.2));
    color: #eab308;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid rgba(234,179,8,0.25);
}

.lu-flair {
    display: inline-block;
    background: rgba(59,130,246,0.12);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}
.lu-flair:hover { background: rgba(59,130,246,0.2); text-decoration: none; }

.post-sidebar-divider {
    width: 60%;
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.post-sidebar-stat {
    font-size: 0.68rem;
    color: var(--text-dim);
}

/* Rep link (clickable in sidebar & profile) */
.rep-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}
.rep-link:hover { color: var(--accent); text-decoration: underline; }
.rep-link-lg {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}
.rep-link-lg:hover { color: var(--accent); text-decoration: underline; }

/* Post upvote (on the post footer) */
.upvote-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 0.4rem;
}
.upvote-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}
.upvote-btn:hover { color: var(--green); border-color: var(--green); background: rgba(34,197,94,0.08); }
.upvote-btn.upvoted { color: var(--green); border-color: var(--green); background: rgba(34,197,94,0.12); font-weight: 700; }
.upvote-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green);
    min-width: 14px;
}
.post-footer-spacer { flex: 1; }

/* Give rep form */
.rep-give-form textarea { margin-bottom: 0.5rem; }
.rep-give-btns {
    display: flex;
    gap: 0.5rem;
}
.rep-btn-pos {
    border-color: var(--green);
    color: var(--green);
}
.rep-btn-pos:hover { background: rgba(34,197,94,0.1); }
.rep-btn-neg {
    border-color: var(--hot);
    color: var(--hot);
}
.rep-btn-neg:hover { background: rgba(239,68,68,0.1); }
.rep-history-link {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--accent);
}
.rep-history-link:hover { text-decoration: underline; }

/* Rep history page */
.rep-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 0.8rem;
}
.rep-history-header h1 { font-size: 1.3rem; margin: 0; }
.rep-history-score {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dim);
}
.rep-history-score.rep-pos { color: var(--green); }
.rep-history-score.rep-neg { color: var(--hot); }

.rep-history-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.rep-entry {
    display: flex;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
}
.rep-entry:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.rep-entry:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.rep-entry:only-child { border-radius: var(--radius); border-bottom: 1px solid var(--border); }
.rep-entry-indicator {
    flex-shrink: 0;
    width: 36px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}
.rep-entry-pos .rep-entry-indicator { background: rgba(34,197,94,0.12); color: var(--green); }
.rep-entry-neg .rep-entry-indicator { background: rgba(239,68,68,0.12); color: var(--hot); }
.rep-entry-body { flex: 1; min-width: 0; }
.rep-entry-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 3px;
}
.rep-entry-meta a { font-weight: 600; color: var(--accent); }
.rep-entry-meta a:hover { text-decoration: underline; }
.rep-entry-reason {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.4;
}
.rep-history-empty {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

/* Post content */
.post-content { flex: 1; min-width: 0; padding: 1.2rem 1.25rem; }
.post-body {
    font-size: 0.92rem;
    line-height: 1.7;
    word-wrap: break-word;
}
.post-body .lu-link {
    background: rgba(59,130,246,0.1);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}
.post-footer {
    margin-top: 0.8rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
.op-badge {
    display: inline-block;
    background: rgba(34,197,94,0.15);
    color: var(--green);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}
.edited-badge {
    font-style: italic;
    color: var(--text-dim);
}

/* Reply box */
.forum-reply-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.forum-reply-box h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

/* Auth pages */
.forum-auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 56px);
    padding: 2rem;
}
.forum-auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.forum-auth-card h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.forum-auth-card .dim { color: var(--text-dim); margin-bottom: 1.5rem; }
.forum-auth-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--hot);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.forum-auth-switch {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}
.dim { color: var(--text-dim); }

/* Profile hero */
.profile-hero {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.profile-hero-bg {
    height: 100px;
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 50%, #a855f7 100%);
}
.profile-hero-content {
    display: flex;
    align-items: flex-end;
    gap: 1.4rem;
    padding: 0 2rem 1.5rem;
    margin-top: -50px;
    position: relative;
    z-index: 1;
}
.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.profile-avatar-img, .profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--surface);
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.profile-avatar-placeholder {
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
}
.avatar-upload-form {
    position: absolute;
    bottom: 2px;
    right: 2px;
}
.avatar-upload-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.avatar-upload-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.profile-hero-info {
    padding-bottom: 0.3rem;
}
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.profile-name-row h1 {
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.2;
}
.badge-admin-lg {
    display: inline-block;
    background: linear-gradient(135deg, rgba(234,179,8,0.2), rgba(168,85,247,0.2));
    color: #eab308;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid rgba(234,179,8,0.25);
}
.badge-banned {
    display: inline-block;
    background: rgba(239,68,68,0.15);
    color: var(--hot);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.profile-handle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 2px;
}
.lu-flair-lg {
    margin-top: 6px;
    font-size: 0.8rem;
    padding: 3px 10px;
}
.profile-hero-rep {
    margin-top: 8px;
}
.rep-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
}

/* Profile stats bar */
.profile-stats-bar {
    display: flex;
    gap: 0;
    margin-top: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.profile-stat-pill {
    flex: 1;
    text-align: center;
    padding: 1rem 0.5rem;
    border-right: 1px solid var(--border);
}
.profile-stat-pill:last-child { border-right: none; }
.stat-num {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
.stat-lbl {
    display: block;
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Profile body layout */
.profile-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0.8rem;
    margin-top: 0.8rem;
}
.profile-main { display: flex; flex-direction: column; gap: 0.8rem; }
.profile-sidebar { display: flex; flex-direction: column; gap: 0.8rem; }

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
}
.profile-card-danger {
    border-color: rgba(239,68,68,0.25);
}
.profile-card-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 0.8rem;
}
.profile-bio-form textarea { margin-bottom: 0.5rem; }
.profile-bio-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text);
}
.profile-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.profile-detail-row:last-of-type { border-bottom: none; }
.detail-label { color: var(--text-dim); }
.detail-value { font-weight: 600; color: var(--text); }

/* Profile thread list */
.profile-thread-list { display: grid; gap: 0; }
.profile-thread-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.88rem;
    transition: color 0.1s;
}
.profile-thread-item:last-child { border-bottom: none; }
.profile-thread-item:hover { color: var(--accent); text-decoration: none; }
.profile-thread-item .thread-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-thread-item .thread-date { font-size: 0.75rem; color: var(--text-dim); flex-shrink: 0; margin-left: 1rem; }

.btn-full { width: 100%; }
.btn-danger { border-color: var(--hot); color: var(--hot); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }

/* Admin info card */
.admin-info-card {
    border-color: rgba(234,179,8,0.2);
}
.admin-control-group {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.admin-control-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.admin-control-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.admin-inline-form {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.forum-input-sm {
    padding: 4px 8px;
    font-size: 0.82rem;
}

/* Admin post log */
.admin-post-log { display: grid; gap: 0; }
.admin-post-entry {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.admin-post-entry:last-child { border-bottom: none; }
.admin-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.82rem;
}
.admin-post-meta a { color: var(--accent); font-weight: 600; }
.admin-post-meta a:hover { text-decoration: underline; }
.admin-post-preview {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-stats { display: none; }
.profile-bio { display: none; }

/* Nav user button */
.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.nav-user-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.nav-auth-sm { font-size: 0.75rem; padding: 3px 8px; }

/* Admin controls */
.admin-crown { font-size: 1.2rem; margin-left: 4px; }
.thread-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.admin-thread-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
.btn-inline-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    opacity: 0.4;
    transition: opacity 0.15s;
}
.btn-inline-del:hover { opacity: 1; }
.pin-badge-sm {
    display: inline-block;
    background: rgba(234,179,8,0.12);
    color: var(--mild);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 4px;
}
.admin-section {
    border-top: 1px solid rgba(239,68,68,0.2);
    padding-top: 1rem;
    margin-top: 1rem;
}
.admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Legacy profile grid (kept for compat) */
.profile-stats-grid { display: none; }
.profile-section { display: none; }

/* Forum responsive */
@media (max-width: 768px) {
    .forum-post { flex-direction: column; }
    .forum-post.post-op { border-left: none; border-top: 3px solid var(--accent); }
    .post-sidebar {
        width: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        padding: 0.8rem 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .post-avatar { width: 36px; height: 36px; font-size: 1rem; }
    .post-sidebar-divider { display: none; }
    .post-content { padding: 0.8rem 1rem; }
    .forum-thread-row { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
    .forum-thread-stats { gap: 0.8rem; }
    .forum-cat { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .forum-cat-meta { text-align: left; display: flex; gap: 0.8rem; }
    .profile-body { grid-template-columns: 1fr; }
    .profile-hero-content { flex-direction: column; align-items: center; text-align: center; gap: 0.8rem; padding: 0 1.2rem 1.2rem; }
    .profile-hero-info { padding-bottom: 0; }
    .profile-name-row { justify-content: center; }
    .profile-stats-bar { flex-wrap: wrap; }
    .profile-stat-pill { flex: 1 1 45%; }
    .thread-header-top { flex-direction: column; }
}

/* ===== AD SLOTS ===== */
.ad-slot {
    position: relative;
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0;
    text-align: center;
    border-radius: var(--radius);
    overflow: hidden;
}
.ad-slot .ad-label {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}
.ad-banner {
    min-height: 90px;
}
.ad-infeed {
    margin: 0.5rem 0;
    min-height: 60px;
}
.house-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 1.4rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.house-ad:hover {
    border-color: var(--accent);
    color: var(--text);
    text-decoration: none;
}
.house-ad-icon {
    font-size: 1.2rem;
}
.house-ad-text {
    font-size: 0.82rem;
    font-weight: 500;
}
.affiliate-row {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
}
.affiliate-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.affiliate-card:hover {
    border-color: var(--accent);
    color: var(--text);
    text-decoration: none;
}
.affiliate-card .af-icon {
    font-size: 1rem;
}
.affiliate-section-label {
    text-align: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    opacity: 0.5;
    margin-bottom: 0.6rem;
}
@media (max-width: 640px) {
    .ad-slot { margin: 1rem 0.5rem; }
    .affiliate-row { gap: 0.6rem; }
    .affiliate-card { flex: 1 1 45%; justify-content: center; }
}

/* BLOG */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
    color: var(--text);
}
.blog-card:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.blog-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
}
.blog-card-body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-body h2 { font-size: 1.1rem; margin-bottom: 0.5rem; line-height: 1.3; }
.blog-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.75rem;
}
.blog-card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.blog-tag {
    display: inline-block;
    background: rgba(59,130,246,0.12);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}
.blog-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 4rem 1rem;
    font-size: 1.1rem;
}
@media (max-width: 640px) {
    .blog-grid { grid-template-columns: 1fr; }
}
