/* ═══════════════════════════════════════════
   MESHPRO Shotmetrix — Dark Theme Stylesheet
   Bootstrap-compatible custom overrides
   ═══════════════════════════════════════════ */

:root {
    /* --- Core Backgrounds --- */
    --bg-main: #09090b;
    --bg-panel: #141418;
    --bg-panel-alt: #1c1c22;
    --bg-header: #141418;
    --bg-dark: #0a0a0c;

    /* --- Interactive Elements --- */
    --element-bg: rgba(255,255,255,0.06);
    --element-bg-hover: rgba(255,255,255,0.10);
    --element-bg-active: rgba(255,255,255,0.14);

    /* --- Borders & Dividers --- */
    --border: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.12);

    /* --- Accents & Status Colors --- */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-purple: #8b5cf6;
    --status-off: #6b7280;

    /* --- Typography --- */
    --text-main: #fafafa;
    --text-dim: #a1a1aa;
    --text-muted: #71717a;
    --text-monospace: #a1a1aa;

    /* --- Overlays --- */
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --overlay-bg-light: rgba(0, 0, 0, 0.5);

    /* --- Table --- */
    --table-header-bg: rgba(255,255,255,0.04);
    --table-summary-bg: rgba(255,255,255,0.02);
    --table-hover-bg: rgba(59,130,246,0.08);
    --table-active-bg: rgba(59,130,246,0.12);
    --table-active-border: rgba(59,130,246,0.3);

    /* --- Derived / Aliases --- */
    --card-bg: #141418;
    --text-primary: #fafafa;
    --surface: #1c1c22;
    --warning-bg: rgba(234,179,8,0.08);
    --warning-border: rgba(234,179,8,0.2);
    --warning-text: #eab308;
    --primary-bg: rgba(59,130,246,0.08);
    --primary: #3b82f6;
    --text: #fafafa;

    /* --- Layout --- */
    --sidebar-width: 260px;
    --r: 12px;
    --rs: 8px;
    --rl: 16px;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.2);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
    --shadow-raised: 0 2px 8px rgba(0,0,0,.2), 0 0 0 1px rgba(255,255,255,.04);
    --tr: .2s cubic-bezier(.4,0,.2,1);

    /* --- Glass --- */
    --glass-bg: rgba(20,20,24,0.8);
    --glass-border: rgba(255,255,255,0.06);
    --glass-blur: blur(20px);

    /* --- Gradients --- */
    --gradient-accent: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-accent-hover: linear-gradient(135deg, #2563eb, #7c3aed);
    --gradient-success: linear-gradient(135deg, #22c55e, #14b8a6);
    --gradient-warn: linear-gradient(135deg, #eab308, #f97316);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f97316);

    /* --- Depth --- */
    --depth-sunken: rgba(0,0,0,.2);
    --depth-flat: transparent;
    --depth-raised: rgba(255,255,255,.03);
}

/* ═══ SMOOTH THEME TRANSITION ═══ */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
    transition-delay: 0s !important;
}

/* ═══ BASE OVERRIDES ═══ */
* { box-sizing: border-box; }
/* Global fluid transition — every element animates smoothly */
*:not(input):not(textarea):not(.carousel-track):not(.carousel-slide):not(#obOverlay):not(#obTooltip) {
    transition-property: color, background-color, border-color, box-shadow, opacity, transform;
    transition-duration: .2s;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
}
/* Exclude elements that should not have the global transition */
img, video, canvas, svg, .like-burst, .ptr-indicator, .skeleton-card,
[style*="animation"], .carousel-track,
#mcIntro, #mcIntro *, .vs-all, .vs-all *, .vs-scene, .vs-scene *,
.vs-left, .vs-right, .vs-char, .vs-text, .vs-flash, .vs-line-svg,
.mc-result-overlay, .mc-result-text, #mcConfetti,
.spinner, .feed-skeleton, [id$="Loader"], [id$="Spinner"],
.lightbox-overlay, .streak-reward-popup, .ach-unlock-overlay,
.publish-success-overlay, .quick-actions-overlay { transition: none !important; }
body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main) !important;
    color: var(--text-main) !important;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
    scroll-behavior: smooth;
}
a { color: inherit; text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--accent); }
/* Global SVG icon defaults */
svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; vertical-align: -3px; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══ BOOTSTRAP DARK OVERRIDES ═══ */
.card { background: var(--bg-panel); border-color: var(--border); color: var(--text-main); }
.card-header { background: var(--bg-header); border-color: var(--border); }
.card-body { background: var(--bg-panel); }
.form-control, .form-select {
    background-color: var(--element-bg) !important;
    border: 1px solid var(--border-light) !important;
    color: var(--text-main) !important;
    border-radius: var(--r) !important;
    transition: border-color var(--tr), box-shadow var(--tr);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12), 0 0 16px rgba(59,130,246,.08) !important;
}
.form-control::placeholder { color: var(--text-muted) !important; }
.btn {
    border-radius: var(--r) !important;
    font-weight: 600;
    transition: all var(--tr);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--gradient-accent) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(59,130,246,0.2);
    transition: all .25s ease !important;
}
.btn-primary:hover {
    background: var(--gradient-accent-hover) !important;
    box-shadow: 0 0 20px rgba(59,130,246,.2), 0 4px 12px rgba(59,130,246,0.15);
    transform: translateY(-1px);
}
.btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; vertical-align: -2px; }
.btn-outline-secondary {
    color: var(--text-dim) !important;
    border-color: var(--border-light) !important;
}
.btn-outline-secondary:hover {
    background-color: var(--element-bg-hover) !important;
    color: var(--text-main) !important;
}
.btn-danger { background-color: var(--accent-red) !important; border-color: var(--accent-red) !important; }
.btn-success { background-color: var(--accent-green) !important; border-color: var(--accent-green) !important; }
.btn-warning { background-color: var(--accent-yellow) !important; border-color: var(--accent-yellow) !important; color: #000 !important; }
.table { color: var(--text-dim) !important; border-color: var(--border) !important; }
.table > :not(caption) > * > * { background-color: transparent !important; border-color: var(--border) !important; }
.table thead th { background-color: var(--table-header-bg) !important; color: var(--text-muted) !important; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; }
.table tbody tr:hover > * { background-color: var(--table-hover-bg) !important; }
.modal-content { background-color: var(--bg-panel); border: 1px solid var(--border); color: var(--text-main); border-radius: var(--rl) !important; overflow: hidden; }
.modal-header { border-color: var(--border); }
.modal-footer { border-color: var(--border); }
.dropdown-menu { background-color: var(--bg-panel-alt); border-color: var(--border); }
.dropdown-item { color: var(--text-dim); }
.dropdown-item:hover { background-color: var(--element-bg-hover); color: var(--text-main); }
.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); border-color: transparent; }
.nav-tabs .nav-link:hover { color: var(--text-main); border-color: var(--border); }
.nav-tabs .nav-link.active { background-color: var(--bg-panel); color: var(--accent); border-color: var(--border) var(--border) var(--bg-panel); }
.alert-success { background-color: rgba(78,189,53,.12); border-color: rgba(78,189,53,.25); color: var(--accent-green); }
.alert-danger { background-color: rgba(209,52,56,.12); border-color: rgba(209,52,56,.25); color: var(--accent-red); }
.badge { font-weight: 600; }
.list-group-item { background-color: var(--bg-panel); border-color: var(--border); color: var(--text-main); }
.list-group-item:hover { background-color: var(--bg-panel-alt); }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeUp   { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn  { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:scale(1); } }
@keyframes pulse    { 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:.6; transform:scale(.8); } }
@keyframes heartBeat{ 0%{ transform:scale(1); } 15%{ transform:scale(1.3); } 30%{ transform:scale(1); } 45%{ transform:scale(1.15); } 60%{ transform:scale(1); } }
@keyframes slideIn  { from { opacity:0; transform:translateX(-10px); } to { opacity:1; transform:translateX(0); } }
@keyframes legendGlow{ 0%,100%{ box-shadow:0 0 4px rgba(59,130,246,.2); } 50%{ box-shadow:0 0 14px rgba(59,130,246,.4); } }
@keyframes heartFloat{ 0%{ opacity:1; transform:scale(0) translate(0,0); } 50%{ opacity:1; transform:scale(1.2) translate(0,-20px); } 100%{ opacity:0; transform:scale(.8) translate(0,-60px); } }

.anim-up { animation: fadeUp .5s ease both; }
.anim-in { animation: fadeIn .3s ease both; }
.anim-scale { animation: scaleIn .3s ease both; }

/* ═══ TOP NAVBAR ═══ */
.top-navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center;
    padding: 0 16px; gap: 10px;
    z-index: 110;
}
.top-navbar-hamburger {
    display: none;
    background: none; border: none;
    color: var(--text-main); cursor: pointer; padding: 4px;
    flex-shrink: 0;
}
.top-navbar-hamburger svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
.top-navbar-logo {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 20px; color: var(--text-main);
    display: flex; align-items: center; gap: 0;
    text-decoration: none; line-height: 1;
    flex-shrink: 0;
    height: 100%;
    padding: 0 10px;
    transition: background var(--tr), color var(--tr);
}
.top-navbar-logo:hover {
    background: #000;
    color: #fff;
}
.top-navbar-logo strong { font-weight: 800; letter-spacing: -.3px; }
.logo-mesh { color: var(--text-main); transition: color var(--tr); }
.logo-pro { color: var(--accent); }
.top-navbar-logo:hover .logo-mesh { color: #fff; }
.top-navbar-logo:hover .logo-pro { color: var(--accent); }
.logo-shotmetrix { color: #fff; font-weight: 500; font-size: 14px; margin-left: 5px; transition: color var(--tr); }
[data-theme="light"] .logo-mesh { color: #000; }
[data-theme="light"] .logo-shotmetrix { color: #000; }
[data-theme="light"] .top-navbar-logo:hover .logo-mesh { color: #fff; }
[data-theme="light"] .top-navbar-logo:hover .logo-shotmetrix { color: #fff; }
.beta-badge {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: var(--accent-yellow);
    color: #000;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.4;
}
.top-navbar-right {
    display: flex; align-items: center; gap: 2px;
    flex-shrink: 0;
}
.navbar-icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--r);
    color: var(--text-muted); text-decoration: none;
    transition: all .2s ease; position: relative;
}
.navbar-icon-btn:hover { background: var(--element-bg); color: var(--text-main); transform: scale(1.05); }
.navbar-icon-btn.active { color: var(--accent); background: rgba(59,130,246,.1); box-shadow: 0 0 10px rgba(59,130,246,.1); }
.navbar-icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.navbar-badge {
    position: absolute; top: 3px; right: 3px;
    min-width: 14px; height: 14px;
    background: var(--accent-red); color: #fff;
    font-size: 8px; font-weight: 700;
    border-radius: 7px; padding: 0 3px;
    display: flex; align-items: center; justify-content: center;
    margin-left: 0;
}
.navbar-points {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    background: rgba(240,180,41,.08);
    border: 1px solid rgba(240,180,41,.18);
    color: var(--accent-yellow); font-size: 12px; font-weight: 700;
    text-decoration: none; white-space: nowrap;
    transition: all var(--tr);
}
.navbar-points:hover { background: rgba(240,180,41,.15); color: var(--accent-yellow); }
.navbar-points svg { width: 13px; height: 13px; stroke: var(--accent-yellow); fill: none; }
.navbar-avatar { display: flex; align-items: center; border-radius: 50%; margin-left: 4px; text-decoration: none; }
.navbar-avatar:hover { opacity: .85; }

/* ═══ APP LAYOUT ═══ */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 16px 14px 24px;
    position: fixed;
    top: 52px; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform .3s ease;
    overflow-y: auto;
    scrollbar-width: thin;
}
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding-top: 52px;
    overflow-x: hidden;
}
.content-area {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 18px 20px;
}
/* Wider content for messages split view */
.content-area:has(.msg-split) { max-width: 1100px; }
/* Wider content for explore page */
.content-area:has(.explore-section) { max-width: 1100px; }
/* Guest feed view (explore-style) → full width on desktop */
.content-area:has(.guest-explore-wrap) { max-width: 100%; padding-left: 24px; padding-right: 24px; }
/* Wider content for performance tab */
.content-area:has(.perf-split-layout) { max-width: 1400px; }
.perf-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.perf-grid > * { min-width: 0; }
.perf-grid-full { grid-column: 1 / -1; }
@media (min-width: 1000px) {
    .perf-grid { grid-template-columns: 1fr 1fr; }
}
/* Profile pages — fill the full width between sidebar and right edge.
   No max-width cap; the main-content wrapper already offsets the sidebar
   via margin-left, so 100% of content-area = exactly the free space. */
.content-area:has(.profile-posts-grid) { max-width: 100%; padding-left: 20px; padding-right: 20px; }
.content-area:has(.profile-header)     { max-width: 100%; padding-left: 20px; padding-right: 20px; }
/* Create page full width with example sidebar */
.content-area:has(.create-split-wrap) { max-width: 1200px; }
/* Duel detail page full width with two columns */
.content-area:has(.mc-vs) { max-width: 100%; padding-left: 24px; padding-right: 24px; }
/* Achievements page full width */
.content-area:has(.ach-grid) { max-width: 1100px; }
/* About page full width */
.content-area:has(.about-card) { max-width: 1100px; }
/* Articles/Wissen page full width */
.content-area:has(.articles-page-wrap) { max-width: 1100px; }
/* Event competition page full width */
.content-area:has(.ev-page-wrap) { max-width: 100%; padding-left: 24px; padding-right: 24px; }
/* Groups page wider */
.content-area:has(.grp-grid) { max-width: 100%; padding-left: 24px; padding-right: 24px; }
.content-area:has(.grp-chat) { max-width: 100%; padding-left: 24px; padding-right: 24px; }
.content-area:has(.grp-detail-header) { max-width: 100%; padding-left: 24px; padding-right: 24px; }
/* Duel listing page full width */
.content-area:has(.mc-page-wrap) { max-width: 100%; padding-left: 24px; padding-right: 24px; }
.mc-page-columns { display: flex; flex-direction: column; gap: 16px; }
@media(min-width:900px) {
    .mc-page-columns { flex-direction: row; gap: 24px; }
    .mc-page-col-left { flex: 0 0 340px; position: sticky; top: 64px; align-self: flex-start; }
    .mc-page-col-right { flex: 1; min-width: 0; }
}
/* ═══ EXPLORE LAYOUT ═══ */
.explore-layout { display: flex; flex-direction: column; gap: 0; }
.explore-sidebar { }
.explore-main { }
.explore-posts-grid { columns: 2; column-gap: 14px; }
.explore-posts-grid > .post-card { break-inside: avoid; margin-bottom: 14px !important; display: inline-block; width: 100%; }
@media (min-width: 1000px) { .explore-posts-grid { columns: 3; } }
@media (max-width: 600px) { .explore-posts-grid { columns: 1; } }

/* ═══ SIDEBAR LOGO ═══ */
.sidebar-logo {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 20px; color: var(--text-main);
    margin-bottom: 20px;
    display: flex; align-items: flex-end; gap: 0;
    text-decoration: none; line-height: 1;
}
.sidebar-logo strong { font-weight: 800; letter-spacing: -.3px; }

/* ═══ SIDEBAR GROUPS ═══ */
.sidebar-group { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.sidebar-group:last-child { border-bottom: none; margin-bottom: 0; }
.sidebar-group-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-muted); padding: 8px 14px 4px; opacity: 0.6;
}

/* ═══ SIDEBAR NAV ═══ */
.sidebar .nav-link-mesh {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    color: var(--text-dim);
    border-radius: var(--r);
    font-size: 13px;
    font-weight: 500;
    transition: all .2s ease;
    position: relative;
}
.sidebar .nav-link-mesh:hover { background: var(--element-bg); color: var(--text-main); }
.sidebar .nav-link-mesh.active {
    background: rgba(59,130,246,.1);
    color: var(--accent);
    font-weight: 600;
}
.sidebar .nav-link-mesh.active svg { stroke: var(--accent); }
/* Duel/purple active */
.sidebar .nav-link-mesh.active[style*="accent-purple"],
.sidebar .nav-link-mesh[style*="accent-purple"] {
    --_c: 139,92,246;
}
.sidebar .nav-link-mesh.active[style*="accent-purple"] {
    background: rgba(var(--_c),.1);
    color: var(--accent-purple) !important;
}
.sidebar .nav-link-mesh.active[style*="accent-purple"] svg { stroke: var(--accent-purple); }
/* Event/yellow active */
.sidebar .nav-link-mesh.active[style*="accent-yellow"] {
    background: rgba(234,179,8,.08);
    color: var(--accent-yellow) !important;
}
.sidebar .nav-link-mesh.active[style*="accent-yellow"] svg { stroke: var(--accent-yellow); }
.sidebar .nav-link-mesh svg,
.sidebar svg {
    width: 18px; height: 18px;
    stroke: currentColor; stroke-width: 1.8; fill: none; flex-shrink: 0;
}
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px;
    background: var(--accent-red); color: #fff;
    font-size: 9px; font-weight: 700;
    border-radius: 8px; padding: 0 4px;
    margin-left: 6px;
}
/* .lang-switch kept for legacy, now handled by .navbar-icon-btn */

