/* =====================================================
   Padlet KKR — Design System
   สไตล์เลียนแบบ padlet.com เต็มรูปแบบ
   ===================================================== */

/* ── Google Font (Noto Sans Thai + Inter) ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand */
    --brand: #ff6c2f;          /* Padlet orange */
    --brand-dark: #e85a1f;
    --brand-light: #fff3ee;

    /* Accent gradients */
    --grad-board:   linear-gradient(135deg,#7c3aed 0%,#a855f7 100%);
    --grad-sandbox: linear-gradient(135deg,#2563eb 0%,#06b6d4 100%);
    --grad-arcade:  linear-gradient(135deg,#d97706 0%,#f59e0b 100%);
    --grad-hero:    linear-gradient(135deg,#1e0a3c 0%,#43127b 60%,#6928b0 100%);

    /* Neutrals */
    --bg:      #f5f4f8;
    --bg2:     #ffffff;
    --card:    #ffffff;
    --border:  #e4e2eb;
    --text:    #14142b;
    --muted:   #6e6d7a;
    --subtle:  #a09ea8;
    --line:    #ededf0;

    /* Semantic */
    --success: #00b373;
    --danger:  #e53e3e;
    --info:    #0080ff;

    /* Elevation */
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 24px rgba(0,0,0,0.10);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);

    /* Radius */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-full: 9999px;

    /* Font */
    --font: 'Inter', 'Noto Sans Thai', sans-serif;

    /* Transition */
    --ease: cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Utilities ── */
.hidden { display: none !important; }
[x-cloak] { display: none !important; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }

/* =====================================================
   NAVIGATION
   ===================================================== */
.app-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 60px;
    display: flex;
    align-items: center;
}
.app-nav-inner {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.app-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--brand);
    white-space: nowrap;
    letter-spacing: -0.3px;
}
.app-logo-icon {
    width: 34px; height: 34px;
    background: var(--brand);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem;
}
.nav-spacer { flex: 1; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-link {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { color: var(--brand); }
.nav-divider { width: 1px; height: 24px; background: var(--border); margin: 0 0.5rem; }
.nav-avatar {
    width: 36px; height: 36px;
    border-radius: var(--r-full);
    background: var(--grad-hero);
    color: #fff;
    font-weight: 700; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: opacity 0.2s;
    border: 2px solid transparent;
}
.nav-avatar:hover { opacity: 0.85; }
.nav-toggle {
    display: none; background: none; border: none;
    font-size: 1.25rem; color: var(--text); padding: 0.25rem;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--card); border-radius: var(--r-md);
    border: 1px solid var(--border); box-shadow: var(--shadow-md);
    min-width: 200px; padding: 0.5rem; z-index: 300;
    animation: fadeDown 0.15s var(--ease);
}
@keyframes fadeDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.75rem; border-radius: var(--r-sm);
    font-size: 0.875rem; color: var(--text);
    transition: background 0.12s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 0.35rem 0; }

/* =====================================================
   LAYOUT
   ===================================================== */
.app-main { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-wrap { min-height: calc(100vh - 60px); }
.app-footer {
    text-align: center; padding: 2rem 1rem;
    color: var(--subtle); font-size: 0.8rem;
    border-top: 1px solid var(--line);
}

/* Alerts */
.alert-wrap { max-width: 1280px; margin: 0 auto; padding: 1rem 1.5rem 0; }
.alert {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.875rem 1.25rem; border-radius: var(--r-md);
    font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem;
    animation: slideAlert 0.3s var(--ease);
}
@keyframes slideAlert { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert i { font-size: 1rem; flex-shrink: 0; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--r-full);
    font-weight: 600; font-size: 0.875rem;
    border: none; cursor: pointer;
    transition: all 0.18s var(--ease);
    white-space: nowrap;
    text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-brand  { background: var(--brand); color: #fff; }
.btn-brand:hover  { background: var(--brand-dark); box-shadow: 0 4px 16px rgba(255,108,47,0.35); transform: translateY(-1px); }
.btn-purple { background: #7c3aed; color: #fff; }
.btn-purple:hover { background: #6d28d9; box-shadow: 0 4px 16px rgba(124,58,237,0.35); transform: translateY(-1px); }
.btn-white  { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.btn-white:hover  { background: var(--bg); box-shadow: var(--shadow-md); }
.btn-ghost  { background: transparent; color: var(--text); }
.btn-ghost:hover  { background: var(--bg); }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success{ background: var(--success); color: #fff; }
.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--r-md); }

/* =====================================================
   FORMS
   ===================================================== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block; font-size: 0.85rem; font-weight: 600;
    color: var(--text); margin-bottom: 0.4rem;
}
.form-input {
    width: 100%; padding: 0.75rem 1rem;
    border: 1.5px solid var(--border); border-radius: var(--r-md);
    font-size: 0.9rem; background: var(--card); color: var(--text);
    transition: border 0.18s, box-shadow 0.18s;
    outline: none;
}
.form-input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
.form-input::placeholder { color: var(--subtle); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%236e6d7a'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--card);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.card-body { padding: 1.5rem; }
.card-hover { transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* =====================================================
   BADGE & CHIP
   ===================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--r-full);
    font-size: 0.75rem; font-weight: 600;
}
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-orange { background: #fff3ee; color: #c2410c; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* =====================================================
   LIVE INDICATOR
   ===================================================== */
.live-dot {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.75rem; font-weight: 600; color: var(--success);
    background: #ecfdf5; padding: 0.25rem 0.65rem;
    border-radius: var(--r-full);
}
.live-dot::before {
    content: '';
    width: 7px; height: 7px;
    background: var(--success); border-radius: 50%;
    animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }

/* =====================================================
   HOME / LANDING
   ===================================================== */
.hero {
    background: var(--grad-hero);
    min-height: 100vh;
    display: flex; flex-direction: column;
}
.hero-nav {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.25rem 2rem; max-width: 1200px; margin: 0 auto; width: 100%;
}
.hero-nav-logo {
    display: flex; align-items: center; gap: 0.5rem;
    color: #fff; font-weight: 800; font-size: 1.3rem;
}
.hero-nav-logo .icon {
    width: 36px; height: 36px; background: rgba(255,255,255,0.15);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.hero-body {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 4rem 1.5rem 6rem; text-align: center;
}
.hero-tag {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    padding: 0.4rem 1rem; border-radius: var(--r-full);
    font-size: 0.85rem; font-weight: 500; margin-bottom: 2rem;
}
.hero-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800; color: #fff; line-height: 1.1;
    letter-spacing: -1.5px; margin-bottom: 1.25rem;
}
.hero-title span { color: var(--brand); }
.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: rgba(255,255,255,0.75); max-width: 600px;
    margin: 0 auto 2.5rem; line-height: 1.6;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
    gap: 1.5rem; max-width: 900px; margin: 4rem auto 0; padding: 0 1.5rem;
}
.hero-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r-xl); padding: 2rem;
    text-align: left; color: #fff;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}
.hero-card:hover { background: rgba(255,255,255,0.13); }
.hero-card-icon {
    width: 52px; height: 52px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 1rem;
}
.hero-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.4rem; }
.hero-card p { color: rgba(255,255,255,0.7); font-size: 0.9rem; line-height: 1.5; }
.hero-wave {
    position: relative; bottom: -1px;
    background: var(--bg);
    clip-path: ellipse(120% 80px at 50% 100%);
    height: 80px;
}

/* =====================================================
   AUTH
   ===================================================== */
.auth-page {
    min-height: calc(100vh - 60px);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg,#f8f6ff 0%, #fff3ee 100%);
}
.auth-box {
    width: 100%; max-width: 420px;
    background: var(--card);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.auth-header {
    background: var(--grad-hero);
    padding: 2rem; text-align: center; color: #fff;
}
.auth-header-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.auth-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-header p { opacity: 0.8; font-size: 0.9rem; }
.auth-body { padding: 2rem; }
.auth-footer { text-align: center; padding: 1.25rem; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--muted); }
.auth-footer a { color: #7c3aed; font-weight: 600; }

/* =====================================================
   DASHBOARD
   ===================================================== */
.dash-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
}
.dash-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.5px; }
.dash-title span { color: var(--brand); }
.dash-sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

.stat-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
    gap: 1rem; margin-bottom: 2.5rem;
}
.stat-tile {
    background: var(--card); border-radius: var(--r-lg);
    border: 1px solid var(--border); padding: 1.25rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    box-shadow: var(--shadow-xs);
}
.stat-tile .num { font-size: 2.25rem; font-weight: 800; line-height: 1; }
.stat-tile .lbl { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}
.section-title { font-size: 1.1rem; font-weight: 700; }

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px,1fr));
    gap: 1.25rem;
}
.group-card-wrap { position: relative; }
.group-card {
    background: var(--card); border-radius: var(--r-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-xs);
    overflow: hidden; display: block; color: inherit;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.group-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.group-card-banner {
    height: 8px;
    background: var(--grad-board);
}
.group-card-body { padding: 1.25rem; }
.group-card-icon {
    width: 44px; height: 44px; border-radius: var(--r-md);
    background: #ede9fe; color: #7c3aed;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 0.75rem;
}
.group-card-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.group-card-owner { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; }
.group-card-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-card-footer { display: flex; gap: 0.5rem; align-items: center; }
.group-edit-btn {
    position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.95); color: #7c3aed;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; box-shadow: var(--shadow-sm);
    opacity: 0; transition: opacity 0.15s var(--ease);
}
.group-card-wrap:hover .group-edit-btn { opacity: 1; }
.group-edit-btn:hover { background: #ede9fe; color: #5b21b6; }

.empty-state {
    background: var(--card); border-radius: var(--r-xl);
    border: 2px dashed var(--border); padding: 4rem 2rem;
    text-align: center;
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.25; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.empty-state p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* =====================================================
   GROUP SHOW
   ===================================================== */
.group-hero {
    background: var(--grad-hero);
    border-radius: var(--r-xl); padding: 2rem 2.5rem;
    color: #fff; margin-bottom: 1.5rem;
    position: relative; overflow: hidden;
}
.group-hero::after {
    content: '\f0c0';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; right: 2rem; top: 50%;
    transform: translateY(-50%);
    font-size: 6rem; opacity: 0.06;
}
.group-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.5px; }
.group-hero p { opacity: 0.8; margin-bottom: 1rem; }
.invite-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--r-full); padding: 0.4rem 1rem;
    font-size: 0.9rem; color: #fff; font-weight: 600; letter-spacing: 1px;
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin: 1.5rem 0; }
.feature-tile {
    border-radius: var(--r-lg); padding: 1.75rem;
    color: #fff; text-decoration: none; display: block;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
    position: relative; overflow: hidden;
}
.feature-tile::before {
    content: ''; position: absolute; right: -20px; bottom: -20px;
    width: 90px; height: 90px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.feature-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-tile i { font-size: 1.75rem; margin-bottom: 0.75rem; display: block; }
.feature-tile h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; }
.feature-tile p { font-size: 0.82rem; opacity: 0.8; }
.tile-board   { background: var(--grad-board); }
.tile-sandbox { background: var(--grad-sandbox); }
.tile-arcade  { background: var(--grad-arcade); }

.member-list { list-style: none; }
.member-item {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 0.875rem 0; border-bottom: 1px solid var(--line);
}
.member-item:last-child { border-bottom: none; }
.member-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--grad-board); color: #fff;
    font-weight: 700; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 0.9rem; font-weight: 600; }
.member-email { font-size: 0.8rem; color: var(--muted); }

/* =====================================================
   BOARD
   ===================================================== */
.board-fullpage { margin: -2rem -1.5rem; }
.board-topbar {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 60px; z-index: 100;
    padding: 0.75rem 1.5rem;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.board-topbar-title { font-size: 1.1rem; font-weight: 700; flex: 1; min-width: 0; }
.board-topbar-sub { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.board-actions { display: flex; gap: 0.5rem; align-items: center; }

.compose-area { max-width: 680px; margin: 1.5rem auto; padding: 0 1.5rem; }
.compose-card {
    background: var(--card); border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden;
}
.compose-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    background: #fafafa;
}
.compose-tab {
    flex: 1; padding: 0.75rem; border: none; background: none;
    cursor: pointer; font-size: 0.82rem; font-weight: 500;
    color: var(--muted); transition: all 0.15s; display: flex;
    align-items: center; justify-content: center; gap: 0.35rem;
}
.compose-tab:hover { background: var(--bg); color: var(--text); }
.compose-tab.active {
    color: #7c3aed; background: #fff;
    border-bottom: 2px solid #7c3aed;
}
.compose-body { padding: 1rem 1.25rem 1.25rem; }
.compose-textarea {
    width: 100%; border: none; outline: none; resize: none;
    font-size: 0.95rem; color: var(--text); line-height: 1.6;
    background: transparent; min-height: 80px;
}
.compose-textarea::placeholder { color: var(--subtle); }
.compose-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1.25rem; border-top: 1px solid var(--line);
    background: #fafafa;
}
.compose-type-input { padding: 0.75rem 0; }