/* ═══ SIDEBAR USER CARD ═══ */
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    margin-top: auto; padding-top: 16px;
    border-top: 1px solid var(--border);
    border-radius: var(--r);
    transition: background var(--tr);
}
.sidebar-user.active { background: rgba(59,130,246,.05); border-top-color: rgba(59,130,246,.15); }
.sidebar-user-profile-link {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit; flex: 1; min-width: 0;
    border-radius: var(--r); padding: 6px;
    transition: background .2s, transform .15s;
}
.sidebar-user-profile-link:hover { background: var(--element-bg); transform: translateX(2px); }
.sidebar-user-info { flex: 1; overflow: hidden; min-width: 0; }
.sidebar-user-name { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.sidebar-user-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ═══ AVATARS ═══ */
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--element-bg);
    color: var(--text-muted);
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}
a:hover > .avatar, button:hover > .avatar {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--accent), 0 0 12px rgba(59,130,246,.15);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.online-dot {
    position: absolute;
    bottom: -1px; right: -1px;
    width: 10px; height: 10px;
    background: var(--accent-green);
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
    z-index: 2;
    box-shadow: 0 0 6px rgba(34,197,94,.4);
}
/* Document processing indicator on sidebar */
.doc-process-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}
.doc-process-indicator.processing {
    background: rgba(78, 168, 255, 0.12);
    gap: 5px;
    font-size: 9px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.doc-process-indicator.processing::before {
    content: '';
    width: 10px; height: 10px;
    border: 1.5px solid rgba(78, 168, 255, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: docSpin 0.7s linear infinite;
    flex-shrink: 0;
}
.doc-process-indicator.done {
    background: rgba(78, 189, 53, 0.12);
    color: var(--accent-green);
    font-size: 9px;
    font-weight: 600;
    gap: 4px;
    letter-spacing: 0.02em;
}
.doc-process-indicator.done::before {
    content: '✓';
    font-size: 11px;
    font-weight: 700;
}
@keyframes docSpin { to { transform: rotate(360deg); } }
.mobile-doc-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: docSpin 0.7s linear infinite;
}

.avatar-xs .online-dot { width: 7px; height: 7px; border-width: 1.5px; }
.avatar-sm .online-dot { width: 8px; height: 8px; border-width: 1.5px; }
.avatar-lg .online-dot { width: 12px; height: 12px; }
.avatar-xl .online-dot { width: 14px; height: 14px; border-width: 3px; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-xl { width: 80px; height: 80px; font-size: 30px; }

/* ═══ BADGES & POINTS ═══ */
.points-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 700;
    color: var(--accent-yellow);
}
.points-badge svg { width: 12px; height: 12px; stroke: var(--accent-yellow); fill: none; }
.streak-badge {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 10px; font-weight: 700;
    color: #f97316;
}
.streak-badge svg { width: 12px; height: 12px; stroke: #f97316; fill: none; }
.lvl-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9px; font-weight: 700;
    padding: 2px 7px; border-radius: 6px;
}
.lvl-lg { font-size: 11px; padding: 2px 8px; }
.lvl-starter { background: rgba(160,160,160,.1); color: #a0a0a0; }
.lvl-bronze  { background: rgba(205,127,50,.1); color: #cd7f32; }
.lvl-silver  { background: rgba(192,192,192,.1); color: #c0c0c0; }
.lvl-gold    { background: rgba(240,180,41,.1); color: #f0b429; }
.lvl-platinum{ background: rgba(59,130,246,.1); color: var(--accent); }
.lvl-diamond { background: rgba(34,197,94,.1); color: var(--accent-green); }
.lvl-master  { background: rgba(139,92,246,.1); color: var(--accent-purple); }
.lvl-legend  { background: rgba(59,130,246,.12); color: var(--accent); animation: legendGlow 2.5s ease-in-out infinite; }

.badge-verified {
    display: inline-flex; font-size: 9px;
    color: var(--accent-green);
    background: rgba(78,189,53,.1);
    padding: 2px 6px; border-radius: 6px;
    font-weight: 600;
}
.badge-admin { background: rgba(59,130,246,.12); color: var(--accent); border: 1px solid rgba(59,130,246,.25); }
.badge-banned { background: rgba(255,71,71,.12); color: #ff4747; border: 1px solid rgba(255,71,71,.25); }
.badge-shadow { background: rgba(240,180,41,.12); color: var(--accent-yellow); border: 1px solid rgba(240,180,41,.25); }

/* ═══ PAGE ELEMENTS ═══ */
.page-title {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 22px; font-weight: 700;
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 8px;
    letter-spacing: -0.02em;
}
.page-title svg { width: 22px; height: 22px; stroke: var(--accent); stroke-width: 2; fill: none; flex-shrink: 0; }
.page-header .page-title { margin-bottom: 0; }
.admin-card h4 svg { width: 16px; height: 16px; stroke: var(--accent); stroke-width: 2; fill: none; vertical-align: -2px; }
.page-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.page-header .page-title { margin-bottom: 0; }
.empty-state {
    text-align: center; padding: 56px 20px;
    color: var(--text-muted);
}
.empty-state svg { width: 40px; height: 40px; stroke: var(--text-muted); fill: none; margin-bottom: 14px; opacity: 0.4; }
.empty-state h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }

/* ═══ BTN ICON ═══ */
.btn-icon {
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; padding: 4px;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; transition: all var(--tr);
}
.btn-icon:hover { color: var(--text-main); transform: scale(1.1); }
.btn-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; transition: all .2s; }
.btn-icon.liked { color: var(--accent-red); filter: drop-shadow(0 0 6px rgba(239,68,68,.4)); }
.btn-icon.liked svg { stroke: var(--accent-red); fill: var(--accent-red); animation: heartBeat .5s ease; }

/* ═══ POST CARDS — card-less feed ═══ */
.post-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    margin-bottom: 0;
    padding-bottom: 4px;
    overflow: hidden;
    animation: fadeUp .35s ease both;
    transition: background .3s;
}
.post-card:hover { background: var(--depth-raised); }
.post-card:nth-child(2) { animation-delay: .04s; }
.post-card:nth-child(3) { animation-delay: .08s; }
.post-card:nth-child(4) { animation-delay: .12s; }
/* Raised card style for explore/profile grids */
.explore-posts-grid .post-card {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border) !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: var(--rl) !important;
    padding-bottom: 0;
    overflow: hidden !important;
    display: inline-block;
    width: 100%;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: border-color .3s, box-shadow .3s, transform .2s;
}
.explore-posts-grid .post-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-raised);
    transform: translateY(-2px);
    background: var(--bg-panel) !important;
}
.explore-posts-grid .post-header { padding: 14px 16px 10px; }
.explore-posts-grid .post-actions { padding: 10px 16px; }
.explore-posts-grid .post-caption { padding: 0 16px 12px; }
.explore-posts-grid .post-comments { padding: 0 16px 12px; }
.explore-posts-grid .comment-form { padding: 0 16px 12px; }
.profile-posts-grid .post-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    margin-bottom: 0;
    padding-bottom: 0;
    transition: border-color .3s, box-shadow .3s, transform .2s;
}
.profile-posts-grid .post-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-raised);
    transform: translateY(-2px);
}
.post-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px 10px;
}
.post-user-info { flex: 1; }
.post-username { font-weight: 600; font-size: 13px; }
.post-username:hover { color: var(--accent); }
.post-time { font-size: 10px; color: var(--text-muted); }
.post-image { width: 100%; display: block; cursor: pointer; height: auto; }
.post-image.target-image { height: auto; }
.post-actions {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
}
/* Restore padding for grid cards */
.profile-posts-grid .post-header { padding: 14px 16px 10px; }
.profile-posts-grid .post-actions { padding: 10px 16px; }
.profile-posts-grid .post-caption { padding: 0 16px 12px; }
.profile-posts-grid .post-comments { padding: 0 16px 12px; }
.profile-posts-grid .comment-form { padding: 0 16px 12px; }
.post-caption { padding: 0 16px 12px; font-size: 12px; line-height: 1.5; }
.post-caption strong { font-weight: 600; margin-right: 4px; }
.htag { color: var(--accent); font-weight: 600; }
.htag:hover { text-decoration: underline; }
.post-delete { margin-left: auto; }

/* ═══ COMMENTS ═══ */
.post-comments { padding: 0 16px 12px; }
.comment { display: flex; gap: 7px; margin-bottom: 8px; align-items: flex-start; }
.comment-body { font-size: 11px; line-height: 1.5; padding-top: 1px; flex: 1; }
.comment-username { font-weight: 600; margin-right: 3px; color: var(--text-primary); text-decoration: none; }
.comment-username:hover { color: var(--accent); }
.comment-meta { display: flex; align-items: center; gap: 10px; margin-top: 1px; }
.comment-time { font-size: 9px; color: var(--text-muted); }
.comment-like-btn {
    background: none; border: none; cursor: pointer; padding: 0; display: inline-flex;
    align-items: center; gap: 2px; font-size: 9px; color: var(--text-muted); transition: color .15s;
}
.comment-like-btn svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; }
.comment-like-btn:hover { color: var(--accent-red, #e74c3c); }
.comment-like-btn.liked { color: var(--accent-red, #e74c3c); }
.comment-like-btn.liked svg { fill: currentColor; }
.comment-flag-btn {
    background: none; border: none; cursor: pointer; padding: 0;
    color: var(--text-muted); opacity: 0; transition: opacity .15s, color .15s;
    display: inline-flex; align-items: center;
}
.comment-flag-btn svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2; fill: none; }
.comment:hover .comment-flag-btn { opacity: .4; }
.comment-flag-btn:hover { opacity: 1 !important; color: var(--accent-red, #e74c3c); }
.comment-shadowed { opacity: .5; }
.post-views { font-size: 9px; color: var(--text-muted); }
.post-views svg { width: 10px; height: 10px; stroke: var(--text-muted); stroke-width: 2; fill: none; vertical-align: -1px; }
.view-comments { font-size: 11px; color: var(--accent); cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.view-comments:hover { text-decoration: underline; }
.comment-hidden { display: none; }

/* @Mention autocomplete */
.mention-wrap { position: relative; flex: 1; }
.mention-dropdown {
    display: none; position: absolute; bottom: 100%; left: 0; right: 0;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--rs);
    box-shadow: 0 -4px 16px rgba(0,0,0,.2); max-height: 200px; overflow-y: auto;
    z-index: 100; margin-bottom: 4px;
}
.mention-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    cursor: pointer; transition: background .1s;
}
.mention-item:hover, .mention-item.active { background: var(--element-bg); }
.mention-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mention-av-letter {
    display: flex; align-items: center; justify-content: center;
    background: var(--element-bg); color: var(--text-muted); font-weight: 700; font-size: 11px;
}
.mention-info { display: flex; flex-direction: column; }
.mention-name { font-size: 12px; font-weight: 600; }
.mention-handle { font-size: 10px; color: var(--text-muted); }
.mention-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.mention-link:hover { text-decoration: underline; }
.mention-dropdown-up { bottom: auto; top: 100%; margin-top: 4px; margin-bottom: 0; }
.caption-textarea + .mention-dropdown { bottom: auto; top: 100%; margin-top: 4px; margin-bottom: 0; }
.comment-form {
    display: flex; padding: 0 16px 12px; gap: 8px;
}
.comment-form .mention-wrap { flex: 1; min-width: 0; }
.post-archive-btn { opacity: .3; transition: opacity .15s; }
.post-archive-btn:hover { opacity: 1; color: var(--accent-red, #e74c3c) !important; }
.post-archive-btn svg { width: 13px; height: 13px; }
.comment-input {
    flex: 1; width: 100%;
    background: var(--element-bg); border: none;
    color: var(--text-main); font-size: 12px;
    outline: none; padding: 8px 12px;
    border-radius: 20px;
    font-family: inherit;
    transition: background var(--tr);
}
.comment-input:focus { background: var(--element-bg-hover); box-shadow: 0 0 12px rgba(59,130,246,.06); }
.comment-submit {
    background: none; border: none;
    color: var(--accent); font-weight: 600;
    font-size: 12px; cursor: pointer;
    font-family: inherit;
    padding: 8px 4px;
    transition: opacity var(--tr);
}
.comment-submit:hover { opacity: 0.8; }

/* ═══ CAROUSEL ═══ */
.carousel-mesh { position: relative; overflow: hidden; transition: height .35s ease; width: 100%; min-height: 100px; }
.carousel-track { display: flex; align-items: flex-start; transition: transform .3s ease; transform: translateX(0); flex-wrap: nowrap; }
.carousel-slide { min-width: 100%; width: 100%; flex-shrink: 0; height: auto; display: block; object-fit: contain; }
.carousel-slide.target-image { height: auto; object-fit: contain; }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: #fff; border: 1px solid rgba(255,255,255,.1);
    width: 32px; height: 32px; min-width: 32px; min-height: 32px;
    max-width: 32px; max-height: 32px;
    border-radius: 50%; font-size: 18px;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background .2s;
    flex-shrink: 0; padding: 0; line-height: 1;
    aspect-ratio: 1;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots {
    display: flex; gap: 4px;
    justify-content: center;
    position: absolute; bottom: 8px;
    width: 100%;
}
.carousel-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    cursor: pointer; transition: all var(--tr);
}
.carousel-dot.active { background: #fff; transform: scale(1.3); }

/* ═══ POST TYPE SELECTOR (create form) ═══ */
.post-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.post-type-tab {
    flex: 1; min-width: 72px;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 10px 8px; border: 2px solid var(--border);
    border-radius: var(--r); cursor: pointer;
    background: var(--bg-panel-alt); color: var(--text-muted);
    transition: all var(--tr); font-family: inherit;
}
.post-type-tab:hover { border-color: var(--border-light); color: var(--text-main); }
.post-type-tab.active { border-color: var(--accent); background: rgba(59,130,246,.07); color: var(--accent); }
.post-type-tab.disabled { opacity: .35; cursor: not-allowed; }
.post-type-tab svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.post-type-label { font-size: 11px; font-weight: 600; }

/* ═══ POST TYPE PILL + DISCIPLINE (post header) ═══ */
.post-header-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.post-type-pill {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 6px; font-size: 9px;
    font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
    border: none; line-height: 1.4;
}
.post-type-pill svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.post-type-pill-scatt   { color: var(--accent); background: rgba(59,130,246,.1); }
.post-type-pill-meshpro { color: #a78bfa; background: rgba(167,139,250,.1); }
.post-type-pill-print   { color: var(--accent-green); background: rgba(34,197,94,.1); }
.post-type-pill-target  { color: #f59e0b; background: rgba(245,158,11,.08); }
.post-type-pill-qr      { color: #8b5cf6; background: rgba(139,92,246,.1); }
.post-discipline { color: var(--accent); font-weight: 600; text-decoration: none; }
.post-discipline:hover { text-decoration: underline; }
.btn-view-post {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: 20px;
    border: 1px solid rgba(59,130,246,.3); color: var(--accent);
    background: rgba(59,130,246,.06); font-size: 10px; font-weight: 600;
    cursor: pointer; transition: all var(--tr); font-family: inherit;
    flex-shrink: 0;
}
.btn-view-post:hover { background: rgba(59,130,246,.12); border-color: var(--accent); box-shadow: 0 0 12px rgba(59,130,246,.2); transform: translateY(-1px); }
.btn-view-post svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ═══ SCATT VIEWER MODAL ═══ */
.scatt-viewer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.88);
    z-index: 2000; display: flex; align-items: stretch; justify-content: center;
    animation: fadeIn .15s ease;
    padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0) 0;
}
.scatt-viewer-modal {
    position: relative; width: 90%; max-width: 1800px;
    display: flex; flex-direction: column; background: var(--bg-main, #0c0e13);
}
@media (max-width: 900px) { .scatt-viewer-modal { width: 100%; } }
.scatt-viewer-frames { display: flex; flex: 1; min-height: 0; }
.scatt-viewer-frames.scatt-viewer-split .scatt-viewer-iframe { width: 50%; border-right: 1px solid rgba(255,255,255,.1); }
.scatt-viewer-frames.scatt-viewer-split .scatt-viewer-iframe:last-child { border-right: none; }
.scatt-viewer-iframe { flex: 1; border: none; width: 100%; height: 100%; display: block; }

/* ═══ VIEWER STUB (fallback) ═══ */
.viewer-stub-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.7);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.viewer-stub-modal {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 36px 28px; text-align: center;
    max-width: 340px; width: 90%; animation: scaleIn .2s ease;
}
.viewer-stub-modal h3 { margin: 0 0 8px; font-size: 18px; }
.viewer-stub-modal p { color: var(--text-muted); font-size: 13px; margin: 0 0 22px; }
.viewer-stub-modal button {
    padding: 9px 24px; background: var(--accent); color: #fff;
    border: none; border-radius: var(--r); cursor: pointer; font-size: 13px;
}
.viewer-stub-modal button:hover { opacity: .85; }

/* ═══ SHARE DROPDOWN ═══ */
.share-wrap { position: relative; }
.share-dropdown {
    display: none;
    position: absolute; bottom: calc(100% + 6px);
    left: 50%; transform: translateX(-50%);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 6px; min-width: 200px;
    z-index: 50; box-shadow: var(--shadow);
    animation: scaleIn .15s ease;
}
.share-dropdown.open { display: block; }
.share-apps { display: flex; gap: 4px; justify-content: center; padding: 4px 2px; }
.share-app {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-panel-alt);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--tr); padding: 0;
}
.share-app:hover { transform: scale(1.12); }
.share-app svg { width: 18px; height: 18px; fill: var(--text-muted); stroke: none; }
.share-app:hover svg { fill: #fff; }
.share-app:nth-child(1):hover { background:#25d366; border-color:#25d366; }
.share-app:nth-child(2):hover { background:#0088cc; border-color:#0088cc; }
.share-app:nth-child(3):hover { background:#1d9bf0; border-color:#1d9bf0; }
.share-app:nth-child(4):hover { background:#1877f2; border-color:#1877f2; }
.share-app:nth-child(5):hover { background:var(--accent); border-color:var(--accent); }
.share-divider { height: 1px; background: var(--border); margin: 4px 0; }
.share-opt {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 10px;
    background: none; border: none;
    color: var(--text-muted); font-size: 11px;
    font-weight: 500; cursor: pointer;
    border-radius: var(--rs); transition: all var(--tr);
    text-align: left; font-family: inherit;
}
.share-opt:hover { background: var(--bg-panel-alt); color: var(--text-main); }
.share-opt svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.share-toast {
    position: fixed; bottom: 80px;
    left: 50%; transform: translateX(-50%);
    background: var(--accent-green); color: #fff;
    padding: 8px 18px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    z-index: 999; animation: fadeUp .3s ease;
    pointer-events: none;
}
.like-burst {
    position: fixed; pointer-events: none;
    font-size: 48px; animation: heartFloat .8s ease forwards;
    z-index: 9999;
}

/* ═══ AUTH PAGES ═══ */
.auth-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(135deg, rgba(0,102,204,.08) 0%, transparent 50%, rgba(124,110,240,.06) 100%);
}
.auth-card {
    width: 100%; max-width: 380px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 36px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
    animation: scaleIn .4s ease;
}
.auth-title {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 22px; text-align: center; margin-bottom: 4px;
}
.auth-subtitle { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.auth-links { display: flex; justify-content: center; gap: 16px; margin-top: 16px; font-size: 12px; }
.auth-links a:hover { color: var(--accent); }
.auth-link { text-align: center; margin-top: 16px; font-size: 12px; }
.auth-link a:hover { color: var(--accent); }
.dev-hint { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 12px; }
.dev-hint code { color: var(--accent); }

/* ═══ VERIFY CARD ═══ */
.verify-card {
    max-width: 400px; margin: 20vh auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 40px 28px; text-align: center;
    animation: scaleIn .4s ease;
}
.verify-card .icon-wrap { margin-bottom: 16px; }
.verify-card .icon-wrap svg { width: 48px; height: 48px; stroke: var(--accent); fill: none; }
.verify-card h2 { font-family: 'Space Grotesk', sans-serif; font-size: 20px; margin-bottom: 8px; }
.verify-card .email-highlight { color: var(--accent); font-weight: 600; font-size: 14px; }
.verify-card .actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

/* ═══ PROFILE ═══ */
/* ═══ PROFILE COVER BANNER ═══ */
/* Cover is a fixed-height banner; header flows below it */
.profile-cover-wrap {
    position: relative;
    /* Hug the content-area — no more 100vw escape trick, which was
       punching past the sidebar on desktop. Content-area is already
       capped by .content-area:has(.profile-posts-grid) max-width. */
    width: 100%;
    margin-top: -28px;
    margin-bottom: 0;
    border-radius: 14px;
    overflow: hidden;
    /* Fallback backdrop — just the page background so profiles without
       a cover image blend cleanly into the theme instead of introducing
       a warm brown tint that clashes with light theme. */
    background: var(--bg);
}
[data-theme="light"] .profile-cover-wrap {
    background: var(--bg);
}
.profile-cover-wrap::before {
    content: '';
    display: block;
    height: 280px;
}
/* Ambient backdrop — blurred, stretched copy of the cover image.
   Fills the banner no matter the source aspect ratio, so portrait
   and square photos still produce a full-width backdrop. */
.profile-cover-bg {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 280px;
    width: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: blur(24px) saturate(1.2) brightness(0.7);
    transform: scale(1.15); /* hide blur edges outside the container */
    z-index: 0;
    pointer-events: none;
}
/* Foreground — the actual photo, letter-boxed with object-fit:contain
   so the user's uploaded image is fully visible regardless of aspect
   ratio. The ambient .profile-cover-bg fills any empty space around it. */
.profile-cover-img {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 280px;
    width: 100%;
    object-fit: contain;
    object-position: center center;
    z-index: 1;
    border-radius: 0;
}
.profile-cover-fade {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 280px;
    background: linear-gradient(to bottom, transparent 40%, rgba(9,9,11,0.6) 100%);
    z-index: 2;
    border-radius: 0;
    pointer-events: none;
}
/* Header sits below the cover banner — glass hero card */
.profile-cover-wrap .profile-header {
    position: relative;
    z-index: 2;
    margin: -60px 16px 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--rl);
    padding: 0 20px 20px;
}

/* ═══ PROFILE HEADER CARD ═══ */
.profile-header {
    position: relative;
    z-index: 2;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 10px; margin-bottom: 20px; padding: 0 0 20px;
}
.profile-avatar-col {
    flex-shrink: 0;
    position: relative;
    padding: 3px;
    background: var(--gradient-accent);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 20px rgba(59,130,246,.15);
    transition: box-shadow .3s, transform .3s;
    margin-top: -44px; /* overlap card/cover edge */
}
.profile-cover-wrap .profile-avatar-col { margin-top: -44px; }
.profile-avatar-col:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 28px rgba(59,130,246,.3);
    transform: scale(1.03);
}
.profile-avatar-col .avatar-xl { border: 3px solid var(--bg-main); }
.profile-info-col { min-width: 0; width: 100%; padding-top: 8px; }
.profile-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.profile-name { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.profile-handle { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.profile-club {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 6px; padding: 4px 12px 4px 6px;
    background: var(--element-bg); border: 1px solid var(--border);
    border-radius: 20px; font-size: 11px; color: var(--text-dim);
}
.profile-club img { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; }
.profile-bio {
    font-size: 13px; line-height: 1.6; margin-top: 8px; color: var(--text-dim);
    max-width: 380px; margin-left: auto; margin-right: auto;
}
.profile-stats {
    display: flex; gap: 0; margin-top: 14px; justify-content: center;
    background: transparent; border: none;
    border-radius: 0; overflow: visible;
}
.profile-stats > div, .profile-stats > a {
    flex: 1; padding: 8px 12px; text-decoration: none; color: inherit;
    transition: opacity .2s; text-align: center;
}
.profile-stats > a:hover { opacity: 0.7; }
.profile-stats > div + div, .profile-stats > div + a, .profile-stats > a + div, .profile-stats > a + a {
    border-left: 1px solid var(--border);
}
.stat-number { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 800; }
.stat-label { font-size: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }
.profile-badges-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.profile-badge-card {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--element-bg); border: 1px solid var(--border);
    border-radius: var(--r); padding: 8px 14px;
    transition: border-color .2s, transform .2s;
}
.profile-badge-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.profile-badge-label {
    font-size: 9px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
.profile-actions {
    display: flex; gap: 8px; align-items: center; justify-content: center;
    margin-top: 12px; flex-wrap: wrap;
}
.profile-actions .btn-follow {
    border-radius: 10px; font-size: 12px; padding: 8px 18px; font-weight: 600;
}
.profile-actions .btn-icon {
    opacity: 0.4; transition: all .2s;
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: var(--element-bg);
}
.profile-actions .btn-icon:hover { opacity: 1; background: var(--element-bg-hover); }

/* Profile Tabs */
.profile-tabs {
    display: flex; margin-bottom: 16px; gap: 4px;
    padding: 4px; background: var(--element-bg); border-radius: var(--r);
}
.profile-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-muted); background: none; border: none;
    border-radius: calc(var(--r) - 2px); cursor: pointer; transition: all .2s;
}
.profile-tab svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.profile-tab:hover { color: var(--text-main); }
.profile-tab.active { color: var(--accent); background: var(--bg-panel); box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 0 8px rgba(59,130,246,.08); }
.profile-tab.active svg { stroke: var(--accent); }
.profile-tab-panel { display: none; }
.profile-tab-panel.active { display: block; }

.profile-posts-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px;
    min-width: 0;
}
.profile-posts-grid .post-card { margin-bottom: 0; min-width: 0; }
/* Responsive column count — content-area now fills full width so we
   can pack more columns on wider viewports without sidebar overlap. */
@media (min-width: 1100px) {
    .profile-posts-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1600px) {
    .profile-posts-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 600px) {
    .profile-posts-grid { grid-template-columns: 1fr; }
    .profile-tab { font-size: 10px; padding: 10px 4px; }
}
.btn-follow {
    padding: 7px 20px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    border: 1px solid var(--accent); cursor: pointer;
    font-family: inherit; transition: all var(--tr);
}
.btn-follow:active { transform: scale(0.93); }
.btn-follow.not-following { background: var(--gradient-accent); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,.15); }
.btn-follow.not-following:hover { box-shadow: 0 0 16px rgba(59,130,246,.25), 0 4px 12px rgba(59,130,246,.15); transform: translateY(-1px); }
.btn-follow.following { background: transparent; color: var(--text-dim); border-color: var(--border-light); }
.btn-follow.following:hover { border-color: var(--accent-red); color: var(--accent-red); background: rgba(239,68,68,.06); }

/* ═══ EXPLORE ═══ */
.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--element-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 8px 16px; margin-bottom: 20px;
    transition: border-color var(--tr);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 16px rgba(59,130,246,.12); }
.search-box svg { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; flex-shrink: 0; }
.search-box input {
    flex: 1; background: transparent !important; border: none !important;
    color: var(--text-main); font-size: 13px;
    outline: none; font-family: inherit;
    box-shadow: none !important;
}
.explore-section { margin-bottom: 24px; }
.explore-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px; font-weight: 700; margin-bottom: 12px;
}
.suggest-scroll {
    display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.suggest-scroll::-webkit-scrollbar { display: none; }
.suggest-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 16px; text-align: center;
    min-width: 120px; flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    position: relative; z-index: 1;
}
.suggest-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.15); z-index: 2; }
.suggest-avatar-link { display: flex; justify-content: center; }
.suggest-name { font-weight: 600; font-size: 12px; margin-top: 8px; color: var(--text-primary); text-decoration: none; }
.suggest-name:hover { color: var(--accent); }
.suggest-handle { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; text-decoration: none; }
.suggest-handle:hover { color: var(--accent); }
.trending-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.trending-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; background: var(--element-bg);
    border: 1px solid var(--border); border-radius: 20px;
    font-size: 12px; font-weight: 600;
    color: var(--accent); transition: all var(--tr);
}
.trending-tag:hover { border-color: var(--accent); background: rgba(59,130,246,.08); box-shadow: 0 0 10px rgba(59,130,246,.12); transform: translateY(-1px); }
.trending-count { font-size: 10px; color: var(--text-muted); font-weight: 400; }

/* ═══ CREATE POST ═══ */
.create-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 24px;
}
.create-card h3 { font-family: 'Space Grotesk', sans-serif; font-size: 18px; margin-bottom: 20px; }
.create-section-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}
.create-section-label svg {
    width: 14px; height: 14px; stroke: var(--text-muted); stroke-width: 2; fill: none; flex-shrink: 0;
}
.create-section-label .scatt-optional { text-transform: none; letter-spacing: 0; }
.create-divider { height: 1px; background: var(--border); margin: 16px 0; }
.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: var(--r);
    padding: 32px; text-align: center;
    color: var(--text-muted);
    cursor: pointer; position: relative;
    transition: all var(--tr); margin-bottom: 16px;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--accent); background: rgba(59,130,246,.05); }
.upload-area svg { width: 32px; height: 32px; stroke: var(--border-light); fill: none; margin-bottom: 6px; }
.upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px; margin-bottom: 12px;
}
.preview-item {
    position: relative; aspect-ratio: 1;
    border-radius: var(--r); overflow: hidden;
    background: var(--bg); border: 1px solid var(--border);
}
.preview-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.preview-item:hover .preview-thumb { opacity: .7; }
.preview-remove {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0,0,0,.65); border: none;
    color: #fff; font-size: 13px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: opacity .15s; padding: 0;
}
.preview-item:hover .preview-remove { opacity: 1; }
.upload-add-more {
    aspect-ratio: 1; border: 2px dashed var(--border);
    border-radius: var(--r);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; color: var(--text-muted); font-size: 11px;
    cursor: pointer; position: relative; transition: all var(--tr);
}
.preview-edit {
    position: absolute; bottom: 4px; right: 4px;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(0,0,0,.6); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: opacity .15s;
}
.preview-edit svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 2; fill: none; }
.preview-item:hover .preview-edit { opacity: 1; }