/* Board canvas */
.board-canvas { padding: 1.5rem; }
.posts-wall {
    columns: 1; column-gap: 1.25rem;
}
@media(min-width: 640px)  { .posts-wall { columns: 2; } }
@media(min-width: 1024px) { .posts-wall { columns: 3; } }
@media(min-width: 1400px) { .posts-wall { columns: 4; } }

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1.25rem; }

/* Map layout (Leaflet) */
.board-canvas--map { padding: 0; background: #e8eef4 !important; }
.board-map { width: 100%; height: min(75vh, 720px); min-height: 420px; z-index: 1; }
.posts-map-source { display: none !important; }
.map-pick-notice {
    margin-top: 0.75rem; padding: 0.65rem 0.85rem; border-radius: var(--r-md);
    background: #fef3c7; color: #92400e; font-size: 0.82rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.5rem;
}
.map-pick-notice.is-set { background: #d1fae5; color: #065f46; }
.map-location-search { margin-top: 0.75rem; }
.map-search-label {
    font-size: 0.8rem; font-weight: 600; color: var(--muted);
    display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem;
}
.map-search-wrap { display: flex; gap: 0.5rem; }
.map-search-input { flex: 1; font-size: 0.88rem; }
.map-search-results {
    margin-top: 0.5rem; border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--card); max-height: 220px; overflow-y: auto;
    box-shadow: var(--shadow-sm);
}
.map-search-results.hidden { display: none; }
.map-search-item {
    display: block; width: 100%; text-align: left; padding: 0.65rem 0.85rem;
    border: none; border-bottom: 1px solid var(--border); background: transparent;
    cursor: pointer; font-size: 0.82rem; line-height: 1.45; color: var(--text);
}
.map-search-item:last-child { border-bottom: none; }
.map-search-item:hover { background: var(--bg2); }
.map-search-item strong { display: block; font-weight: 600; margin-bottom: 0.15rem; }
.map-search-item span { color: var(--muted); font-size: 0.76rem; }
.map-search-empty {
    padding: 0.75rem; text-align: center; color: var(--muted); font-size: 0.82rem;
}
.map-search-loading {
    padding: 0.75rem; text-align: center; color: var(--muted); font-size: 0.82rem;
}
.map-post-panel {
    position: fixed; top: 0; right: 0; z-index: 1200;
    width: min(380px, 92vw); height: 100vh;
    background: var(--card); box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    overflow-y: auto; padding: 1rem;
}
.map-post-panel-close {
    position: sticky; top: 0; float: right; z-index: 2;
    width: 36px; height: 36px; border: none; border-radius: 50%;
    background: var(--bg2); color: var(--muted); cursor: pointer;
}
.map-post-panel .post-card { box-shadow: none; border: 1px solid var(--border); }
.board-map .map-pin-marker {
    background: #7c3aed; border: 3px solid #fff; border-radius: 50% 50% 50% 0;
    width: 32px; height: 32px; transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.board-map .map-pin-marker-inner {
    width: 100%; height: 100%; border-radius: 50%;
    transform: rotate(45deg); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.7rem; font-weight: 700;
}
.board-map .map-pin-marker--pick { background: #f59e0b; animation: map-pulse 1.2s infinite; }
@keyframes map-pulse {
    0%, 100% { transform: rotate(-45deg) scale(1); }
    50% { transform: rotate(-45deg) scale(1.15); }
}
.leaflet-popup-content .map-popup-preview { font-size: 0.85rem; line-height: 1.5; max-width: 220px; }
.leaflet-popup-content .map-popup-preview strong { display: block; margin-bottom: 0.25rem; }
.leaflet-popup-content .map-popup-open {
    margin-top: 0.5rem; padding: 0.35rem 0.75rem; border: none; border-radius: var(--r-sm);
    background: #7c3aed; color: #fff; font-size: 0.78rem; font-weight: 600; cursor: pointer; width: 100%;
}

/* Timeline layout (Padlet-style) */
.posts-timeline {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}
.posts-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #7c3aed 0%, #a78bfa 50%, #c4b5fd 100%);
    transform: translateX(-50%);
    border-radius: 2px;
    opacity: 0.45;
}
.timeline-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: rgba(0,0,0,0.45);
    position: relative;
    z-index: 1;
}
.timeline-year {
    position: relative;
    z-index: 2;
    text-align: center;
    margin: 2rem 0 1.75rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #7c3aed;
    letter-spacing: 0.02em;
}
.timeline-year::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #7c3aed;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
    box-shadow: 0 0 0 4px rgba(124,58,237,0.15);
}
.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 52px 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
    align-items: start;
}
.timeline-item--left .timeline-card-wrap { grid-column: 1; grid-row: 1; justify-self: end; width: 100%; max-width: 380px; }
.timeline-item--left .timeline-node { grid-column: 2; grid-row: 1; }
.timeline-item--right .timeline-card-wrap { grid-column: 3; grid-row: 1; justify-self: start; width: 100%; max-width: 380px; }
.timeline-item--right .timeline-node { grid-column: 2; grid-row: 1; }
.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    padding-top: 0.35rem;
}
.timeline-node time {
    font-size: 0.72rem;
    font-weight: 700;
    color: #5b21b6;
    white-space: nowrap;
    background: var(--card);
    padding: 0.3rem 0.65rem;
    border-radius: var(--r-full);
    border: 2px solid #7c3aed;
    box-shadow: var(--shadow-xs);
    text-align: center;
    line-height: 1.3;
    max-width: 120px;
}
.timeline-dot {
    width: 14px;
    height: 14px;
    background: #7c3aed;
    border: 3px solid var(--card);
    border-radius: 50%;
    box-shadow: 0 0 0 2px #7c3aed;
    margin-top: 0.5rem;
    flex-shrink: 0;
}
.timeline-card-wrap .post-card {
    margin-bottom: 0;
    width: 100%;
}
.timeline-card-wrap .post-card:hover {
    transform: translateY(-3px);
}
@media (max-width: 720px) {
    .posts-timeline::before { left: 26px; transform: none; }
    .timeline-item {
        grid-template-columns: 52px 1fr;
        gap: 0.65rem;
    }
    .timeline-item--left .timeline-card-wrap,
    .timeline-item--right .timeline-card-wrap {
        grid-column: 2;
        grid-row: 1;
        justify-self: stretch;
        max-width: none;
    }
    .timeline-item--left .timeline-node,
    .timeline-item--right .timeline-node {
        grid-column: 1;
        grid-row: 1;
    }
    .timeline-year { text-align: left; padding-left: 0.5rem; }
}
.dark .timeline-node time { background: var(--card); color: #c4b5fd; border-color: #8b5cf6; }
.dark .timeline-dot { border-color: var(--card); }

/* Post card */
.post-card {
    background: var(--card); border-radius: var(--r-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-xs);
    overflow: hidden; break-inside: avoid; margin-bottom: 1.25rem;
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
    animation: postIn 0.3s var(--ease);
}
@keyframes postIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card.is-new { box-shadow: 0 0 0 2.5px #7c3aed; }

.post-img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.post-body { padding: 1rem 1.125rem; }
.post-content { font-size: 0.9rem; line-height: 1.65; white-space: pre-wrap; margin-bottom: 0.5rem; }
.post-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; color: #7c3aed; word-break: break-all;
}
.post-link-card {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem; margin-top: 0.25rem;
    border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--bg); text-decoration: none; color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.post-link-card:hover {
    border-color: #c4b5fd; box-shadow: var(--shadow-sm);
}
.post-link-card-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: var(--r-sm); background: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); overflow: hidden;
}
.post-link-card-icon img { width: 20px; height: 20px; }
.post-link-card-body { flex: 1; min-width: 0; }
.post-link-card-title {
    font-size: 0.88rem; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-link-card-url {
    font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-link-card-arrow { color: var(--subtle); font-size: 0.75rem; flex-shrink: 0; }
.post-file {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; color: #2563eb;
}
.post-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.625rem 1.125rem;
    border-top: 1px solid var(--line);
    background: #fafafa;
}
.post-author { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--muted); }
.post-author-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--grad-board); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.post-btns { display: flex; gap: 0.5rem; align-items: center; }
.post-btn {
    background: none; border: none; cursor: pointer;
    font-size: 0.8rem; color: var(--muted);
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.5rem; border-radius: var(--r-sm);
    transition: all 0.15s;
}
.post-btn:hover { background: #fef2f2; color: var(--danger); }
.post-btn.liked { color: var(--danger); }
.post-btn.comment-btn:hover { background: #ede9fe; color: #7c3aed; }

.post-comments { padding: 0.5rem 1.125rem; background: #fafafa; border-top: 1px solid var(--line); }
.comment-item { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.83rem; }
.comment-bubble { background: var(--bg); border-radius: 0 var(--r-md) var(--r-md) var(--r-md); padding: 0.4rem 0.75rem; flex: 1; }
.comment-author { font-weight: 600; margin-bottom: 0.1rem; font-size: 0.78rem; }
.comment-form { display: flex; gap: 0.5rem; padding: 0.625rem 1.125rem 0.75rem; }
.comment-input {
    flex: 1; border: 1.5px solid var(--border); border-radius: var(--r-full);
    padding: 0.4rem 0.875rem; font-size: 0.83rem; outline: none;
    background: var(--bg); transition: border 0.15s;
}
.comment-input:focus { border-color: #7c3aed; background: #fff; }

/* Share panel */
.share-panel {
    background: var(--card); border-radius: var(--r-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-md);
    padding: 1.25rem; max-width: 420px; margin: 0.75rem auto;
}

/* =====================================================
   BOARDS LIST / GRID
   ===================================================== */
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1.25rem; }
.board-thumb {
    background: var(--card); border-radius: var(--r-lg);
    border: 1px solid var(--border); overflow: hidden;
    display: block; color: inherit;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.board-thumb:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.board-thumb-cover {
    height: 130px; display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; opacity: 0.4;
    position: relative;
}
.board-thumb-body { padding: 1rem; }
.board-thumb-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.25rem; }
.board-thumb-meta { font-size: 0.78rem; color: var(--muted); }

/* =====================================================
   SANDBOX
   ===================================================== */
.sandbox-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1.25rem; }
.sandbox-card-wrap { position: relative; }
.sandbox-card {
    background: var(--card); border-radius: var(--r-lg);
    border: 1px solid var(--border); overflow: hidden;
    display: block; color: inherit;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.sandbox-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.sandbox-delete-form { position: absolute; top: 0.5rem; right: 0.5rem; margin: 0; z-index: 2; }
.sandbox-delete-btn {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.92); color: var(--danger);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; box-shadow: var(--shadow-sm);
    opacity: 0; transition: opacity 0.15s var(--ease);
}
.sandbox-card-wrap:hover .sandbox-delete-btn { opacity: 1; }
.sandbox-delete-btn:hover { background: #fef2f2; }
.sandbox-card-cover {
    height: 130px; background: var(--grad-sandbox);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: rgba(255,255,255,0.5);
}
.sandbox-card-body { padding: 1rem; }

.sandbox-template-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem;
}
.sandbox-template-card { cursor: pointer; }
.sandbox-template-card input { position: absolute; opacity: 0; pointer-events: none; }
.sandbox-template-inner {
    display: flex; flex-direction: column; gap: 0.35rem;
    padding: 1rem; border-radius: var(--r-lg);
    border: 2px solid var(--border); background: var(--card);
    transition: border-color 0.15s, box-shadow 0.15s; height: 100%;
}
.sandbox-template-card input:checked + .sandbox-template-inner {
    border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
    background: var(--tpl-color, #f8fafc);
}
.sandbox-template-icon {
    width: 40px; height: 40px; border-radius: var(--r-md);
    background: rgba(124,58,237,0.12); color: #7c3aed;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.sandbox-template-label { font-weight: 700; font-size: 0.9rem; }
.sandbox-template-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

/* =====================================================
   ARCADE
   ===================================================== */
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1.25rem; }
.arcade-card {
    background: var(--card); border-radius: var(--r-lg);
    border: 1px solid var(--border); overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.arcade-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.arcade-card-cover {
    height: 120px; background: var(--grad-arcade);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.25rem; color: rgba(255,255,255,0.6);
    position: relative;
}
.arcade-type-chip {
    position: absolute; bottom: 0.75rem; left: 0.75rem;
    background: rgba(0,0,0,0.25); color: #fff;
    font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem;
    border-radius: var(--r-full);
}
.arcade-card-body { padding: 1rem; }
.arcade-card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.25rem; }
.arcade-card-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.875rem; }
.arcade-card-actions { display: flex; gap: 0.5rem; }

/* AI Panel */
.ai-banner {
    background: linear-gradient(135deg,#ecfdf5,#d1fae5);
    border: 1.5px solid #6ee7b7; border-radius: var(--r-lg); padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.ai-banner h3 { font-size: 0.95rem; font-weight: 700; color: #065f46; margin-bottom: 0.75rem; }
.ai-banner-hint { font-size: 0.8rem; color: #059669; margin-top: 0.5rem; }

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header { margin-bottom: 2rem; }
.page-header-back { font-size: 0.85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; }
.page-header-back:hover { color: var(--text); }
.page-header h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.5px; }
.page-header p { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* =====================================================
   REPORTS / ADMIN
   ===================================================== */
.report-card { background: var(--card); border-radius: var(--r-lg); border: 1px solid var(--border); overflow: hidden; margin-bottom: 1.25rem; }
.report-card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); background: #fafafa; }
.report-card-header h3 { font-size: 1rem; font-weight: 700; }
.report-stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border); }
.report-stat { background: var(--card); padding: 1.25rem; text-align: center; }
.report-stat .n { font-size: 1.75rem; font-weight: 800; }
.report-stat .l { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted); background: #fafafa; border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.875rem 1rem; font-size: 0.875rem; border-bottom: 1px solid var(--line); }
.data-table tr:hover td { background: #fafafa; }
.data-table tr:last-child td { border-bottom: none; }

/* =====================================================
   LEADERBOARD
   ===================================================== */
.lb-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--line);
}
.lb-rank { font-size: 1.1rem; font-weight: 800; width: 32px; text-align: center; color: var(--muted); }
.lb-rank.gold   { color: #f59e0b; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #d97706; }
.lb-name { flex: 1; font-weight: 600; }
.lb-score { font-size: 1.1rem; font-weight: 800; color: var(--success); }
.lb-time { font-size: 0.78rem; color: var(--muted); margin-left: 0.5rem; }

/* =====================================================
   FORM PAGE
   ===================================================== */
.form-page { max-width: 640px; margin: 0 auto; }
.form-section { background: var(--card); border-radius: var(--r-lg); border: 1px solid var(--border); padding: 1.5rem; margin-bottom: 1.25rem; }
.form-section-title { font-size: 0.9rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1.25rem; }
.form-color-row { display: grid; grid-template-columns: repeat(8,1fr); gap: 0.5rem; margin-top: 0.5rem; }
.color-swatch {
    height: 32px; border-radius: var(--r-sm); cursor: pointer;
    border: 2px solid transparent; transition: transform 0.15s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #7c3aed; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: fixed; inset: 60px 0 0 0;
        background: rgba(255,255,255,0.98); backdrop-filter: blur(12px);
        flex-direction: column; align-items: stretch; padding: 1rem;
        overflow-y: auto; z-index: 150;
    }
    .nav-links.open { display: flex; }
    .nav-link { font-size: 1rem; padding: 0.875rem 1rem; }
    .nav-divider { display: none; }
    .nav-dropdown-menu { position: fixed; right: 1rem; top: 70px; }
    .board-topbar { top: 0; }
    .app-main { padding: 1.25rem 1rem; }
    .group-hero { padding: 1.5rem; }
    .group-hero::after { display: none; }
    .group-hero h1 { font-size: 1.5rem; }
    .hero-title { font-size: 2.25rem; }
    .hero-cards { grid-template-columns: 1fr; }
    .report-stat-grid { grid-template-columns: repeat(2,1fr); }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .stat-row { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
    .feature-grid { grid-template-columns: 1fr; }
    .dash-header { flex-direction: column; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { justify-content: center; }
    .board-topbar { flex-wrap: wrap; }
}

/* =====================================================
   BOARD PRO — search, colors, canvas, video, slideshow, dark
   ===================================================== */

/* Search box in topbar */
.board-search {
    display: flex; align-items: center; gap: 0.4rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--r-full); padding: 0.35rem 0.75rem;
    color: var(--muted); max-width: 200px;
}
.board-search i { font-size: 0.8rem; }
.board-search input {
    border: none; outline: none; background: transparent;
    font-size: 0.83rem; width: 100%; color: var(--text);
    font-family: var(--font);
}
@media (max-width: 720px) { .board-search { display: none; } }

/* Post color picker */
.post-color-row { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.post-color-dot {
    width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border);
    cursor: pointer; padding: 0; transition: transform 0.12s var(--ease);
}
.post-color-dot:hover { transform: scale(1.15); }
.post-color-dot.selected,
.post-color-dot:has(input:checked) { box-shadow: 0 0 0 2px var(--brand); transform: scale(1.1); }
.post-color-dot--none {
    background: #fff;
    background-image: linear-gradient(45deg,transparent 45%,var(--danger) 45%,var(--danger) 55%,transparent 55%);
}

/* Reaction button */
.reaction-btn:hover { background: #ede9fe; color: #7c3aed; }
.reaction-btn.liked { color: var(--brand); }
.reaction-btn.pop { animation: reactPop 0.25s var(--ease); }
@keyframes reactPop { 0%{transform:scale(1)} 50%{transform:scale(1.35)} 100%{transform:scale(1)} }
.edit-btn:hover { background: #ede9fe; color: #7c3aed; }

.post-edited { font-size: 0.72rem; color: var(--subtle); margin-left: 0.25rem; }
.post-edit-form textarea { font-size: 0.9rem; line-height: 1.6; }

/* Video / embed */
.post-embed { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.post-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Stream layout (single column feed) */
.posts-stream { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }

/* Canvas layout (free drag) */
.posts-canvas {
    position: relative; min-height: 75vh; width: 100%;
}
.post-card--canvas {
    position: absolute; width: 280px; margin: 0;
    z-index: 1;
}
.post-card--canvas.dragging { z-index: 50; box-shadow: var(--shadow-lg); opacity: 0.95; }
.post-drag {
    position: absolute; top: 6px; right: 6px; z-index: 5;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.9); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    cursor: grab; font-size: 0.75rem; box-shadow: var(--shadow-xs);
}
.post-drag:active { cursor: grabbing; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.88); display: flex;
    align-items: center; justify-content: center; padding: 2rem; cursor: zoom-out;
}
.lightbox img { max-width: 95%; max-height: 95%; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }

/* Slideshow / presentation */
.slideshow {
    position: fixed; inset: 0; z-index: 2100;
    background: rgba(15,10,30,0.97); display: flex;
    align-items: center; justify-content: center;
}
.slideshow-stage { width: min(900px,92vw); max-height: 86vh; }
.slide-card {
    background: var(--card); border-radius: var(--r-xl);
    overflow: hidden; box-shadow: var(--shadow-lg);
    max-height: 86vh; display: flex; flex-direction: column;
}
.slide-card img { width: 100%; max-height: 60vh; object-fit: contain; background: #000; }
.slide-embed { position: relative; padding-top: 56.25%; }
.slide-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.slide-text { padding: 1.75rem; font-size: 1.25rem; line-height: 1.7; color: var(--text); overflow:auto; }
.slide-author { padding: 0 1.75rem 1.5rem; color: var(--muted); font-weight: 600; }
.slideshow-close {
    position: absolute; top: 1.25rem; right: 1.5rem;
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.1rem;
}
.slideshow-close:hover { background: rgba(255,255,255,0.3); }
.slideshow-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    width: 52px; height: 52px; border-radius: 50%; cursor: pointer; font-size: 1.25rem;
}
.slideshow-nav:hover { background: rgba(255,255,255,0.3); }
.slideshow-prev { left: 1.5rem; }
.slideshow-next { right: 1.5rem; }
.slideshow-counter {
    position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    color: #fff; font-weight: 600; font-size: 0.9rem;
    background: rgba(255,255,255,0.15); padding: 0.35rem 1rem; border-radius: var(--r-full);
}
@media (max-width: 640px) {
    .slideshow-prev { left: 0.5rem; }
    .slideshow-next { right: 0.5rem; }
    .slide-text { font-size: 1.05rem; padding: 1.25rem; }
}

/* =====================================================
   DARK MODE (board view)
   ===================================================== */
html.dark {
    --bg: #15131f; --bg2: #1d1a2b; --card: #211d33;
    --border: #353048; --text: #ece9f5; --muted: #a9a4bd;
    --subtle: #7d7894; --line: #2c2740;
}
html.dark body { background: #15131f; }
html.dark .post-footer,
html.dark .post-comments { background: #1a1728; }
html.dark .comment-bubble { background: #15131f; }
html.dark .board-topbar { background: #1d1a2b; border-color: #353048; }
html.dark .compose-card,
html.dark .post-card { background: var(--card); border-color: var(--border); }
html.dark .btn-white { background: #2a2540; color: var(--text); border-color: #3a3454; }
html.dark .comment-input,
html.dark .compose-textarea,
html.dark .post-edit-form textarea,
html.dark .form-input { background: #1a1728; color: var(--text); border-color: #353048; }
html.dark .reaction-btn:hover,
html.dark .edit-btn:hover { background: #322a4d; }

/* =====================================================
   MODERATION + SHELF + REAL-TIME
   ===================================================== */

.compose-notice {
    padding: 0.6rem 1rem; font-size: 0.82rem; color: #92400e;
    background: #fffbeb; border-bottom: 1px solid #fde68a;
}

.pending-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: #fef3c7; color: #92400e; font-size: 0.78rem; font-weight: 700;
    padding: 0.25rem 0.6rem; border-radius: var(--r-full);
}
.pending-badge.hidden { display: none; }

.moderation-panel {
    max-width: 680px; margin: 1rem auto; padding: 0 1.5rem;
}
.moderation-panel-header {
    font-size: 0.9rem; font-weight: 700; color: #92400e;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: var(--r-md) var(--r-md) 0 0;
    padding: 0.75rem 1rem;
}
.moderation-panel-body {
    background: #fff; border: 1px solid #fde68a; border-top: none;
    border-radius: 0 0 var(--r-md) var(--r-md);
    padding: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem;
}

.post-status-badge {
    font-size: 0.72rem; font-weight: 700; padding: 0.35rem 0.75rem;
    display: flex; align-items: center; gap: 0.35rem;
}
.post-status-badge--pending { background: #fffbeb; color: #92400e; }
.post-status-badge--rejected { background: #fef2f2; color: #b91c1c; }

.post-card--pending { border: 2px dashed #fbbf24; }
.post-card--rejected { opacity: 0.6; }

.mod-btn.mod-approve:hover { background: #dcfce7; color: #16a34a; }
.mod-btn.mod-reject:hover { background: #fef2f2; color: #dc2626; }

.post-section-move { padding: 0.5rem 1.125rem; border-top: 1px solid var(--line); }

/* Shelf layout */
.posts-shelf {
    display: flex; gap: 1rem; overflow-x: auto;
    padding: 0.5rem; align-items: flex-start;
    min-height: 60vh;
}
.shelf-column {
    flex: 0 0 300px; min-width: 280px; max-width: 320px;
    background: rgba(255,255,255,0.55); border-radius: var(--r-lg);
    border: 1px solid var(--border); display: flex; flex-direction: column;
    max-height: 80vh;
}
.shelf-column-header {
    padding: 0.75rem 1rem; font-weight: 700; font-size: 0.9rem;
    display: flex; align-items: center; gap: 0.5rem;
    border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.shelf-column-title { flex: 1; }
.shelf-col-count {
    font-size: 0.75rem; font-weight: 600; color: var(--muted);
    background: var(--bg); padding: 0.15rem 0.5rem; border-radius: var(--r-full);
}
.shelf-col-edit {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 0.75rem; padding: 0.2rem;
}
.shelf-col-edit:hover { color: var(--text); }
.shelf-column-body {
    padding: 0.75rem; overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 0.75rem;
}
.shelf-column-body .post-card { margin-bottom: 0; break-inside: auto; }
.shelf-add-column {
    flex: 0 0 120px; display: flex; align-items: flex-start;
    justify-content: center; padding-top: 1rem;
}

.section-edit-row {
    display: flex; gap: 0.5rem; align-items: center;
    margin-bottom: 0.5rem;
}

html.dark .shelf-column { background: rgba(33,29,51,0.8); }
html.dark .moderation-panel-body { background: var(--card); }
html.dark .moderation-panel-header { background: #3d2f0a; color: #fde68a; }
html.dark .compose-notice { background: #3d2f0a; color: #fde68a; }