/* Image Editor Modal */
.img-editor-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.8); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 16px;
}
.img-editor-overlay.open { display: flex; }
.img-editor {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--rl);
    padding: 20px; max-width: 760px; width: 100%;
    animation: authPopIn .25s ease;
}
.img-editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.img-editor-title { font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 700; }
.img-editor-canvas {
    display: block; margin: 0 auto; border-radius: var(--rs);
    cursor: crosshair; max-width: 100%;
}
.img-editor-tools {
    display: flex; gap: 8px; align-items: center; justify-content: center;
    margin-top: 12px; flex-wrap: wrap;
}
.img-editor-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; background: var(--element-bg); border: 1px solid var(--border);
    border-radius: var(--rs); color: var(--text-primary); font-size: 11px;
    cursor: pointer; transition: all .15s;
}
.img-editor-btn:hover { border-color: var(--accent); color: var(--accent); }
.img-editor-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.img-editor-btn input[type=range] { width: 80px; height: 3px; margin-left: 4px; vertical-align: middle; }
.img-editor-crop-info {
    text-align: center; font-size: 10px; color: var(--text-muted); margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
}
.img-editor-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* Post Preview Modal */
.post-preview-overlay {
    display: none; position: fixed; inset: 0; z-index: 9998;
    background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 20px;
    overflow-y: auto;
}
.post-preview-overlay.open { display: flex; }
.post-preview-modal {
    width: 100%; max-width: 480px;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--rl);
    padding: 16px; animation: authPopIn .25s ease;
}
.post-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.prev-image-area { position: relative; }
.prev-carousel {
    display: flex; overflow: hidden; scroll-behavior: smooth;
}
.prev-carousel-img {
    min-width: 100%; max-width: 100%; max-height: 400px;
    object-fit: contain; flex-shrink: 0;
    background: var(--bg-main); display: block;
}
.prev-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,.5); color: #fff; border: none;
    font-size: 18px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background .15s; z-index: 2;
}
.prev-nav:hover { background: rgba(0,0,0,.8); }
.prev-nav-left { left: 8px; }
.prev-nav-right { right: 8px; }
.prev-dots {
    display: flex; justify-content: center; gap: 5px;
    padding: 8px 0 2px; position: absolute; bottom: 6px; left: 0; right: 0;
}
.prev-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,.4); transition: background .15s;
}
.prev-dot.active { background: #fff; }

.upload-add-more:hover { border-color: var(--accent); color: var(--accent); }
.upload-add-more svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.upload-add-more input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-count { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.scatt-upload-area {
    border: 2px dashed rgba(124,58,237,.4);
    border-radius: var(--r);
    padding: 16px 24px; text-align: center;
    color: var(--text-muted);
    background: rgba(124,58,237,.04);
    cursor: pointer; position: relative;
    transition: all .2s ease; margin-bottom: 10px;
}
.scatt-upload-area:hover { border-color: #7c3aed; background: rgba(124,58,237,.1); box-shadow: 0 0 0 4px rgba(124,58,237,.08); }
.scatt-upload-area.drag-over { border-color: #7c3aed; background: rgba(124,58,237,.15); box-shadow: 0 0 0 6px rgba(124,58,237,.12); border-style: solid; transform: scale(1.01); }
.scatt-upload-area.scatt-has-file { border-color: #7c3aed; background: rgba(124,58,237,.05); }
.scatt-upload-area svg { width: 24px; height: 24px; stroke: rgba(124,58,237,.5); fill: none; margin-bottom: 4px; }
.scatt-upload-area p { margin: 2px 0; font-size: 13px; }
.scatt-upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.scatt-optional { font-size: 11px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.scatt-formats { font-size: 11px; color: var(--text-muted); letter-spacing: .03em; }
.scatt-selected { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #7c3aed; background: rgba(124,58,237,.08); border: 1px solid rgba(124,58,237,.25); border-radius: var(--rs); padding: 6px 10px; margin-bottom: 10px; }
.scatt-selected span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scatt-clear { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1; }
.scatt-clear:hover { color: var(--text); }
.scatt-processing { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); padding: 8px 0; }
.scatt-processing svg { width: 16px; height: 16px; stroke: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading { opacity: 0.7; pointer-events: none; display: inline-flex !important; align-items: center; gap: 6px; justify-content: center; }
.btn-loading svg { width: 16px; height: 16px; stroke: currentColor; animation: spin 1s linear infinite; flex-shrink: 0; }
.scatt-preview-result { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.scatt-preview-result img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--rs); border: 1px solid var(--border); }
.scatt-preview-label { font-size: 11px; color: var(--accent-green); display: flex; align-items: center; gap: 4px; }
.scatt-preview-label svg { width: 14px; height: 14px; stroke: var(--accent-green); }
.target-file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.target-file-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--element-bg); border: 1px solid var(--border); border-radius: var(--rs);
    padding: 6px 10px;
}
.target-file-item img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--rs); }
.target-file-info { font-size: 11px; color: var(--text-dim); flex: 1; }
.target-file-edit {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
    padding: 5px 10px; cursor: pointer; font-size: 11px; font-weight: 600;
    color: var(--text); transition: all 0.15s;
    flex-shrink: 0;
}
.target-file-edit:hover { border-color: var(--accent); color: var(--accent); }
.target-file-edit svg { width: 12px; height: 12px; }

/* Event comments */
.event-comment {
    display: flex; gap: 8px; padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.event-comment:last-child { border-bottom: none; }
.event-comment-body { flex: 1; min-width: 0; }
.event-comment-user { font-weight: 600; font-size: 12px; color: var(--text-main); text-decoration: none; }
.event-comment-user:hover { color: var(--accent); }
.event-comment-time { font-size: 10px; color: var(--text-muted); margin-left: 6px; }
.event-comment-text { font-size: 13px; color: var(--text-main); margin-top: 3px; line-height: 1.5; }
.event-comment-actions {
    display: flex; gap: 2px; margin-top: 4px;
    opacity: 0; transition: opacity 0.15s;
}
.event-comment:hover .event-comment-actions { opacity: 1; }
.event-comment-actions .vc-action-btn {
    background: none; border: none; color: var(--text-muted);
    font-size: 11px; cursor: pointer; padding: 1px 4px; border-radius: 3px;
    transition: color 0.12s, background 0.12s;
}
.event-comment-actions .vc-action-btn:hover { color: var(--text); background: var(--surface2); }
.event-comment-actions .vc-del:hover { color: var(--accent-red); }
.target-file-remove {
    background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer;
    padding: 0 4px; line-height: 1; transition: color .15s;
}
.target-file-remove:hover { color: var(--accent-red, #e74c3c); }
.caption-wrap { position: relative; }
.caption-wrap .form-control { padding-bottom: 24px; }
.caption-count { position: absolute; bottom: 10px; right: 10px; font-size: 10px; color: var(--text-muted); pointer-events: none; transition: color .15s; }
.caption-count.near-limit { color: #f59e0b; }
.caption-count.at-limit { color: #ef4444; }

/* ═══ NOTIFICATIONS ═══ */
.notif-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--tr);
}
.notif-item:hover { background: var(--bg-panel-alt); }
.notif-item.unread { background: rgba(59,130,246,.05); }
.notif-text { flex: 1; font-size: 12px; }
.notif-text strong a:hover { color: var(--accent); }
.notif-view-post { color: var(--accent); text-decoration: none; font-weight: 600; margin-left: 4px; font-size: 13px; }
.notif-view-post:hover { text-decoration: underline; }
.notif-time { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

/* ═══ NOTIFICATION POPUP ═══ */
.notif-popup {
    display: none;
    position: fixed; top: 52px; right: 8px;
    width: 340px; max-width: calc(100vw - 16px);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    box-shadow: var(--shadow);
    z-index: 120;
    animation: scaleIn .15s ease;
    overflow: hidden;
}
.notif-popup.open { display: flex; flex-direction: column; }
.notif-popup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-popup-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px; font-weight: 700;
}
.notif-mark-all {
    font-size: 11px; color: var(--accent);
    background: none; border: none; cursor: pointer;
    font-family: inherit; padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-popup-body {
    overflow-y: auto; max-height: calc(100vh - 120px);
}
.notif-popup-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 32px; color: var(--text-muted);
}
.notif-popup-loading svg {
    width: 28px; height: 28px; stroke: currentColor;
    stroke-width: 1.5; fill: none; opacity: .4;
}
.notif-popup-empty {
    padding: 32px 14px; text-align: center;
    color: var(--text-muted); font-size: 13px;
}
.notif-load-more {
    display: block; width: 100%; padding: 10px;
    background: none; border: none; border-top: 1px solid var(--border);
    color: var(--accent); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background var(--tr);
}
.notif-load-more:hover { background: var(--element-bg); }

/* ═══ MESSAGES / CHAT ═══ */
.conv-list a { text-decoration: none; }
.conv-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--r);
    transition: background var(--tr);
}
.conv-item:hover { background: var(--bg-panel-alt); }
.conv-item.unread { background: rgba(59,130,246,.05); }
.conv-info { flex: 1; overflow: hidden; }
.conv-name { font-weight: 600; font-size: 13px; }
.conv-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 9px; color: var(--text-muted); }
.conv-unread { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-top: 4px; }

.chat-container {
    display: flex; flex-direction: column;
    height: calc(100vh - 120px);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    overflow: hidden;
}
.chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.chat-header svg { width: 18px; height: 18px; stroke: var(--text-muted); fill: none; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; }
.msg {
    max-width: 75%; padding: 8px 12px;
    border-radius: var(--rl); margin-bottom: 6px;
    font-size: 13px; line-height: 1.5;
}
.msg-sent { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg-received { background: var(--bg-panel-alt); color: var(--text-main); border-bottom-left-radius: 4px; }
.msg-time { font-size: 9px; opacity: .7; margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.msg-action-btn { background: none; border: none; cursor: pointer; opacity: 0; padding: 2px; transition: opacity .15s; color: var(--text-muted); }
.msg-action-btn svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; }
.msg:hover .msg-action-btn { opacity: .6; }
.msg-action-btn:hover { opacity: 1; }
@media (max-width: 768px) {
    .msg-action-btn { opacity: .4; padding: 6px; }
    .msg-action-btn svg { width: 14px; height: 14px; }
}
.msg-deleted { font-style: italic; opacity: .5; font-size: 12px; }
.comment-action-btn { background: none; border: none; cursor: pointer; opacity: .5; padding: 4px; transition: opacity .15s; color: var(--text-muted); }
.comment-action-btn svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }
.comment:hover .comment-action-btn { opacity: .7; }
.comment-action-btn:hover { opacity: 1; }
@media (max-width: 768px) {
    .comment-action-btn { opacity: .6; padding: 6px; }
    .comment-action-btn svg { width: 14px; height: 14px; }
    .comment-flag-btn { opacity: .5 !important; padding: 6px; }
    .comment-flag-btn svg { width: 12px; height: 12px; }
}
.chat-input textarea { resize: none; overflow-y: auto; max-height: 120px; line-height: 1.4; }
.chat-input {
    display: flex; gap: 8px; padding: 10px 16px;
    border-top: 1px solid var(--border);
}
.chat-input input {
    flex: 1; background: var(--element-bg); border: 1px solid var(--border);
    border-radius: 20px; padding: 8px 14px;
    color: var(--text-main); font-size: 13px;
    outline: none; font-family: inherit;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-input button {
    background: var(--accent); border: none;
    border-radius: 50%; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.chat-input button svg { width: 16px; height: 16px; stroke: #fff; fill: none; }

/* ═══ LEADERBOARD ═══ */
.lb-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    transition: background var(--tr);
}
.lb-row:hover { background: var(--bg-panel-alt); }
.lb-row-me { background: rgba(59,130,246,.06); border-left: 3px solid var(--accent); }
.lb-disc-filter { padding: 8px 14px; }
.lb-disc-filter select { padding: 8px 12px; border-radius: var(--rs); border: 1px solid var(--border); background: var(--element-bg); color: var(--text-main); font-size: 13px; }
.lb-separator { text-align: center; padding: 8px 0; color: var(--text-muted); font-size: 16px; letter-spacing: 4px; }
.lb-rank {
    width: 28px; height: 28px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: var(--element-bg); color: var(--text-muted);
}
.lb-rank.gold { background: rgba(234,179,8,.12); color: var(--accent-yellow); }
.lb-rank.silver { background: rgba(192,192,192,.15); color: #c0c0c0; }
.lb-rank.bronze { background: rgba(205,127,50,.15); color: #cd7f32; }
.lb-info { flex: 1; min-width: 0; overflow: hidden; }
.lb-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-handle { font-size: 10px; color: var(--text-muted); }
.lb-points { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; color: var(--accent); white-space: nowrap; }
.lb-streak { font-size: 10px; color: #f97316; display: flex; align-items: center; gap: 2px; justify-content: flex-end; white-space: nowrap; }
.lb-streak svg { width: 12px; height: 12px; stroke: #f97316; fill: none; }
@media (max-width: 600px) {
    .lb-row { gap: 8px; padding: 8px 10px; }
    .lb-rank { width: 24px; height: 24px; font-size: 10px; }
    .lb-name { font-size: 12px; }
    .lb-name .lvl-badge { display: none; }
    .lb-handle { display: none; }
    .lb-points { font-size: 13px; }
    .lb-streak { font-size: 9px; }
    .lb-row .avatar { width: 32px !important; height: 32px !important; }
    .lb-disc-filter { padding: 6px 10px; }
    .lb-disc-filter select { font-size: 12px; padding: 6px 8px; }
}
.tabs { display: flex; gap: 2px; margin-bottom: 16px; padding: 3px; background: var(--element-bg); border-radius: var(--r); flex-wrap: wrap; }
.tab {
    padding: 7px 14px; font-size: 11px; font-weight: 600;
    color: var(--text-muted); border-radius: calc(var(--r) - 2px);
    transition: all var(--tr);
}
.tab { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.tab svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; }
.tab:hover { color: var(--text-main); }
.tab.active { color: var(--accent); background: var(--bg-panel); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* ═══ ACHIEVEMENTS ═══ */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ach-card {
    background: var(--bg-panel-alt); border: 1px solid var(--border);
    border-radius: var(--r); padding: 16px; text-align: center;
    opacity: .4; transition: all var(--tr);
}
.ach-card.earned { opacity: 1; border-color: var(--accent); }
.ach-icon svg { width: 28px; height: 28px; stroke: var(--accent); fill: none; }
.ach-title { font-weight: 700; font-size: 12px; margin-top: 6px; }
.ach-desc { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.ach-reward { font-size: 10px; color: var(--accent-yellow); font-weight: 700; margin-top: 4px; }

/* Profile Achievements Section */
.profile-ach-section { margin-top: 20px; }
.profile-ach-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.profile-ach-header h3 {
    display: flex; align-items: center; gap: 6px;
    font-size: 15px; font-weight: 700; margin: 0;
}
.profile-ach-header h3 svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; }
.profile-ach-count { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.profile-ach-bar {
    height: 6px; background: var(--element-bg); border-radius: 3px; overflow: hidden; margin-bottom: 16px;
}
.profile-ach-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }
.profile-ach-cat { margin-bottom: 14px; }
.profile-ach-cat-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-muted); font-weight: 600; margin-bottom: 8px;
}
.profile-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }

/* ═══ REWARDS ═══ */
.points-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.points-display {
    display: flex; align-items: center; gap: 10px;
    background: rgba(240,180,41,.08);
    border: 1px solid rgba(240,180,41,.2);
    border-radius: var(--r); padding: 10px 16px;
}
.points-display svg { width: 22px; height: 22px; stroke: var(--accent-yellow); fill: none; }
.points-number { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: var(--accent-yellow); }
.points-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.rewards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.reward-card {
    background: var(--bg-panel-alt); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 20px; text-align: center;
    transition: all var(--tr);
}
.reward-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.reward-icon svg { width: 28px; height: 28px; stroke: var(--accent); fill: none; }
.reward-title { font-weight: 700; font-size: 14px; margin-top: 8px; }
.reward-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.reward-cost { font-size: 12px; color: var(--accent-yellow); font-weight: 700; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.reward-cost svg { width: 14px; height: 14px; stroke: var(--accent-yellow); fill: none; }
.btn-redeem {
    margin-top: 10px; padding: 6px 18px;
    border-radius: 20px; font-size: 12px;
    font-weight: 600; border: none; cursor: pointer;
    font-family: inherit; transition: all var(--tr);
}
.btn-redeem.can-afford { background: var(--accent); color: #fff; }
.btn-redeem.can-afford:hover { background: var(--accent-hover); }
.btn-redeem.cant-afford { background: var(--element-bg); color: var(--text-muted); cursor: not-allowed; }
.redeemed-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.redeemed-code {
    font-family: 'Courier New', monospace;
    background: var(--element-bg);
    padding: 3px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 700;
    color: var(--accent-green);
}

/* Redeem Confirmation Modal */
.redeem-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 20px;
}
.redeem-modal-overlay.open { display: flex; }
.redeem-modal {
    width: 100%; max-width: 360px; position: relative;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 28px 24px; text-align: center;
    animation: redeemPop .3s ease;
}
@keyframes redeemPop { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
.redeem-modal-icon { margin-bottom: 12px; }
.redeem-modal-icon svg { width: 40px; height: 40px; stroke: var(--accent); fill: none; }
.redeem-modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.redeem-modal-cost { font-size: 14px; font-weight: 700; color: var(--accent-yellow); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.redeem-modal-cost svg { width: 16px; height: 16px; stroke: var(--accent-yellow); fill: none; }
.redeem-modal-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.redeem-modal-balance { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--element-bg); border-radius: var(--rs); }
.redeem-modal-balance svg { width: 12px; height: 12px; stroke: var(--accent-yellow); fill: none; }
.redeem-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; }

/* Redeem Success Banner */
.redeem-success-banner {
    display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 16px;
    background: rgba(78,189,53,.08); border: 1px solid rgba(78,189,53,.25); border-radius: var(--rl);
}
.redeem-success-icon { font-size: 28px; }
.redeem-success-text { flex: 1; }
.redeem-success-text strong { font-size: 14px; display: block; margin-bottom: 2px; }
.redeem-success-code {
    font-family: 'Courier New', monospace; font-size: 16px; font-weight: 700;
    color: var(--accent-green); background: var(--element-bg); padding: 4px 10px;
    border-radius: 4px; display: inline-block; margin-top: 4px;
}
.redeem-copy-btn {
    display: flex; align-items: center; gap: 4px; padding: 6px 12px;
    background: var(--accent-green); color: #fff; border: none; border-radius: var(--rs);
    font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.redeem-copy-btn svg { width: 12px; height: 12px; stroke: #fff; fill: none; }

/* Camera Upload Button */
.camera-upload-row { display: flex; margin-top: 8px; }
.btn-camera-upload {
    display: flex; align-items: center; gap: 6px; padding: 8px 14px;
    background: var(--element-bg); border: 1px solid var(--border); border-radius: var(--rs);
    color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all .15s;
}
.btn-camera-upload:hover { border-color: var(--accent); background: rgba(0,102,204,.06); }
.btn-camera-upload svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ═══ LEVELS ═══ */
.level-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 24px; text-align: center;
    margin-bottom: 20px;
}
.level-card-icon { font-size: 48px; margin-bottom: 6px; }
.level-card-name { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; }
.level-progress-wrap { margin-top: 16px; max-width: 280px; margin-left: auto; margin-right: auto; }
.level-progress-bar { height: 8px; background: var(--element-bg); border-radius: 4px; overflow: hidden; }
.level-progress-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.level-fill-starter  { background: #a0a0a0; }
.level-fill-bronze   { background: #cd7f32; }
.level-fill-silver   { background: #c0c0c0; }
.level-fill-gold     { background: var(--accent-yellow); }
.level-fill-platinum { background: var(--accent); }
.level-fill-diamond  { background: var(--accent-green); }
.level-fill-master   { background: var(--accent-purple); }
.level-fill-legend   { background: linear-gradient(90deg, var(--accent), var(--accent-purple)); }
.level-progress-text { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.level-tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 20px; }
.level-tier-item {
    background: var(--bg-panel-alt); border-radius: var(--r);
    padding: 12px 8px; text-align: center;
    border: 1px solid transparent; transition: all var(--tr);
}
.level-tier-item.current { border-color: var(--accent); background: rgba(59,130,246,.08); }
.level-tier-item.locked { opacity: .35; }
.level-tier-icon { font-size: 22px; margin-bottom: 3px; }
.level-tier-name { font-size: 11px; font-weight: 700; }
.level-tier-pts { font-size: 9px; color: var(--text-muted); }

/* ═══ SETTINGS ═══ */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.settings-grid-full { grid-column: 1 / -1; }
@media (min-width: 900px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
.content-area:has(.settings-grid) { max-width: 1100px; }
.settings-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 20px;
    margin-bottom: 12px;
}
.settings-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px; font-weight: 700; margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.avatar-upload {
    display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.avatar-upload-btn {
    position: relative; cursor: pointer;
}
.avatar-upload-btn .overlay {
    position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,.5); border-radius: 50%;
    opacity: 0; transition: opacity var(--tr);
}
.avatar-upload-btn:hover .overlay { opacity: 1; }
.avatar-upload-btn .overlay svg { width: 20px; height: 20px; stroke: #fff; fill: none; }
.avatar-upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ═══ USER LISTS ═══ */
.user-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.user-list-info { flex: 1; }
.user-list-name { font-weight: 600; font-size: 13px; }
.user-list-name:hover { color: var(--accent); }
.user-list-handle { font-size: 10px; color: var(--text-muted); }

/* ═══ ADMIN ═══ */
.admin-header {
    background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(124,110,240,.08));
    border: 1px solid rgba(59,130,246,.2);
    border-radius: var(--rl); padding: 24px;
    margin-bottom: 24px; animation: scaleIn .4s ease;
}
.admin-header-toggle {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; user-select: none;
}
.admin-collapse-btn {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--r); background: rgba(59,130,246,.1);
    transition: transform var(--tr);
}
.admin-collapse-btn::after {
    content: ''; display: block; width: 10px; height: 10px;
    border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
    transform: rotate(135deg); margin-top: 3px;
}
.admin-collapse-btn.collapsed { transform: rotate(180deg); }
.admin-stats-body {
    max-height: 500px; overflow: hidden;
    transition: max-height .3s ease, opacity .3s ease;
    opacity: 1;
}
.admin-stats-body.collapsed {
    max-height: 0; opacity: 0; margin-top: 0;
}
.admin-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px; margin-bottom: 4px;
    display: flex; align-items: center; gap: 10px;
}
.admin-title svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; }
.admin-subtitle { font-size: 12px; color: var(--text-muted); }
.admin-stats {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px; margin-top: 18px;
}
.admin-stat {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--r); padding: 14px;
    text-align: center; transition: all var(--tr);
}
.admin-stat:hover { border-color: var(--border-light); transform: translateY(-1px); }
.admin-stat-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px; color: var(--accent);
}
.admin-stat-label {
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px; margin-top: 2px;
}
.admin-charts-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
    margin-bottom: 16px;
}
.admin-chart-card {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 16px;
    animation: fadeUp .4s ease;
}
.admin-chart-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px; font-weight: 600; color: var(--text-dim);
    margin-bottom: 10px;
}
.admin-chart {
    width: 100%; height: 200px; display: block;
}
@media (max-width: 768px) {
    .admin-charts-grid { grid-template-columns: 1fr; }
}
.admin-page .content-area { max-width: 1100px; }
.admin-load-more {
    display: block; width: 100%; padding: 10px;
    margin-top: 12px; background: var(--element-bg);
    border: 1px solid var(--border); border-radius: var(--r);
    color: var(--accent); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all var(--tr);
}
.admin-load-more:hover { background: var(--element-bg-hover); border-color: var(--border-light); }
.admin-card {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 20px;
    margin-bottom: 16px; animation: fadeUp .4s ease;
    color: var(--text-main);
}
.admin-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px; margin-bottom: 14px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.admin-card .form-label { color: var(--text-main); }
.admin-card td { color: var(--text-main); }
.admin-modal { color: var(--text-main); }
.admin-modal .form-label { color: var(--text-main); }
.admin-modal h4 { color: var(--text-main); }
.admin-header { color: var(--text-main); }
.admin-title { color: var(--text-main); }
.admin-btn {
    padding: 4px 10px; border-radius: 6px;
    font-size: 10px; font-weight: 600;
    cursor: pointer; border: 1px solid var(--border);
    background: var(--bg-panel-alt); color: var(--text-muted);
    transition: all var(--tr); white-space: nowrap;
    font-family: inherit; display: inline-flex; align-items: center;
}
.admin-btn svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; margin-right: 2px; flex-shrink: 0; }
.admin-btn:hover { border-color: var(--border-light); color: var(--text-main); }
.admin-btn.danger { border-color: rgba(255,71,71,.3); color: #ff4747; background: rgba(255,71,71,.06); }
.admin-btn.danger svg { stroke: #ff4747; }
.admin-btn.success { border-color: rgba(78,189,53,.3); color: var(--accent-green); background: rgba(78,189,53,.06); }
.admin-btn.success svg { stroke: var(--accent-green); }
.admin-btn.warning { border-color: rgba(240,180,41,.3); color: var(--accent-yellow); background: rgba(240,180,41,.06); }
.admin-btn.warning svg { stroke: var(--accent-yellow); }
.admin-btn.primary svg { stroke: var(--accent); }

/* Admin Rewards */
/* Admin Modal Popup */
.admin-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.6); align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
}
.admin-modal-overlay.open { display: flex; }
.admin-modal {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 24px;
    width: 100%; max-width: 680px;
    animation: scaleIn .2s ease; position: relative;
}
.admin-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.admin-modal-header h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px; margin: 0;
}
.admin-modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 22px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.admin-modal-close:hover { color: var(--text-main); }

.admin-reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .admin-reward-grid { grid-template-columns: 1fr; } }
.admin-reward-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: var(--rs); }
.admin-reward-thumb-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--element-bg); border-radius: var(--rs); }
.admin-reward-thumb-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; }
.post-type-desc {
    font-size: 11px; color: var(--text-muted); padding: 8px 12px; margin-top: 8px;
    background: var(--element-bg); border-radius: var(--rs); border-left: 3px solid var(--accent);
    line-height: 1.5;
}
/* Guest login gate */
.guest-login-gate {
    margin-top: 24px; padding: 32px 20px; text-align: center;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--rl);
}
.guest-gate-content svg { width: 32px; height: 32px; stroke: var(--accent); fill: none; margin-bottom: 12px; }
.guest-gate-content h3 { font-family: 'Space Grotesk', sans-serif; font-size: 18px; margin-bottom: 6px; color: var(--text-main); }
.guest-gate-content p { font-size: 12px; color: var(--text-muted); max-width: 320px; margin: 0 auto; line-height: 1.5; }
.sidebar-guest-cta { padding: 14px; border-top: 1px solid var(--border); }

/* ═══ GUEST LANDING PAGES (theme-aware) ═══ */
/* Hero card variants — duel/purple-red, leaderboard/gold, group/royal, generic/accent */
.guest-hero {
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 32px 28px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.guest-hero-duel { background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(231,76,60,0.10)); }
.guest-hero-leaderboard { background: linear-gradient(135deg, rgba(234,179,8,0.14), rgba(245,158,11,0.06)); }
.guest-hero-group { background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(180,83,9,0.06)); }
.guest-hero-event { background: linear-gradient(135deg, rgba(6,182,212,0.12), rgba(99,102,241,0.06)); }
[data-theme="light"] .guest-hero-duel { background: linear-gradient(135deg, rgba(124,58,237,0.10), rgba(231,76,60,0.08)); }
[data-theme="light"] .guest-hero-leaderboard { background: linear-gradient(135deg, rgba(234,179,8,0.16), rgba(245,158,11,0.10)); }
[data-theme="light"] .guest-hero-group { background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(180,83,9,0.10)); }
[data-theme="light"] .guest-hero-event { background: linear-gradient(135deg, rgba(6,182,212,0.14), rgba(99,102,241,0.10)); }

.guest-hero-icon {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

/* Title — solid color (not gradient) so it reads in both themes */
.guest-hero-title {
    font-size: 24px;
    font-weight: 900;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.15;
}
.guest-hero-title-duel { color: #8b5cf6; }
.guest-hero-title-leaderboard { color: #b45309; }
.guest-hero-title-group { color: #b45309; }
.guest-hero-title-event { color: #0e7490; }
[data-theme="light"] .guest-hero-title-duel { color: #6d28d9; }
[data-theme="light"] .guest-hero-title-leaderboard { color: #92400e; }
[data-theme="light"] .guest-hero-title-group { color: #92400e; }
[data-theme="light"] .guest-hero-title-event { color: #155e75; }

.guest-hero-text {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto 18px;
    line-height: 1.6;
}

/* Feature cards grid */
.guest-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.guest-feature-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.guest-feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light, var(--accent));
    box-shadow: var(--shadow);
}
.guest-feature-icon { font-size: 28px; margin-bottom: 8px; line-height: 1; }
.guest-feature-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--text-main); }
.guest-feature-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* "How it works" steps section */
.guest-steps-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    margin-bottom: 20px;
}
.guest-steps-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.guest-steps-list { display: flex; flex-direction: column; gap: 12px; }
.guest-step-row { display: flex; gap: 14px; align-items: flex-start; }
.guest-step-num {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.guest-step-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; color: var(--text-main); }
.guest-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Compact list rows (used by leaderboard preview) */
.guest-list-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 20px; }
.guest-list-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 14px; }
.guest-list-rows { display: flex; flex-direction: column; gap: 8px; }
.guest-list-row {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 12px;
    background: var(--element-bg);
    border-radius: var(--r);
    transition: background .15s;
}
.guest-list-row:hover { background: var(--bg-hover, var(--element-bg)); }
.guest-list-icon { font-size: 20px; flex-shrink: 0; width: 32px; text-align: center; }
.guest-list-row-title { font-weight: 700; font-size: 13px; color: var(--text-main); }
.guest-list-row-desc { font-size: 11px; color: var(--text-muted); }

/* Auth Popup */
.auth-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0; padding: 20px;
    z-index: 9999;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}
.auth-popup-overlay.open { display: flex; }
.auth-popup {
    width: 100%; max-width: 380px; position: relative;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 32px 28px;
    animation: authPopIn .25s ease;
    max-height: 90vh; overflow-y: auto;
}
@keyframes authPopIn { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
.auth-popup-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; color: var(--text-muted); font-size: 22px;
    cursor: pointer; line-height: 1; padding: 4px;
}
.auth-popup-close:hover { color: var(--text-primary); }
.auth-popup-title { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.auth-popup-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.auth-popup-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; }
.auth-popup-links a { color: var(--accent); text-decoration: none; }
.auth-popup-links a:hover { text-decoration: underline; }
.guest-login-gate { cursor: pointer; }

/* About Page */
.about-card {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 0; margin-bottom: 20px; overflow: hidden;
}
.about-cover { position: relative; height: 280px; overflow: hidden; }
.about-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-cover-overlay { position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,0.75)); }
.about-cover-content { position: absolute; bottom: 24px; left: 28px; right: 28px; }
.about-logo { display: flex; align-items: flex-end; gap: 0; font-family: 'Space Grotesk', sans-serif; }
.about-tagline { font-size: 14px; margin-top: 6px; }
.about-body { padding: 28px; }
.about-section { margin-bottom: 24px; }
.about-section h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--text-main);
    padding-bottom: 8px; border-bottom: 2px solid var(--accent);
}
.about-section h3 svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; }
.about-section p { font-size: 13px; color: var(--text-dim); line-height: 1.7; margin-bottom: 10px; }
.about-features {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px; margin-bottom: 24px;
}
.about-feature {
    background: var(--element-bg); border: 1px solid var(--border);
    border-radius: var(--r); padding: 20px; text-align: left;
    transition: border-color .15s, transform .15s;
}
.about-feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.about-feature-icon { margin-bottom: 10px; width: 40px; height: 40px; border-radius: 10px; background: rgba(0,102,204,0.1); display: flex; align-items: center; justify-content: center; }
.about-feature-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; }
.about-feature h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.about-feature p { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.about-cta { display: flex; gap: 10px; justify-content: center; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.about-cta .btn { min-width: 140px; padding: 10px 24px; font-size: 14px; }
.about-shop-card {
    margin: 24px 0; padding: 20px; border-radius: var(--r); display: flex; align-items: center; gap: 16px;
    background: linear-gradient(135deg, rgba(0,102,204,0.06), rgba(124,58,237,0.04));
    border: 1px solid var(--accent); transition: border-color .15s, box-shadow .15s;
}
.about-shop-card:hover { box-shadow: 0 4px 16px rgba(0,102,204,0.15); }
@media (max-width: 600px) {
    .about-cover { height: 200px; }
    .about-cover-content { bottom: 16px; left: 16px; right: 16px; }
    .about-body { padding: 20px; }
    .about-features { grid-template-columns: 1fr; }
    .about-shop-card { flex-direction: column; text-align: center; gap: 10px; }
}

.admin-pt-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.admin-pt-item:last-of-type { border-bottom: none; }
.admin-pt-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.admin-pt-header svg { width: 16px; height: 16px; stroke: var(--accent); stroke-width: 2; fill: none; }
.admin-reward-img-preview { margin-bottom: 8px; }
.admin-reward-img-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--rs); border: 1px solid var(--border); }

/* Reward card image */
.reward-image { margin-bottom: 8px; }
.reward-image img { width: 100%; max-height: 120px; object-fit: cover; border-radius: var(--rs); }
.reward-type-badge { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); background: rgba(0,102,204,.08); padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; display: inline-block; }
.reward-discount { font-size: 11px; color: var(--accent-green); font-weight: 600; margin-top: 4px; }
.reward-stock { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.reward-card.reward-oos { opacity: 0.5; }
.rw-field-discount, .rw-field-product { transition: all .15s; }

/* QR Code Post */
/* SCATT Viewer Iframe */
.scatt-viewer-wrap {
    width: 100%; aspect-ratio: 4/3;
    border-top: 1px solid var(--border);
    overflow: hidden;
}
.scatt-viewer-iframe {
    width: 100%; height: 100%;
    border: none; display: block;
}
.post-qr-bar {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    background: var(--element-bg); border-top: 1px solid var(--border);
    text-decoration: none; color: var(--accent); font-size: 12px;
    transition: background .15s;
}
.post-qr-bar:hover { background: var(--bg-panel-alt); }
.post-qr-bar svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }
.post-qr-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }

/* QR Scanner in Create */
.qr-input-row { display: flex; gap: 8px; align-items: center; }
.qr-input-row .form-control { flex: 1; }
.btn-qr-scan {
    display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px;
    background: var(--element-bg); border: 1px solid var(--border); border-radius: var(--rs);
    color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: all .15s;
}
.btn-qr-scan:hover { border-color: var(--accent); }
.btn-qr-scan svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
#qrScanArea {
    position: relative; margin-top: 10px; border-radius: var(--rs); overflow: hidden;
    background: #000; max-height: 300px;
}
.qr-video { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.qr-scan-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.qr-scan-frame {
    width: 180px; height: 180px; border: 2px solid rgba(139,92,246,.6);
    border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.4);
    position: relative; overflow: hidden;
}
.qr-scan-frame::after {
    content: ''; position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,.8), transparent);
    animation: qrScanLine 2s ease-in-out infinite;
}
@keyframes qrScanLine { 0%,100% { top: 0; } 50% { top: 100%; } }
.btn-qr-stop {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
    border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff;
    font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.qr-result {
    display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 12px;
    background: rgba(78,189,53,.06); border: 1px solid rgba(78,189,53,.2); border-radius: var(--rs);
    color: var(--accent-green); font-size: 12px;
}
.qr-result svg { width: 14px; height: 14px; stroke: var(--accent-green); fill: none; }
.qr-insecure { background: rgba(220,53,69,.06); border-color: rgba(220,53,69,.25); color: var(--accent-red); }
.qr-insecure svg { stroke: var(--accent-red); }
.qr-upload-row { margin-top: 8px; }
.btn-qr-upload {
    display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px;
    background: var(--element-bg); border: 1px solid var(--border); border-radius: var(--rs);
    color: var(--text-dim); font-size: 12px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: all .15s;
}
.btn-qr-upload:hover { border-color: var(--accent); color: var(--accent); }
.btn-qr-upload svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.btn-qr-fetch-unsafe {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
    background: rgba(220,53,69,.1); border: 1px solid rgba(220,53,69,.3); border-radius: var(--rs);
    color: var(--accent-red); font-size: 11px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: all .15s;
}
.btn-qr-fetch-unsafe:hover { background: rgba(220,53,69,.2); }
.btn-qr-fetch-unsafe svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }
.post-qr-insecure { background: rgba(220,53,69,.06); border-color: rgba(220,53,69,.2); color: var(--accent-red); }
.post-qr-insecure svg { stroke: var(--accent-red); }
.admin-btn.primary { border-color: rgba(59,130,246,.3); color: var(--accent); background: rgba(59,130,246,.06); }
.admin-card td svg, .admin-card .table svg, .admin-card a svg {
    width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; vertical-align: -2px;
}
.admin-post-thumb { width: 50px; height: 50px; border-radius: var(--rs); object-fit: cover; border: 1px solid var(--border); }
.admin-log { max-height: 300px; overflow-y: auto; }
.admin-log-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-bottom: 1px solid var(--border);
    font-size: 11px;
}
.admin-log-time { color: var(--text-muted); font-size: 10px; flex-shrink: 0; width: 70px; }
.admin-log-text { flex: 1; color: var(--text-dim); }
.admin-inline-form { display: inline-flex; gap: 4px; align-items: center; }
.admin-inline-form input[type=number],
.admin-inline-form input[type=text] {
    width: 90px; padding: 3px 6px;
    background: var(--element-bg); border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-main);
    font-size: 11px; font-family: inherit;
}
.admin-actions-cell { min-width: 160px; }

/* ═══ MOBILE / RESPONSIVE ═══ */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.6); z-index: 99;
}
.mobile-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    padding: 4px 0 6px; z-index: 90;
    justify-content: space-around;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}
.mobile-nav a {
    display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    color: var(--text-muted); font-size: 9px;
    padding: 6px 10px; position: relative;
    transition: color var(--tr);
    min-width: 0;
    text-decoration: none;
    border-radius: 10px;
}
.mobile-nav a:active { background: var(--element-bg); }
.mobile-nav a.active { color: var(--accent); filter: drop-shadow(0 0 6px rgba(59,130,246,.3)); }
.mobile-nav svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.mobile-nav .nav-badge { top: -2px; left: 50%; margin-left: 4px; width: 14px; height: 14px; font-size: 8px; }

/* ═══ APP FOOTER ═══ */
.app-footer {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 18px 32px;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    opacity: 0.7;
}
.app-footer-links {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; justify-content: center;
}
.app-footer-links a {
    font-size: 11px; color: var(--text-muted);
    text-decoration: none; transition: color var(--tr);
}
.app-footer-links a:hover { color: var(--accent); }
.app-footer-sep { color: var(--border-light); font-size: 11px; }
.app-footer-copy { font-size: 10px; color: var(--border-light); }

/* Legal pages */
.legal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 24px;
    display: flex; flex-direction: column; gap: 0;
}
.legal-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.legal-section:first-child { padding-top: 0; }
.legal-section:last-child { border-bottom: none; padding-bottom: 0; }
.legal-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px; font-weight: 700;
    margin-bottom: 10px;
}
.legal-section h4 {
    font-size: 12px; font-weight: 700;
    color: var(--text-dim); margin: 10px 0 4px;
}
.legal-section p {
    font-size: 12px; color: var(--text-dim);
    line-height: 1.7; margin: 0 0 6px;
}
.legal-section a { color: var(--accent); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); top: 52px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; padding-top: 52px; padding-bottom: 52px; }
    .top-navbar-hamburger { display: flex; }
    .navbar-search { display: none !important; }
    .top-navbar-logo { flex: 1; }
    .navbar-points { display: none; }
    .mobile-nav { display: flex; }
    .navbar-avatar { display: none !important; }
    .navbar-points { display: none !important; }
    .top-navbar { padding: 0 8px; gap: 4px; }
    .top-navbar-logo { font-size: 16px; padding: 0 4px; }
    .logo-shotmetrix { display: none; }
    .beta-badge { display: none; }
    .top-navbar-right { gap: 2px; }
    .navbar-icon-btn { width: 40px; height: 40px; min-width: 40px; border-radius: 10px; }
    .navbar-icon-btn svg { width: 20px; height: 20px; }
    .navbar-flag { font-size: 18px; width: 40px; height: 40px; min-width: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
    .top-navbar-hamburger { width: 40px; height: 40px; min-width: 40px; display: flex; align-items: center; justify-content: center; }
    .top-navbar-hamburger svg { width: 22px; height: 22px; }
    .footer-guidelines { display: block; }
    .content-area { padding: 14px 0 12px 0 !important; }
    /* Non-post elements get horizontal padding */
    .content-area > *:not(.post-card):not(.profile-posts-grid):not(.profile-cover-wrap) { margin-left: 12px; margin-right: 12px; }
    .content-area > .post-card { margin-left: 0 !important; margin-right: 0 !important; }
    /* Full-width post cards on mobile */
    .post-card { border-radius: 0 !important; border-left: none !important; border-right: none !important; margin-bottom: 8px !important; width: 100% !important; }
    .profile-posts-grid { gap: 0; margin-left: 0 !important; margin-right: 0 !important; }
    .profile-posts-grid .post-card { border-radius: 0 !important; border-left: none !important; border-right: none !important; width: 100% !important; }
    .app-footer { padding: 16px 12px 80px; }
    .auth-card { padding: 24px 20px; }
    .profile-stats > div, .profile-stats > a { padding: 8px 6px; }
    .profile-actions { flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 0 12px; }
    .profile-actions .btn-follow { font-size: 11px; padding: 6px 14px; }
    .profile-name { font-size: 20px; }
    .profile-badges-row { flex-wrap: wrap; gap: 6px; padding: 0 12px; }
    .profile-badge-card { padding: 6px 10px; }
    .profile-header { padding: 0 8px 16px; gap: 8px; }
    .profile-cover-wrap .profile-header { margin: -48px 8px 0; padding: 0 12px 16px; }
    .profile-bio { font-size: 12px; }
    .profile-cover-wrap { width: 100% !important; margin-left: 0 !important; margin-top: -14px !important; margin-right: 0 !important; }
    .profile-cover-wrap::before { height: 220px; }
    .profile-cover-bg { height: 220px; filter: blur(18px) saturate(1.2) brightness(0.7); }
    .profile-cover-img { height: 220px; }
    .profile-cover-fade { height: 220px; }
    .profile-cover-wrap .profile-header { margin-top: -36px; }
    /* Settings full-width on mobile */
    .settings-section { border-radius: 0; border-left: none; border-right: none; margin-left: 0 !important; margin-right: 0 !important; }
    .verify-card { margin: 14px 8px; padding: 24px 16px; }
    .rewards-grid { grid-template-columns: 1fr; }
    .chat-container { height: calc(100dvh - 140px); border-radius: 0; border-left: none; border-right: none; }
    .chat-input {
        padding: 8px 10px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        gap: 6px;
    }
    .chat-input input { padding: 10px 14px; font-size: 15px; min-width: 0; flex: 1; }
    .chat-input button { width: 40px; height: 40px; min-width: 40px; flex-shrink: 0; }
    .chat-input textarea { font-size: 15px; }
    .chat-attach-btn { width: 36px; height: 36px; min-width: 36px; }
    .chat-messages { padding: 10px; }
    .msg { max-width: 85%; font-size: 14px; }
    .chat-header { padding: 10px 12px; }
    html.standalone .chat-container { height: calc(100dvh - env(safe-area-inset-top, 44px) - 52px); }
    html.standalone .chat-input { padding-bottom: calc(10px + env(safe-area-inset-bottom, 34px)); }
    .ach-grid { grid-template-columns: repeat(2, 1fr); }
    .level-tier-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    /* Settings page: prevent horizontal cutoff */
    .settings-section { padding: 14px 12px; overflow-x: hidden; word-break: break-word; }
    .settings-section .form-control, .settings-section input[type="text"], .settings-section input[type="email"],
    .settings-section input[type="password"], .settings-section textarea, .settings-section select {
        max-width: 100%; box-sizing: border-box;
    }
    .settings-toggle-row { flex-wrap: wrap; gap: 10px; }
    .settings-toggle-row > div:first-child { min-width: 0; }
}

/* ═══ STANDALONE (PWA) MODE ═══ */
/* Detected via JS: html.standalone (works on iOS + Android) */
html.standalone body {
    background: var(--bg-panel);
}

html.standalone .top-navbar {
    top: 0;
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top, 44px);
    height: calc(48px + constant(safe-area-inset-top));
    height: calc(48px + env(safe-area-inset-top, 44px));
    padding-left: 12px;
    padding-right: 12px;
    gap: 6px;
    background: var(--bg-panel);
}
html.standalone .top-navbar-logo { font-size: 15px; }
html.standalone .top-navbar-right { gap: 4px; }
html.standalone .navbar-avatar { display: none !important; }
html.standalone .navbar-points { display: none !important; }

html.standalone .main-content {
    padding-top: calc(48px + constant(safe-area-inset-top));
    padding-top: calc(48px + env(safe-area-inset-top, 44px));
    padding-bottom: calc(80px + constant(safe-area-inset-bottom));
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 34px));
}

html.standalone .mobile-nav {
    height: auto;
    padding: 10px 8px;
    padding-bottom: calc(10px + constant(safe-area-inset-bottom));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 34px));
    background: var(--bg-panel);
}
html.standalone .mobile-nav a {
    font-size: 11px;
    padding: 8px 12px;
    gap: 4px;
}
html.standalone .mobile-nav svg {
    width: 26px; height: 26px; stroke-width: 1.6;
}

html.standalone .sidebar {
    top: calc(48px + constant(safe-area-inset-top));
    top: calc(48px + env(safe-area-inset-top, 44px));
}

html.standalone .app-footer {
    padding-bottom: calc(90px + constant(safe-area-inset-bottom));
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 34px));
}

html.standalone .btn-icon svg { width: 20px; height: 20px; }
html.standalone .post-actions .btn-icon { padding: 6px; }

/* ═══ LIGHT THEME ═══ */
[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-panel: #ffffff;
    --bg-panel-alt: #fafbfc;
    --bg-header: #ffffff;
    --bg-dark: #f0f1f3;
    --element-bg: #f4f5f7;
    --element-bg-hover: #ecedf0;
    --element-bg-active: #e2e4e8;
    --border: #e2e4e8;
    --border-light: #d0d3da;
    --text-main: #111827;
    --text-dim: #374151;
    --text-muted: #6b7280;
    --text-monospace: #4b5563;
    --overlay-bg: rgba(0,0,0,0.35);
    --table-header-bg: #f9fafb;
    --table-summary-bg: #fafbfc;
    --table-hover-bg: rgba(37,99,235,0.04);
    --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 4px rgba(0,0,0,.03);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
    --shadow-raised: 0 1px 3px rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.02);
    --card-bg: #ffffff;
    --text-primary: #111827;
    --surface: #f4f5f7;
    --warning-bg: rgba(245,158,11,0.08);
    --warning-border: rgba(245,158,11,0.25);
    --warning-text: #d97706;
    --primary-bg: rgba(37,99,235,0.04);
    --primary: #2563eb;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --text: #111827;
    --glass-bg: rgba(255,255,255,0.97);
    --glass-border: #e2e4e8;
    --depth-sunken: #f4f5f7;
    --depth-raised: #ffffff;
    --gradient-accent: linear-gradient(135deg, #2563eb, #7c3aed);
    --gradient-accent-hover: linear-gradient(135deg, #1d4ed8, #6d28d9);
}
/* Sidebar */
[data-theme="light"] .sidebar { border-right-color: #e2e4e8; box-shadow: none; background: #fafbfc; }
[data-theme="light"] .sidebar .nav-link-mesh { color: #374151; }
[data-theme="light"] .sidebar .nav-link-mesh:hover { background: #e8eaee; color: #111827; }
[data-theme="light"] .sidebar .nav-link-mesh.active {
    background: rgba(37,99,235,.07);
    color: #2563eb; font-weight: 600;
}
[data-theme="light"] .sidebar .nav-link-mesh.active[style*="accent-purple"] {
    background: rgba(124,58,237,.06);
    color: #6d28d9 !important;
}
[data-theme="light"] .sidebar .nav-link-mesh.active[style*="accent-yellow"] {
    background: rgba(180,83,9,.06);
    color: #92400e !important;
}
[data-theme="light"] .sidebar-group { border-bottom-color: #ecedf0; }
[data-theme="light"] .sidebar-group-label { color: #6b7280; }
/* Post cards */
[data-theme="light"] .post-card { border-bottom-color: #ecedf0; }
[data-theme="light"] .post-card:hover { background: rgba(37,99,235,.02); }
[data-theme="light"] .explore-posts-grid .post-card { border-color: #e2e4e8; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
[data-theme="light"] .explore-posts-grid .post-card:hover { border-color: #d0d3da; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
[data-theme="light"] .profile-posts-grid .post-card { border-color: #e2e4e8; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
[data-theme="light"] .profile-posts-grid .post-card:hover { background: #ffffff; border-color: #d0d3da; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
[data-theme="light"] .explore-posts-grid .post-card:hover { background: #ffffff; }
[data-theme="light"] .post-card { background: #ffffff; }
/* Forms */
[data-theme="light"] .form-control, [data-theme="light"] .form-select { color: #111827 !important; background: #f9fafb !important; border-color: #e2e4e8 !important; }
[data-theme="light"] .form-control:focus, [data-theme="light"] .form-select:focus { border-color: #2563eb !important; box-shadow: 0 0 0 3px rgba(37,99,235,.1), 0 0 12px rgba(37,99,235,.05) !important; }
[data-theme="light"] .btn-close-white { filter: invert(1); }
/* Comment input */
[data-theme="light"] .comment-input { background: #f4f5f7; color: #111827; border: 1px solid #e2e4e8; }
[data-theme="light"] .comment-input:focus { background: #fff; border-color: #2563eb; }
[data-theme="light"] .comment-input::placeholder { color: #6b7280 !important; }
/* Buttons */
[data-theme="light"] .btn-primary { background: var(--gradient-accent) !important; border: none !important; }
[data-theme="light"] .btn-primary:hover { background: var(--gradient-accent-hover) !important; }
[data-theme="light"] .btn-follow.not-following { background: var(--gradient-accent); border-color: transparent; box-shadow: 0 1px 4px rgba(37,99,235,.15); }
[data-theme="light"] .btn-follow.following { border-color: #d0d3da; color: #374151; }
[data-theme="light"] .btn-follow.following:hover { border-color: #dc2626; color: #dc2626; background: rgba(220,38,38,.04); }
[data-theme="light"] .btn-outline-secondary { border-color: #e2e4e8 !important; color: #374151 !important; }
[data-theme="light"] .btn-outline-secondary:hover { background: #ecedf0 !important; color: #111827 !important; border-color: #d0d3da !important; }
/* Search */
[data-theme="light"] .search-box { border-color: #e2e4e8; background: #f4f5f7; }
[data-theme="light"] .search-box:focus-within { border-color: #2563eb; box-shadow: 0 0 12px rgba(37,99,235,.06); }
/* Tabs */
[data-theme="light"] .tabs { background: #f4f5f7; }
[data-theme="light"] .tab { color: #6b7280; }
[data-theme="light"] .tab:hover { color: #111827; background: #ecedf0; }
[data-theme="light"] .tab.active { background: #fff; color: #2563eb; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
/* Profile */
[data-theme="light"] .profile-stats { background: transparent; }
[data-theme="light"] .profile-stats > div + div, [data-theme="light"] .profile-stats > div + a, [data-theme="light"] .profile-stats > a + div, [data-theme="light"] .profile-stats > a + a { border-left-color: #e2e4e8; }
[data-theme="light"] .profile-stats > a:hover { background: rgba(37,99,235,.03); }
[data-theme="light"] .profile-badge-card { background: #fff; border-color: #e2e4e8; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
[data-theme="light"] .profile-badge-card:hover { border-color: #d0d3da; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
[data-theme="light"] .profile-club { background: #fff; border-color: #e2e4e8; }
[data-theme="light"] .profile-club:hover { border-color: #d0d3da; }
[data-theme="light"] .profile-avatar-col { box-shadow: 0 4px 20px rgba(0,0,0,.1), 0 0 12px rgba(37,99,235,.06); }
[data-theme="light"] .profile-cover-wrap .profile-header {
    background: rgba(255,255,255,.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-color: #e2e4e8; box-shadow: 0 2px 16px rgba(0,0,0,.05);
}
[data-theme="light"] .profile-tabs { background: #f4f5f7; }
[data-theme="light"] .profile-tab { color: #6b7280; }
[data-theme="light"] .profile-tab:hover { color: #111827; }
[data-theme="light"] .profile-tab.active { background: #fff; color: #2563eb; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
[data-theme="light"] .profile-cover-fade { background: linear-gradient(to bottom, transparent 40%, rgba(244,245,247,0.85) 100%); }
[data-theme="light"] .profile-actions .btn-icon { background: #f4f5f7; border: 1px solid #e2e4e8; color: #374151; }
[data-theme="light"] .profile-actions .btn-icon:hover { background: #ecedf0; color: #111827; }
/* Navbar */
[data-theme="light"] .top-navbar { background: rgba(255,255,255,0.8); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .mobile-nav { background: rgba(255,255,255,0.8); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-top-color: rgba(0,0,0,0.06); }
/* Cards & sections */
[data-theme="light"] .settings-section { border-color: #e2e4e8; background: #fff; }
[data-theme="light"] .settings-section:hover { border-color: #d0d3da; }
[data-theme="light"] .suggest-card { border-color: #e2e4e8; background: #fff; }
[data-theme="light"] .suggest-card:hover { border-color: #d0d3da; box-shadow: 0 4px 16px rgba(0,0,0,.05); }
[data-theme="light"] .trending-tag { background: #f4f5f7; border-color: #e2e4e8; color: #2563eb; }
[data-theme="light"] .trending-tag:hover { border-color: #2563eb; background: rgba(37,99,235,.05); }
/* Explore filter pills */
[data-theme="light"] .disc-filter-pill { background: #f4f5f7; border-color: #e2e4e8; color: #374151; }
[data-theme="light"] .disc-filter-pill:hover { border-color: #2563eb; color: #2563eb; background: rgba(37,99,235,.04); }
[data-theme="light"] .disc-filter-pill.active { background: var(--gradient-accent); color: #fff; border-color: transparent; }
/* Carousel */
[data-theme="light"] .carousel-btn { background: rgba(255,255,255,.9); color: #111827; border-color: #e2e4e8; }
[data-theme="light"] .carousel-btn:hover { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
/* Modal */
[data-theme="light"] .modal-content { border-color: #e2e4e8; box-shadow: 0 16px 48px rgba(0,0,0,.12); }
/* Heatmap */
[data-theme="light"] .heatmap-cell { background: #ecedf0; }
[data-theme="light"] .heatmap-cell.h1 { background: rgba(37,99,235,0.15); }
[data-theme="light"] .heatmap-cell.h2 { background: rgba(37,99,235,0.3); }
[data-theme="light"] .heatmap-cell.h3 { background: rgba(37,99,235,0.5); }
[data-theme="light"] .heatmap-cell.h4 { background: #2563eb; }
/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
/* Navbar icons */
[data-theme="light"] .navbar-icon-btn { color: #6b7280; }
[data-theme="light"] .navbar-icon-btn:hover { background: #e8eaee; color: #111827; }
[data-theme="light"] .navbar-icon-btn.active { background: rgba(37,99,235,.07); color: #2563eb; }
/* Badges */
[data-theme="light"] .navbar-badge { box-shadow: 0 1px 3px rgba(220,38,38,.2); }
[data-theme="light"] .online-dot { border-color: #fff; box-shadow: 0 0 4px rgba(22,163,74,.3); }
/* Mobile nav */
[data-theme="light"] .mobile-nav a { color: #6b7280; }
[data-theme="light"] .mobile-nav a.active { color: #2563eb; filter: drop-shadow(0 0 3px rgba(37,99,235,.15)); }
[data-theme="light"] .mobile-nav a:hover { background: #e8eaee; }
[data-theme="light"] .mobile-nav a:active { background: #ecedf0; }
/* Avatars */
[data-theme="light"] a:hover > .avatar, [data-theme="light"] button:hover > .avatar { box-shadow: 0 0 0 2px #2563eb, 0 0 8px rgba(37,99,235,.1); }
/* Level badges */
[data-theme="light"] .lvl-starter { background: rgba(107,114,128,.08); color: #6b7280; }
[data-theme="light"] .lvl-bronze { background: rgba(217,119,6,.08); color: #b45309; }
[data-theme="light"] .lvl-silver { background: rgba(107,114,128,.08); color: #6b7280; }
[data-theme="light"] .lvl-gold { background: rgba(245,158,11,.1); color: #d97706; }
[data-theme="light"] .lvl-platinum { background: rgba(37,99,235,.08); color: #2563eb; }
[data-theme="light"] .lvl-diamond { background: rgba(22,163,74,.08); color: #15803d; }
[data-theme="light"] .lvl-master { background: rgba(109,40,217,.08); color: #6d28d9; }
[data-theme="light"] .lvl-legend { background: rgba(37,99,235,.1); color: #2563eb; }
/* Glow effects */
[data-theme="light"] .btn-primary:hover { box-shadow: 0 0 14px rgba(37,99,235,.15), 0 4px 12px rgba(37,99,235,.1) !important; }
[data-theme="light"] .btn-follow.not-following:hover { box-shadow: 0 0 12px rgba(37,99,235,.15), 0 4px 8px rgba(37,99,235,.08); }
[data-theme="light"] .btn-view-post:hover { box-shadow: 0 0 8px rgba(37,99,235,.1); }
/* Points/streak */
[data-theme="light"] .points-badge { color: #d97706; }
[data-theme="light"] .points-badge svg { stroke: #d97706; }
[data-theme="light"] .streak-badge { color: #ea580c; }
[data-theme="light"] .streak-badge svg { stroke: #ea580c; }
/* Misc consolidated */
[data-theme="light"] .pb-badge { background: rgba(245,158,11,.1); color: #d97706; }
[data-theme="light"] .goal-progress-fill { box-shadow: 0 0 6px rgba(37,99,235,.15); }
[data-theme="light"] .navbar-points { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.2); color: #d97706; }
[data-theme="light"] .navbar-points:hover { background: rgba(245,158,11,.14); }
[data-theme="light"] .navbar-points svg { stroke: #d97706; }
[data-theme="light"] .feed-nav-btn { border: 1px solid #e2e4e8; }
[data-theme="light"] .feed-nav-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); border-color: #d0d3da; }
[data-theme="light"] .post-username:hover { color: #2563eb; }
[data-theme="light"] .htag { color: #2563eb; }
[data-theme="light"] .view-comments { color: #2563eb; }
[data-theme="light"] .comment-submit { color: #2563eb; }
[data-theme="light"] .post-discipline { color: #2563eb; }
[data-theme="light"] .challenge-history-item { background: #fff; border-color: #e2e4e8; }
[data-theme="light"] .challenge-history-item:hover { border-color: #d0d3da; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
[data-theme="light"] .goal-card { background: #fff; border-color: #e2e4e8; }
[data-theme="light"] .goal-card:hover { border-color: #d0d3da; }
[data-theme="light"] .feed-user-bar { background: #fff; border-color: #e2e4e8; }
[data-theme="light"] .feed-user-bar:hover { border-color: #d0d3da; }
/* Light theme feed nav */
[data-theme="light"] .feed-nav-btn { border: 1px solid rgba(0,0,0,.06); }
[data-theme="light"] .feed-nav-btn:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
[data-theme="light"] .profile-cover-wrap .profile-stats { background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); }
[data-theme="light"] .profile-cover-wrap .profile-badge-card { background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); }
[data-theme="light"] .profile-cover-wrap .profile-club { background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); border-color: rgba(255,255,255,0.5); }
[data-theme="light"] .profile-cover-wrap .profile-actions .btn-follow { background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); border-color: rgba(0,0,0,.15); color: #1a1a2e; }
[data-theme="light"] .profile-cover-wrap .profile-actions .btn-follow.following { background: var(--accent); color: #fff; }
/* Search/challenge popup light theme */
[data-theme="light"] .ev-compare-overlay > div, [data-theme="light"] .scatt-viewer-overlay > div { background: #fff; color: var(--text-main); }
[data-theme="light"] #profChallengeOverlay > div { background: #fff !important; color: var(--text-main); box-shadow: 0 16px 48px rgba(0,0,0,.15) !important; }

/* ═══ THEME TOGGLE ═══ */
.theme-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
}
.theme-toggle-btn {
    position: relative; width: 56px; height: 28px;
    border-radius: 14px;
    background: var(--element-bg);
    border: 1px solid var(--border);
    cursor: pointer; padding: 0;
    display: flex; align-items: center;
    transition: background .3s;
    outline: none;
}
.theme-toggle-btn .theme-icon-sun,
.theme-toggle-btn .theme-icon-moon {
    position: absolute; font-size: 13px;
    transition: opacity .2s;
}
.theme-toggle-btn .theme-icon-sun { left: 6px; opacity: 0; }
.theme-toggle-btn .theme-icon-moon { right: 6px; opacity: 1; }
[data-theme="light"] .theme-toggle-btn .theme-icon-sun { opacity: 1; }
[data-theme="light"] .theme-toggle-btn .theme-icon-moon { opacity: 0; }
.theme-toggle-knob {
    width: 22px; height: 22px;
    background: var(--accent);
    border-radius: 50%; margin-left: 3px;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    flex-shrink: 0;
}
[data-theme="light"] .theme-toggle-knob { transform: translateX(28px); }

/* ═══ MESSAGE ATTACHMENTS ═══ */
.chat-attach-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; min-width: 36px; flex-shrink: 0;
    cursor: pointer; color: var(--text-muted);
    background: var(--element-bg); border: 1px solid var(--border);
    border-radius: 50%;
    transition: all .2s;
}
.chat-attach-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--primary-bg); }
.chat-attach-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.chat-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.msg-img { max-width: 220px; border-radius: 8px; display: block; margin-top: 4px; cursor: pointer; }
.msg-file {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 6px;
    background: rgba(255,255,255,.1); font-size: 11px;
    color: inherit; margin-top: 4px;
    border: 1px solid rgba(255,255,255,.2);
}
.msg-sent .msg-file { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.25); }
.msg-received .msg-file { background: var(--element-bg); border-color: var(--border); }
.msg-attach-preview {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--accent);
    background: rgba(59,130,246,.08);
    border-radius: 6px; padding: 3px 8px;
}

/* ═══ PROFILE LEVEL CARD ═══ */
.profile-level-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 16px; margin-bottom: 20px;
}
.profile-level-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 10px;
}
.profile-level-title { font-weight: 700; font-size: 15px; }
.profile-level-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.profile-level-next { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-align: right; }

/* ═══ SHOOTING PERFORMANCE ═══ */
.perf-section { margin: 16px 0 20px; }
.perf-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
    font-size: 16px; font-weight: 700; color: var(--text-primary);
}
.perf-header svg { width: 18px; height: 18px; stroke: var(--accent); }
/* ═══ SHOOTING PERFORMANCE TAB ═══ */
.perf-stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px; margin-bottom: 14px;
}
.perf-stat-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 12px; text-align: center; transition: border-color .2s, box-shadow .2s;
}
.perf-stat-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,102,204,0.08); }
.perf-stat-value { font-size: 22px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: var(--text-primary); animation: perfCountUp 0.4s ease-out; }
.perf-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.perf-stat-accent .perf-stat-value { color: var(--accent); }
.perf-stat-gold .perf-stat-value { color: #f59e0b; }
.perf-chart-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 16px; transition: border-color .2s;
}
.perf-chart-card:hover { border-color: color-mix(in srgb, var(--border) 50%, var(--accent) 50%); }
.perf-chart-title {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.perf-chart-sub { font-weight: 400; color: var(--text-muted); font-size: 11px; }
#perfChart, .perf-chart-canvas { width: 100%; height: 200px; display: block; }
.perf-history-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 16px;
}
.perf-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.perf-table {
    width: 100%; border-collapse: collapse; font-size: 12px;
    font-family: 'Space Grotesk', sans-serif;
}
.perf-table th {
    text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-muted); padding: 8px 10px; border-bottom: 2px solid var(--border);
    position: sticky; top: 0; background: var(--card-bg); z-index: 1;
}
.perf-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.perf-row-link { cursor: pointer; transition: background .12s, transform .1s; }
.perf-row-link:hover { background: var(--element-bg); }
.perf-row-link:active { transform: scale(0.995); }
.perf-row-arrow { display: inline-flex; margin-left: 4px; opacity: 0; transition: opacity .12s; }
.perf-row-arrow svg { width: 11px; height: 11px; stroke: var(--accent); stroke-width: 2; fill: none; }
.perf-row-link:hover .perf-row-arrow { opacity: 1; }
.perf-td-dim { color: var(--text-muted); font-size: 11px; }
.perf-grid { gap: 12px; }
.perf-grid > * { margin-bottom: 0; }
/* Discipline filter pills */
.perf-disc-btn { border-radius: 20px !important; padding: 4px 14px !important; transition: all .15s; }
.perf-disc-btn.btn-primary { box-shadow: 0 2px 6px rgba(0,102,204,0.2); }
/* Range filter pills */
.perf-range-btn { border-radius: 20px !important; padding: 3px 12px !important; font-size: 11px !important; }
/* Sparklines */
.perf-sparkline { display: block; margin-top: 4px; width: 100%; height: 28px; opacity: 0.5; }
@media (max-width: 600px) {
    .perf-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .perf-chart-card { padding: 12px; }
    .perf-stat-card { padding: 10px 8px; }
    .perf-stat-value { font-size: 18px; }
    #perfChart { height: 180px; }
}

/* ═══ ATHLETE BADGE ═══ */
.badge-athlete {
    display: inline-flex; font-size: 9px;
    color: #f97316;
    background: rgba(255,107,53,.1);
    padding: 2px 6px; border-radius: 6px;
    font-weight: 600; border: 1px solid rgba(255,107,53,.25);
}
.badge-athlete-verified {
    display: inline-flex; align-items: center;
    color: var(--accent); vertical-align: middle;
    margin-left: 4px;
    filter: drop-shadow(0 0 3px rgba(59,130,246,0.4));
}
.badge-athlete-verified svg {
    width: 16px; height: 16px;
    stroke: var(--accent); stroke-width: 2.5;
    fill: none;
}

/* ═══ COMMUNITY GUIDELINES ═══ */
.guidelines-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 24px;
}
.guidelines-intro { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.6; }
.guidelines-list { display: flex; flex-direction: column; gap: 0; }
.guideline-item {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.guideline-item:last-child { border-bottom: none; }
.guideline-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.guideline-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.guideline-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.guideline-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.guideline-section:last-child { border-bottom: none; }
.guideline-section-title { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.guideline-sub { font-size: 12px; font-weight: 600; color: var(--text-primary); margin: 10px 0 4px; }
.guideline-text { font-size: 12px; color: var(--text-dim); line-height: 1.6; margin-bottom: 4px; }
.guideline-text.guideline-warn { color: var(--accent-red, #e74c3c); font-weight: 600; margin-top: 8px; }
.guideline-list { list-style: none; padding: 0; margin: 4px 0; }
.guideline-list li { font-size: 12px; color: var(--text-dim); line-height: 1.6; padding-left: 16px; position: relative; }
.guideline-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.guidelines-footer {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted); line-height: 1.5;
}

/* ═══ SETTINGS (additional) ═══ */
.settings-section .btn { min-width: 100px; }
.settings-toggle-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.toggle-switch {
    position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--border); border-radius: 24px;
    cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
    content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
    background: var(--text-primary); border-radius: 50%; transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ═══ SHARE PROFILE BUTTON ═══ */
.btn-follow svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; vertical-align: middle; margin-right: 2px; }

/* ═══ PRIVATE POSTS ═══ */
.post-card.post-private { border-color: var(--accent-yellow); opacity: .85; }
.post-private-badge {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 9px; color: var(--accent-yellow);
    font-weight: 600;
}
.post-private-badge svg { width: 9px; height: 9px; stroke: var(--accent-yellow); fill: none; stroke-width: 2; }

/* ═══ LANDSCAPE LOCK (mobile only) ═══ */
.landscape-block {
    display: none;
    position: fixed; inset: 0;
    background: var(--bg-main);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--text-main);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}
.landscape-block svg { width: 40px; height: 40px; stroke: var(--accent); }
.landscape-block p { font-size: 13px; color: var(--text-muted); text-align: center; max-width: 240px; }
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
    .landscape-block { display: flex; }
}

/* ═══ SKELETON LOADING STATES ═══ */
@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}
.skeleton-card {
    background: var(--bg-panel);
    border-radius: var(--r, 12px);
    margin-bottom: 12px;
    padding: 14px;
    animation: skeleton-pulse 1.2s ease-in-out infinite;
}
.skeleton-card::before {
    content: '';
    display: block;
    height: 12px;
    width: 40%;
    background: var(--element-bg);
    border-radius: 6px;
    margin-bottom: 10px;
}
.skeleton-card::after {
    content: '';
    display: block;
    height: 180px;
    background: var(--element-bg);
    border-radius: 8px;
}
.feed-skeleton { padding: 0 4px; }

/* ═══ MOBILE TOUCH & RESPONSIVE IMPROVEMENTS ═══ */
/* Larger touch targets on mobile */
@media (pointer: coarse) {
    .btn, .btn-follow, .feed-nav-btn, button {
        min-height: 44px;
    }
    .trending-tag {
        padding: 8px 14px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }
    .suggest-card .btn-follow {
        min-height: 36px;
        padding: 6px 16px;
    }
}
/* Challenge cards responsive */
@media (max-width: 380px) {
    .feed-nav { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═══ STREAK & LEVEL BAR ═══ */
.feed-user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
}
.feed-user-bar .level-progress {
    flex: 1;
    height: 6px;
    background: var(--element-bg);
    border-radius: 3px;
    overflow: hidden;
}
.feed-user-bar .level-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ═══ CHALLENGE HISTORY CARDS ═══ */
.challenge-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.challenge-history-item .ch-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    background: var(--element-bg);
    color: var(--text-muted);
}
.challenge-history-item .ch-rank.gold { background: rgba(240,180,41,0.2); color: #f0b429; }

/* ═══ DUEL STATS CARD ═══ */
.duel-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.duel-stat-box {
    text-align: center;
    padding: 10px 6px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.duel-stat-box .ds-value {
    font-size: 20px;
    font-weight: 800;
    font-family: 'Space Grotesk', monospace;
    line-height: 1;
}
.duel-stat-box .ds-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 4px;
}
@media (max-width: 380px) {
    .duel-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ PULL TO REFRESH ═══ */
.ptr-indicator {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%) translateY(-50px);
    z-index: 99990; width: 36px; height: 36px;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: transform 0.2s ease;
    pointer-events: none;
}
.ptr-indicator.pulling { transform: translateX(-50%) translateY(20px); }
.ptr-indicator.refreshing { transform: translateX(-50%) translateY(20px); }
.ptr-indicator svg { width: 18px; height: 18px; stroke: var(--accent); transition: transform 0.2s; }
.ptr-indicator.pulling svg { transform: rotate(180deg); }
.ptr-indicator.refreshing svg { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ═══ TOAST NOTIFICATIONS ═══ */
.toast-container {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    z-index: 99995; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none; max-width: 420px; width: calc(100% - 32px);
}
.toast-msg {
    padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3); pointer-events: auto;
    animation: toast-in 0.3s ease; transition: opacity 0.3s, transform 0.3s;
}
.toast-msg.toast-error { background: var(--accent-red, #e74c3c); color: #fff; }
.toast-msg.toast-success { background: var(--accent-green, #4ebd35); color: #fff; }
.toast-msg.toast-info { background: var(--accent, #0078d7); color: #fff; }
.toast-msg.toast-warn { background: var(--accent-yellow, #f0b429); color: #1a1a1a; }
.toast-msg .toast-close { background: none; border: none; color: inherit; font-size: 18px; cursor: pointer; padding: 0 4px; opacity: 0.7; margin-left: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ═══ ANIMATED SCORE COUNTER ═══ */
.score-counter { font-family: 'Space Grotesk', monospace; font-weight: 800; }
.score-counter.animating { transition: none; }

/* ═══ ONBOARDING OVERLAY ═══ */
.onboarding-overlay {
    position: fixed; inset: 0; z-index: 99997; background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.onboarding-card {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: 20px;
    padding: 32px 28px; max-width: 380px; width: 100%; text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.onboarding-card h2 { font-size: 20px; margin: 0 0 8px; }
.onboarding-card p { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; line-height: 1.6; }
.onboarding-steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.onboarding-step { width: 8px; height: 8px; border-radius: 50%; background: var(--element-bg); }
.onboarding-step.active { background: var(--accent); width: 20px; border-radius: 4px; }
.onboarding-card .btn { width: 100%; margin-top: 8px; }

/* ═══ DISCIPLINE FILTER PILLS ═══ */
.disc-filter-row {
    display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.disc-filter-row::-webkit-scrollbar { display: none; }
.disc-filter-pill {
    flex-shrink: 0; padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 600;
    background: var(--element-bg); color: var(--text-dim); border: 1px solid var(--border);
    cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.disc-filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.disc-filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══ PB BADGE ═══ */
.pb-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--accent-yellow, #f0b429); background: rgba(240,180,41,0.12);
    padding: 2px 8px; border-radius: 4px;
}

/* ═══ TRAINING HEATMAP ═══ */
.training-heatmap {
    display: grid; grid-template-columns: repeat(53, 1fr); gap: 2px;
    direction: ltr;
}
.heatmap-cell {
    aspect-ratio: 1; border-radius: 2px; background: var(--element-bg);
    min-width: 0;
}
.heatmap-cell.h1 { background: rgba(59,130,246,0.25); }
.heatmap-cell.h2 { background: rgba(59,130,246,0.5); }
.heatmap-cell.h3 { background: rgba(59,130,246,0.75); }
.heatmap-cell.h4 { background: var(--accent); }
.heatmap-months { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-muted); padding: 0 2px; margin-top: 4px; }

/* ═══ GOAL PROGRESS ═══ */
.goal-card {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 12px;
}
.goal-progress-bar {
    height: 8px; background: var(--element-bg); border-radius: 4px; overflow: hidden; margin-top: 8px;
}
.goal-progress-fill {
    height: 100%; border-radius: 4px; transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--accent), var(--accent-purple, #7c6ef0));
    box-shadow: 0 0 8px rgba(59,130,246,.3);
}

/* ═══ UNIVERSAL HOVER SYSTEM — every clickable element gets a highlight ═══ */

/* Shared transition for all interactive elements */
.post-card, .suggest-card, .profile-badge-card, .settings-section,
.challenge-history-item, .goal-card, .feed-user-bar, .trending-tag,
.disc-filter-pill, .btn-view-post, .btn-follow, .btn-outline-secondary,
.form-control, .form-select, .search-box, .comment-input, .profile-club,
.comment, .lb-row, .conv-item, .notif-item, .mc-info-pill, .mc-react-btn,
.ach-card, .ev-entry, .nav-badge, .post-type-pill, .lvl-badge,
.feed-nav-btn, .duel-stat-box, .admin-card, .tab {
    transition: border-color .2s, box-shadow .2s, background .2s, color .2s, transform .2s;
}

/* ── Row/list items: subtle background highlight ── */
.comment:hover { background: var(--element-bg); border-radius: var(--rs); margin: -2px -4px; padding: 2px 4px; }
.lb-row:hover { background: var(--element-bg); }
.conv-item:hover { background: var(--element-bg); }
.notif-item:hover { background: var(--element-bg); }
.ev-entry:hover { background: var(--element-bg); }

/* ── Card elements: border + lift ── */
.suggest-card:hover { border-color: rgba(59,130,246,.2); }
.profile-badge-card:hover { border-color: rgba(59,130,246,.2); }
.challenge-history-item:hover { border-color: rgba(59,130,246,.2); transform: translateY(-1px); }
.goal-card:hover { border-color: rgba(59,130,246,.2); }
.feed-user-bar:hover { border-color: rgba(59,130,246,.15); }
.profile-club:hover { border-color: rgba(59,130,246,.2); }
.duel-stat-box:hover { border-color: rgba(59,130,246,.15); transform: translateY(-1px); }
.ach-card:hover { border-color: rgba(59,130,246,.2); transform: translateY(-1px); }
.admin-card:hover { border-color: var(--border-light); }

/* ── Tags/pills: accent tint ── */
.trending-tag:hover { border-color: var(--accent); color: var(--accent); }
.disc-filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.mc-info-pill:hover { border-color: var(--border-light); color: var(--text-main); }
.post-type-pill:hover { transform: scale(1.05); }
.lvl-badge:hover { transform: scale(1.05); }
.nav-badge:hover { transform: scale(1.1); }

/* ── Nav items: background tint ── */
.feed-nav-btn:hover { border-color: var(--border-light); }

/* ── Link-style hover: all text links ── */
.post-username:hover, .comment-username:hover, .suggest-name:hover,
.post-discipline:hover, .htag:hover, .view-comments:hover { color: var(--accent); }

/* ── Light theme: every hover visible on white ── */
[data-theme="light"] .comment:hover { background: #f4f5f7; }
[data-theme="light"] .lb-row:hover { background: #f4f5f7; }
[data-theme="light"] .conv-item:hover { background: #f4f5f7; }
[data-theme="light"] .notif-item:hover { background: #f4f5f7; }
[data-theme="light"] .ev-entry:hover { background: #f4f5f7; }
[data-theme="light"] .suggest-card:hover { border-color: #d0d3da; }
[data-theme="light"] .profile-badge-card:hover { border-color: #d0d3da; }
[data-theme="light"] .challenge-history-item:hover { border-color: #d0d3da; }
[data-theme="light"] .goal-card:hover { border-color: #d0d3da; }
[data-theme="light"] .feed-user-bar:hover { border-color: #d0d3da; }
[data-theme="light"] .duel-stat-box:hover { border-color: #d0d3da; }
[data-theme="light"] .ach-card:hover { border-color: #d0d3da; }
[data-theme="light"] .feed-nav-btn:hover { border-color: #d0d3da; }
[data-theme="light"] .disc-filter-pill:hover { background: rgba(37,99,235,.04); }
[data-theme="light"] .trending-tag:hover { background: rgba(37,99,235,.04); }
[data-theme="light"] .mc-info-pill:hover { background: #e8eaee; }

/* ═══ GLOW & HOVER ENHANCEMENTS ═══ */

/* Notification badge pulse */
.nav-badge, .navbar-badge {
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.3); }
    50% { box-shadow: 0 0 8px 2px rgba(239,68,68,.2); }
}

/* Disc filter pill active glow */
.disc-filter-pill.active {
    box-shadow: 0 0 12px rgba(59,130,246,.2);
}
.disc-filter-pill:hover { transform: translateY(-1px); }

/* Feed nav button glow on hover */
.feed-nav-btn:hover {
    box-shadow: 0 0 20px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.1);
}

/* Challenge cards glow (SOTD/KOTW/Weekly) */
.challenge-history-item {
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.challenge-history-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

/* Level badge legend glow */
.lvl-legend {
    animation: legendGlow 2.5s ease-in-out infinite;
}

/* PB badge glow */
.pb-badge {
    box-shadow: 0 0 8px rgba(234,179,8,.2);
    animation: pbGlow 2s ease-in-out infinite;
}
@keyframes pbGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(234,179,8,.2); }
    50% { box-shadow: 0 0 14px rgba(234,179,8,.35); }
}

/* Heatmap cells glow on hover */
.heatmap-cell.h3:hover, .heatmap-cell.h4:hover {
    box-shadow: 0 0 6px rgba(59,130,246,.4);
    transform: scale(1.5);
    z-index: 1;
    position: relative;
}
.heatmap-cell { transition: transform .15s, box-shadow .15s; }

/* Goal progress bar animated shimmer */
@keyframes goalShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.goal-progress-fill {
    background-size: 200% 100%;
    animation: goalShimmer 3s ease infinite;
}

/* Settings section hover lift */
.settings-section {
    transition: border-color .2s, box-shadow .2s;
}
.settings-section:hover {
    border-color: var(--border-light);
}

/* Carousel buttons glow */
.carousel-btn:hover {
    background: rgba(0,0,0,.6);
    box-shadow: 0 0 12px rgba(0,0,0,.3);
}

/* Tab active glow */
.tab.active {
    box-shadow: 0 1px 3px rgba(0,0,0,.15), 0 0 8px rgba(59,130,246,.06);
}

/* Toast glow by type */
.toast-msg.toast-error { box-shadow: 0 4px 20px rgba(239,68,68,.2); }
.toast-msg.toast-success { box-shadow: 0 4px 20px rgba(34,197,94,.2); }
.toast-msg.toast-info { box-shadow: 0 4px 20px rgba(59,130,246,.2); }

/* Post username hover glow */
.post-username:hover { text-shadow: 0 0 12px rgba(59,130,246,.2); }

/* Streak badge glow */
.streak-badge { filter: drop-shadow(0 0 4px rgba(255,107,53,.3)); }

/* Points badge glow */
.points-badge { filter: drop-shadow(0 0 4px rgba(234,179,8,.3)); }

/* Modal open glow */
.modal.show .modal-content {
    box-shadow: 0 16px 48px rgba(0,0,0,.4), 0 0 0 1px var(--border);
}

/* Verified badge glow */
.badge-athlete-verified svg {
    filter: drop-shadow(0 0 4px rgba(59,130,246,.3));
}

/* Accent link hover glow */
a.post-discipline:hover { text-shadow: 0 0 8px rgba(59,130,246,.2); }

/* Share button wiggle on hover */
.btn-icon[onclick*="share"]:hover { animation: wiggle .4s ease; }
@keyframes wiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(8deg)} 75%{transform:rotate(-8deg)} }

/* Like count bounce on update */
.like-count { display: inline-block; transition: transform .15s ease; }
.like-count.bouncing { animation: countBounce .3s ease; }
@keyframes countBounce { 0%{transform:scale(1)} 40%{transform:scale(1.3)} 100%{transform:scale(1)} }

/* Comment icon hover */
.btn-icon[onclick*="Comment"]:hover svg,
.post-actions .btn-icon:nth-child(2):hover svg { transform: scale(1.15) rotate(-5deg); }

/* Post header username subtle underline on hover */
.post-username { position: relative; }
.post-username::after {
    content: ''; position: absolute; bottom: -1px; left: 0; width: 0; height: 1px;
    background: var(--accent); transition: width .2s ease;
}
.post-username:hover::after { width: 100%; }

/* Carousel dots active glow */
.carousel-dot.active { box-shadow: 0 0 6px currentColor; }

/* Post type pill hover */
.post-type-pill { transition: transform .15s ease; }
.post-type-pill:hover { transform: scale(1.05); }

/* Stats number hover effect */
.stat-number { transition: color .2s; }
.profile-stats > a:hover .stat-number { color: var(--accent); }

/* Focus ring for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth page transition feel */
.content-area { animation: fadeIn .2s ease; }

/* Interactive table rows */
.table tbody tr { transition: background .15s; }

/* Settings section expand hover */
@media (min-width: 769px) {
    .settings-section:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
}

/* ═══ VISUAL 7: DEPTH LAYERS ═══ */
/* Sunken: inputs, search, comment input */
.form-control, .form-select { background: var(--depth-sunken) !important; }
.comment-input { background: var(--depth-sunken); }
.search-box { background: var(--depth-sunken); }
/* Flat: content areas, post bodies — default, no extra rule needed */
/* Raised: cards, modals, dropdowns, tooltips */
.settings-section,
.suggest-card,
.profile-badge-card,
.challenge-history-item,
.goal-card,
.mc-h2h,
.mc-side,
.duel-stat-box { background: var(--depth-raised); }
.modal-content { background: var(--bg-panel); box-shadow: var(--shadow-lg), 0 0 0 1px var(--border); }
.dropdown-menu { box-shadow: var(--shadow-lg); }

/* ═══ VISUAL 8: ICONS — keep stroke style, just color change on active ═══ */

/* ═══ VISUAL 9: CONSISTENT CARD ANATOMY ═══ */
/* All card-like containers follow: consistent padding, radius, border pattern */
.settings-section,
.challenge-history-item,
.goal-card,
.mc-h2h,
.feed-user-bar,
.onboarding-card {
    border: 1px solid var(--border);
    border-radius: var(--rl);
    transition: border-color .25s, box-shadow .25s;
}
/* Hover lift for all interactive cards */
.settings-section:hover,
.challenge-history-item:hover,
.goal-card:hover,
.mc-h2h:hover,
.suggest-card:hover {
    border-color: var(--border-light);
}

/* ═══ VISUAL 10: PAGE SLIDE TRANSITIONS ═══ */
@keyframes pageSlideIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pageFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.content-area { animation: pageFadeUp .25s ease both; }
/* Explore page */
.content-area:has(.explore-layout) { animation: pageFadeUp .3s ease both; }
/* Profile gets fade up */
.content-area:has(.profile-header) { animation: pageFadeUp .3s ease both; }

/* ═══ VISUAL 11: STAGGERED LIST ANIMATIONS ═══ */
@keyframes staggerFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.challenge-history-item { animation: staggerFadeIn .3s ease both; }
.challenge-history-item:nth-child(1) { animation-delay: 0s; }
.challenge-history-item:nth-child(2) { animation-delay: .05s; }
.challenge-history-item:nth-child(3) { animation-delay: .1s; }
.challenge-history-item:nth-child(4) { animation-delay: .15s; }
.suggest-card { animation: staggerFadeIn .3s ease both; }
.suggest-card:nth-child(1) { animation-delay: 0s; }
.suggest-card:nth-child(2) { animation-delay: .04s; }
.suggest-card:nth-child(3) { animation-delay: .08s; }
.suggest-card:nth-child(4) { animation-delay: .12s; }
.suggest-card:nth-child(5) { animation-delay: .16s; }
/* Duel stat boxes */
.duel-stat-box { animation: staggerFadeIn .3s ease both; }
.duel-stat-box:nth-child(1) { animation-delay: 0s; }
.duel-stat-box:nth-child(2) { animation-delay: .05s; }
.duel-stat-box:nth-child(3) { animation-delay: .1s; }
.duel-stat-box:nth-child(4) { animation-delay: .15s; }
/* Leaderboard rows */
.lb-row { animation: staggerFadeIn .25s ease both; }
.lb-row:nth-child(1) { animation-delay: 0s; }
.lb-row:nth-child(2) { animation-delay: .03s; }
.lb-row:nth-child(3) { animation-delay: .06s; }
.lb-row:nth-child(4) { animation-delay: .09s; }
.lb-row:nth-child(5) { animation-delay: .12s; }
/* Sidebar nav links */
.sidebar .nav-link-mesh { animation: staggerFadeIn .2s ease both; }
.sidebar .nav-link-mesh:nth-child(1) { animation-delay: .02s; }
.sidebar .nav-link-mesh:nth-child(2) { animation-delay: .04s; }
.sidebar .nav-link-mesh:nth-child(3) { animation-delay: .06s; }
.sidebar .nav-link-mesh:nth-child(4) { animation-delay: .08s; }
.sidebar .nav-link-mesh:nth-child(5) { animation-delay: .1s; }
.sidebar .nav-link-mesh:nth-child(6) { animation-delay: .12s; }

/* ═══ VISUAL 13: TABULAR NUMS ═══ */
.stat-number,
.mc-score,
.score-counter,
.like-count,
.trending-count,
.ds-value,
.ev-score,
.lb-score,
.navbar-points,
.points-badge,
.streak-badge,
.nav-badge,
.navbar-badge {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ═══ GRADIENT ACCENT — ACTIVE STATES ═══ */
/* Active tab gradient underline */
.profile-tab.active { background: var(--bg-panel); position: relative; }
.profile-tab.active::after {
    content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
    height: 2px; background: var(--gradient-accent); border-radius: 1px;
}
/* Active sidebar link gradient bar */
.sidebar .nav-link-mesh.active::before {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; background: var(--gradient-accent); border-radius: 0 2px 2px 0;
}
/* Score bar gradients */
.mc-score-bar-left { background: var(--gradient-accent) !important; }
/* Goal/level progress gradient */
.level-progress-fill { background: var(--gradient-accent) !important; }
/* Feed streak bar */
.feed-user-bar .level-progress-fill { background: var(--gradient-accent) !important; }

/* ═══ EMOJI PICKER ═══ */
.emoji-trigger {
    background: none; border: none; cursor: pointer; font-size: 16px;
    padding: 4px; opacity: 0.5; transition: opacity .2s;
}
.emoji-trigger:hover { opacity: 1; }
.emoji-popup {
    position: absolute; bottom: 100%; left: 0; z-index: 50;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r);
    padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
    box-shadow: var(--shadow-lg); animation: scaleIn .15s ease;
    min-width: 200px;
}
.emoji-item {
    font-size: 18px; padding: 4px; border-radius: 6px; cursor: pointer;
    text-align: center; transition: background .1s;
}
.emoji-item:hover { background: var(--element-bg); transform: scale(1.2); }

/* ═══ DAILY STREAK REWARD POPUP ═══ */
.streak-reward-popup {
    position: fixed; inset: 0; z-index: 99998;
    background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .3s; pointer-events: none;
}
.streak-reward-popup.show { opacity: 1; pointer-events: auto; }
.streak-reward-card {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: 20px;
    padding: 32px; text-align: center; max-width: 280px; width: 90%;
    transform: scale(0.8); transition: transform .3s cubic-bezier(.2,.8,.3,1);
    box-shadow: var(--shadow-lg);
}
.streak-reward-popup.show .streak-reward-card { transform: scale(1); }
.streak-reward-icon { font-size: 48px; margin-bottom: 8px; animation: pulse 1s ease infinite; }
.streak-reward-count {
    font-size: 48px; font-weight: 900; font-family: 'Space Grotesk', sans-serif;
    background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.streak-reward-label { font-size: 16px; font-weight: 700; margin-top: 4px; }
.streak-reward-sub { font-size: 12px; color: var(--text-muted); margin: 8px 0 16px; }
.streak-reward-card button {
    background: var(--gradient-accent); color: #fff; border: none;
    padding: 10px 32px; border-radius: 10px; font-size: 14px; font-weight: 700;
    cursor: pointer; font-family: inherit;
}

/* ═══ ACHIEVEMENT UNLOCK ANIMATION ═══ */
.ach-unlock-overlay {
    position: fixed; inset: 0; z-index: 99997;
    background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .3s; pointer-events: none;
}
.ach-unlock-overlay.show { opacity: 1; pointer-events: auto; }
.ach-unlock-card {
    text-align: center; padding: 32px; max-width: 300px;
    transform: scale(0.5) rotate(-10deg);
    transition: transform .5s cubic-bezier(.2,1,.3,1);
}
.ach-unlock-overlay.show .ach-unlock-card { transform: scale(1) rotate(0); }
.ach-unlock-icon { font-size: 64px; margin-bottom: 12px; filter: drop-shadow(0 0 20px rgba(234,179,8,.4)); }
.ach-unlock-title { font-size: 20px; font-weight: 800; color: var(--accent-yellow); }
.ach-unlock-name { font-size: 14px; color: var(--text-main); margin-top: 8px; font-weight: 600; }

/* ═══ NEW POSTS FLOATING PILL ═══ */
.new-posts-pill {
    position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-20px);
    z-index: 200; background: var(--gradient-accent); color: #fff;
    padding: 8px 20px; border-radius: 20px; font-size: 12px; font-weight: 700;
    cursor: pointer; opacity: 0; transition: opacity .3s, transform .3s;
    box-shadow: 0 4px 16px rgba(59,130,246,.3);
}
.new-posts-pill.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.new-posts-pill:hover { box-shadow: 0 4px 20px rgba(59,130,246,.4); }

/* ═══ READ RECEIPTS ═══ */
.msg-seen { font-size: 9px; color: var(--accent); opacity: .7; margin-left: 4px; }
.msg-seen svg { width: 10px; height: 10px; stroke: var(--accent); }

/* ═══ TYPING INDICATOR ═══ */
.typing-indicator {
    display: inline-flex; gap: 3px; padding: 8px 12px; background: var(--element-bg);
    border-radius: var(--r); align-items: center;
}
.typing-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-4px)} }

/* ═══ COMMENT REPLY THREADING ═══ */
.comment-reply { margin-left: 32px; padding-left: 12px; border-left: 2px solid var(--border); }
.comment-reply-btn {
    background: none; border: none; color: var(--text-muted); font-size: 9px;
    cursor: pointer; padding: 0; font-weight: 600; transition: color .15s;
}
.comment-reply-btn:hover { color: var(--accent); }

/* ═══ PIN POST BADGE ═══ */
.pin-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9px; color: var(--accent); font-weight: 600;
}
.pin-badge svg { width: 10px; height: 10px; stroke: var(--accent); }

/* ═══ PUBLISH SUCCESS OVERLAY ═══ */
.publish-success-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .3s; pointer-events: none;
}
.publish-success-overlay.show { opacity: 1; pointer-events: auto; }
.publish-success-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--gradient-accent); color: #fff;
    font-size: 36px; font-weight: 900; display: flex; align-items: center; justify-content: center;
    transform: scale(0); transition: transform .4s cubic-bezier(.2,1,.3,1);
    box-shadow: 0 0 40px rgba(59,130,246,.4);
}
.publish-success-overlay.show .publish-success-icon { transform: scale(1); }

/* ═══ SKELETON SCREENS ═══ */
.skeleton-profile { padding: 20px; }
.skeleton-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--element-bg); margin: 0 auto 16px; animation: skeleton-pulse 1.2s ease-in-out infinite; }
.skeleton-line { height: 12px; background: var(--element-bg); border-radius: 6px; margin-bottom: 8px; animation: skeleton-pulse 1.2s ease-in-out infinite; }
.skeleton-line.w60 { width: 60%; margin: 0 auto 8px; }
.skeleton-line.w40 { width: 40%; margin: 0 auto 8px; }
.skeleton-line.w80 { width: 80%; }
.skeleton-stats { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.skeleton-stat { width: 60px; height: 40px; background: var(--element-bg); border-radius: 8px; animation: skeleton-pulse 1.2s ease-in-out infinite; }

/* ═══ CONTEXTUAL EMPTY STATES ═══ */
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.empty-state-feed .empty-state-icon::before { content: '📱'; }
.empty-state-duels .empty-state-icon::before { content: '⚔️'; }
.empty-state-messages .empty-state-icon::before { content: '💬'; }
.empty-state-groups .empty-state-icon::before { content: '👥'; }
.empty-state-explore .empty-state-icon::before { content: '🔍'; }

/* ═══ LOADING SPINNER ═══ */
.spinner {
    width: 20px; height: 20px; border: 2px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: ptr-spin 0.6s linear infinite; display: inline-block;
}
.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.spinner-lg { width: 28px; height: 28px; border-width: 2.5px; }
.loading-center { display: flex; justify-content: center; padding: 20px; }

/* ═══ 3. IMAGE LIGHTBOX ═══ */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 999999;
    background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .25s;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-img {
    max-width: 90vw; max-height: 85vh; object-fit: contain;
    border-radius: 4px; user-select: none;
    transform: scale(0.95); transition: transform .25s;
}
.lightbox-overlay.open .lightbox-img { transform: scale(1); }
.lightbox-close {
    position: absolute; top: 16px; right: 20px; font-size: 32px; color: #fff;
    cursor: pointer; opacity: .6; transition: opacity .2s; z-index: 5; line-height: 1;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev, .lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 36px; color: #fff; cursor: pointer; opacity: .5;
    transition: opacity .2s; z-index: 5; padding: 12px; user-select: none;
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-counter {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,.5); font-size: 12px; font-weight: 600;
}
@media (max-width: 600px) {
    .lightbox-prev, .lightbox-next { font-size: 28px; padding: 8px; }
    .lightbox-close { top: 10px; right: 14px; font-size: 28px; }
}

/* ═══ 17. CUSTOM CHAT SCROLLBAR ═══ */
.chat-messages, .grp-chat-messages, .msg-list-pane {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.chat-messages::-webkit-scrollbar, .grp-chat-messages::-webkit-scrollbar, .msg-list-pane::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-track, .grp-chat-messages::-webkit-scrollbar-track, .msg-list-pane::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb, .grp-chat-messages::-webkit-scrollbar-thumb, .msg-list-pane::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.08); border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover, .grp-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.15);
}
[data-theme="light"] .chat-messages, [data-theme="light"] .grp-chat-messages, [data-theme="light"] .msg-list-pane {
    scrollbar-color: rgba(0,0,0,.1) transparent;
}
[data-theme="light"] .chat-messages::-webkit-scrollbar-thumb, [data-theme="light"] .grp-chat-messages::-webkit-scrollbar-thumb, [data-theme="light"] .msg-list-pane::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.08);
}

/* ═══ 19. PROFILE ACTIVITY GRAPH ═══ */
.activity-graph-wrap {
    padding: 12px 14px; background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: var(--rl); margin-bottom: 12px;
}
.activity-graph-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.activity-graph-header span { font-size: 11px; font-weight: 700; }
.activity-graph-header small { font-size: 10px; color: var(--text-muted); }
.activity-graph canvas { width: 100%; height: 60px; display: block; }

/* ═══ BOOKMARK BUTTON ═══ */
.btn-icon.saved svg { fill: var(--accent); stroke: var(--accent); }
.btn-icon.saved { color: var(--accent); }

/* ═══ GROUP ROLE BADGE ON POSTS ═══ */
.grp-post-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9px; font-weight: 600; color: var(--accent-purple);
    background: rgba(139,92,246,.08); padding: 2px 8px; border-radius: 4px;
    text-decoration: none; transition: background .15s;
}
.grp-post-badge:hover { background: rgba(139,92,246,.15); color: var(--accent-purple); }
.grp-post-badge svg { width: 10px; height: 10px; }

/* ═══ QUICK ACTIONS MENU (long-press) ═══ */
.quick-actions-overlay {
    position: fixed; inset: 0; z-index: 999998;
    background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .2s;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.quick-actions-overlay.open { opacity: 1; pointer-events: auto; }
.quick-actions-ring {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    padding: 20px; max-width: 240px;
}
.quick-action-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px; border-radius: var(--r); background: var(--bg-panel);
    border: 1px solid var(--border); cursor: pointer; transition: all .15s;
    text-decoration: none; color: var(--text-main); font-size: 10px; font-weight: 600;
}
.quick-action-btn:hover { border-color: var(--accent); transform: scale(1.05); }
.quick-action-btn svg { width: 20px; height: 20px; stroke: var(--accent); }
.quick-action-btn.danger svg { stroke: var(--accent-red); }
.quick-action-btn.danger:hover { border-color: var(--accent-red); }

/* ═══ ONBOARDING CHECKLIST WIDGET ═══ */
.ob-checklist {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--rl);
    padding: 16px; margin-bottom: 16px;
}
.ob-checklist-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.ob-checklist-progress { height: 4px; background: var(--element-bg); border-radius: 2px; margin-bottom: 12px; overflow: hidden; }
.ob-checklist-fill { height: 100%; background: var(--gradient-accent); border-radius: 2px; transition: width .4s; }
.ob-checklist-items { display: flex; flex-direction: column; gap: 6px; }
.ob-check-item {
    display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 8px;
    border-radius: var(--rs); transition: background .15s; cursor: pointer; text-decoration: none; color: var(--text-main);
}
.ob-check-item:hover { background: var(--element-bg); }
.ob-check-icon {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    font-size: 10px; transition: all .2s;
}
.ob-check-item.done .ob-check-icon { background: var(--accent-green); border-color: var(--accent-green); color: #fff; }
.ob-check-item.done { color: var(--text-muted); text-decoration: line-through; opacity: .6; }

/* ═══ GROUP ANALYTICS ═══ */
.grp-analytics-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px;
}
.grp-analytics-card {
    text-align: center; padding: 14px 8px; background: var(--bg-panel);
    border: 1px solid var(--border); border-radius: var(--r); transition: all .2s;
}
.grp-analytics-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.grp-analytics-val { font-size: 22px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.grp-analytics-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ═══ ACCESSIBILITY ═══ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[role="button"] { cursor: pointer; }
img:not([alt]) { outline: 2px solid var(--accent-red); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
