/* ═══════════════════════════════════════════════════════════════
   VALLE VISTA COMMONS — Design System v2
   "Warm Modern Community"
   
   Shared CSS for all pages. Schemes: forest, terracotta, slate,
   sage, indigo. Modes: light, dark. Toggle via data attributes
   on <html>: data-theme="light|dark" data-scheme="forest|..."
   ═══════════════════════════════════════════════════════════════ */

/* ─── Anti-flash: hide until theme JS sets data-theme ────────── */
html:not([data-theme]) { visibility: hidden; }

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── iOS Safari Input Zoom Prevention ───────────────────────── */
/* Keep this scoped to iOS Safari to avoid cross-platform drift. */
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: 16px !important; }
}

/* ─── PWA / iOS standalone app behavior ──────────────────────── */
html {
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { overscroll-behavior-y: none; }

/* iOS Safari can auto-inflate text in scroll containers. Lock parity. */
@supports (-webkit-touch-callout: none) {
  .post-body,
  .post-row-desc,
  .tiptap-content,
  .editor-toolbar button {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

/* Prevent pull-to-refresh in standalone mode */
@media all and (display-mode: standalone) {
  body { overscroll-behavior: none; }
}

/* Disable tap highlights and text selection on interactive elements */
button, a, .action-btn, .nav-btn, .fab, .theme-trigger, .theme-toggle-btn, .scheme-dot, .mode-btn {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════════
   COLOR SCHEMES
   ═══════════════════════════════════════════════════════════════ */

/* ─── FOREST GREEN ───────────────────────────────────────────── */
[data-scheme="forest"][data-theme="light"] {
  --primary-900: #1b4332; --primary-800: #2d6a4f; --primary-700: #40916c;
  --primary-600: #52b788; --primary-500: #74c69d; --primary-400: #95d5b2;
  --primary-300: #b7e4c7; --primary-200: #d8f3dc; --primary-100: #edf6f0;
  --surface-bg: #f6f8f6; --surface-card: #ffffff; --surface-elevated: #ffffff;
  --surface-hover: #f0f2f0; --surface-border: #e2e5e3; --surface-inset: #f4f6f4;
  --text-primary: #1a1d23; --text-secondary: #44464f; --text-tertiary: #797b82;
  --text-muted: #9d9fa5; --text-inverted: #ffffff;
  --gray-50: #f8f9fa; --gray-100: #f1f2f3; --gray-200: #e2e3e5; --gray-300: #c4c5c9;
}
[data-scheme="forest"][data-theme="dark"] {
  --primary-900: #d8f3dc; --primary-800: #b7e4c7; --primary-700: #95d5b2;
  --primary-600: #74c69d; --primary-500: #52b788; --primary-400: #40916c;
  --primary-300: #2d6a4f; --primary-200: #1b4332; --primary-100: #132e23;
  --surface-bg: #0f1210; --surface-card: #1a1e1b; --surface-elevated: #222723;
  --surface-hover: #262b27; --surface-border: #2e3530; --surface-inset: #151a16;
  --text-primary: #e8ebe9; --text-secondary: #b0b5b2; --text-tertiary: #7d847f;
  --text-muted: #5a615c; --text-inverted: #0f1210;
  --gray-50: #161b17; --gray-100: #1e2320; --gray-200: #2e3530; --gray-300: #3e4540;
}

/* ─── TERRACOTTA ─────────────────────────────────────────────── */
[data-scheme="terracotta"][data-theme="light"] {
  --primary-900: #6b2c14; --primary-800: #9c4221; --primary-700: #c2592b;
  --primary-600: #e07040; --primary-500: #ed8a5e; --primary-400: #f4a882;
  --primary-300: #f8c4a8; --primary-200: #fce0cf; --primary-100: #fef3ec;
  --surface-bg: #faf7f5; --surface-card: #ffffff; --surface-elevated: #ffffff;
  --surface-hover: #f5f0ec; --surface-border: #e8e0da; --surface-inset: #f7f3f0;
  --text-primary: #2d1f16; --text-secondary: #5c4a3e; --text-tertiary: #8a7a6e;
  --text-muted: #a99d93; --text-inverted: #ffffff;
  --gray-50: #faf7f5; --gray-100: #f3eeea; --gray-200: #e5ddd7; --gray-300: #ccc2ba;
}
[data-scheme="terracotta"][data-theme="dark"] {
  --primary-900: #fce0cf; --primary-800: #f4a882; --primary-700: #ed8a5e;
  --primary-600: #e07040; --primary-500: #c2592b; --primary-400: #9c4221;
  --primary-300: #6b2c14; --primary-200: #4a1e0d; --primary-100: #331408;
  --surface-bg: #141110; --surface-card: #1f1b19; --surface-elevated: #2a2523;
  --surface-hover: #302a27; --surface-border: #3a3330; --surface-inset: #1a1614;
  --text-primary: #ede6e2; --text-secondary: #b5aba4; --text-tertiary: #857a73;
  --text-muted: #5e5550; --text-inverted: #141110;
  --gray-50: #1a1614; --gray-100: #231f1d; --gray-200: #3a3330; --gray-300: #4e4642;
}

/* ─── SLATE BLUE ─────────────────────────────────────────────── */
[data-scheme="slate"][data-theme="light"] {
  --primary-900: #1e293b; --primary-800: #334155; --primary-700: #475569;
  --primary-600: #64748b; --primary-500: #94a3b8; --primary-400: #b0bec9;
  --primary-300: #cbd5e1; --primary-200: #e2e8f0; --primary-100: #f1f5f9;
  --surface-bg: #f7f8fa; --surface-card: #ffffff; --surface-elevated: #ffffff;
  --surface-hover: #f0f2f5; --surface-border: #e2e5ea; --surface-inset: #f4f6f9;
  --text-primary: #0f172a; --text-secondary: #334155; --text-tertiary: #64748b;
  --text-muted: #94a3b8; --text-inverted: #ffffff;
  --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0; --gray-300: #cbd5e1;
}
[data-scheme="slate"][data-theme="dark"] {
  --primary-900: #e2e8f0; --primary-800: #cbd5e1; --primary-700: #94a3b8;
  --primary-600: #78899e; --primary-500: #64748b; --primary-400: #475569;
  --primary-300: #334155; --primary-200: #1e293b; --primary-100: #0f172a;
  --surface-bg: #0c0f14; --surface-card: #151a22; --surface-elevated: #1e2430;
  --surface-hover: #242b38; --surface-border: #283040; --surface-inset: #111620;
  --text-primary: #e2e8f0; --text-secondary: #94a3b8; --text-tertiary: #64748b;
  --text-muted: #475569; --text-inverted: #0c0f14;
  --gray-50: #111620; --gray-100: #1a2030; --gray-200: #283040; --gray-300: #354050;
}

/* ─── SAGE ───────────────────────────────────────────────────── */
[data-scheme="sage"][data-theme="light"] {
  --primary-900: #2f3e2e; --primary-800: #4a6348; --primary-700: #5e7d5b;
  --primary-600: #7a9a76; --primary-500: #97b393; --primary-400: #b3cab0;
  --primary-300: #cfdecb; --primary-200: #e5efe3; --primary-100: #f2f7f1;
  --surface-bg: #f5f7f4; --surface-card: #ffffff; --surface-elevated: #ffffff;
  --surface-hover: #eef1ec; --surface-border: #dde3da; --surface-inset: #f0f3ee;
  --text-primary: #1c2119; --text-secondary: #3e4a3b; --text-tertiary: #6b7867;
  --text-muted: #97a393; --text-inverted: #ffffff;
  --gray-50: #f7f9f6; --gray-100: #eef1ec; --gray-200: #dde3da; --gray-300: #c2cbbf;
}
[data-scheme="sage"][data-theme="dark"] {
  --primary-900: #e5efe3; --primary-800: #b3cab0; --primary-700: #97b393;
  --primary-600: #7a9a76; --primary-500: #5e7d5b; --primary-400: #4a6348;
  --primary-300: #2f3e2e; --primary-200: #1f2b1e; --primary-100: #141c13;
  --surface-bg: #0e110e; --surface-card: #181c17; --surface-elevated: #212621;
  --surface-hover: #282d27; --surface-border: #303630; --surface-inset: #141914;
  --text-primary: #e2e8e0; --text-secondary: #a8b3a5; --text-tertiary: #6e7d6b;
  --text-muted: #4a5648; --text-inverted: #0e110e;
  --gray-50: #141914; --gray-100: #1c211c; --gray-200: #303630; --gray-300: #404640;
}

/* ─── INDIGO ─────────────────────────────────────────────────── */
[data-scheme="indigo"][data-theme="light"] {
  --primary-900: #312e81; --primary-800: #3730a3; --primary-700: #4338ca;
  --primary-600: #6366f1; --primary-500: #818cf8; --primary-400: #a5b4fc;
  --primary-300: #c7d2fe; --primary-200: #e0e7ff; --primary-100: #eef2ff;
  --surface-bg: #f7f7fb; --surface-card: #ffffff; --surface-elevated: #ffffff;
  --surface-hover: #f0f0f6; --surface-border: #e0e1ea; --surface-inset: #f4f4f9;
  --text-primary: #1e1b4b; --text-secondary: #3b3766; --text-tertiary: #6b6893;
  --text-muted: #9b98b8; --text-inverted: #ffffff;
  --gray-50: #f8f8fc; --gray-100: #f0f0f6; --gray-200: #e0e1ea; --gray-300: #c6c7d6;
}
[data-scheme="indigo"][data-theme="dark"] {
  --primary-900: #e0e7ff; --primary-800: #c7d2fe; --primary-700: #a5b4fc;
  --primary-600: #818cf8; --primary-500: #6366f1; --primary-400: #4338ca;
  --primary-300: #3730a3; --primary-200: #312e81; --primary-100: #1e1b4b;
  --surface-bg: #0c0c14; --surface-card: #14142a; --surface-elevated: #1c1c35;
  --surface-hover: #22223d; --surface-border: #2a2a48; --surface-inset: #10101e;
  --text-primary: #e0e1f0; --text-secondary: #9b98c8; --text-tertiary: #6b6893;
  --text-muted: #44416b; --text-inverted: #0c0c14;
  --gray-50: #10101e; --gray-100: #1a1a30; --gray-200: #2a2a48; --gray-300: #3a3a58;
}

/* ═══════════════════════════════════════════════════════════════
   ACCENT COLORS (adapt to light/dark)
   ═══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --accent-alert: #e63946; --accent-alert-soft: rgba(230,57,70,0.1);
  --accent-happenings: #7c3aed; --accent-happenings-soft: rgba(124,58,237,0.1);
  --accent-lostfound: #2563eb; --accent-lostfound-soft: rgba(37,99,235,0.1);
  --accent-neighbors: var(--primary-700); --accent-neighbors-soft: var(--primary-100);
  --accent-notes: var(--text-tertiary); --accent-notes-soft: var(--gray-100);
  --accent-success: #16a34a; --accent-success-soft: rgba(22,163,74,0.1);
  --accent-warning: #d97706; --accent-warning-soft: rgba(217,119,6,0.1);
  --accent-info: #0284c7; --accent-info-soft: rgba(2,132,199,0.1);
  --accent-danger: #dc2626; --accent-danger-soft: rgba(220,38,38,0.1);
}
[data-theme="dark"] {
  --accent-alert: #f87171; --accent-alert-soft: rgba(248,113,113,0.1);
  --accent-happenings: #a78bfa; --accent-happenings-soft: rgba(167,139,250,0.1);
  --accent-lostfound: #60a5fa; --accent-lostfound-soft: rgba(96,165,250,0.1);
  --accent-neighbors: var(--primary-600); --accent-neighbors-soft: rgba(100,200,150,0.06);
  --accent-notes: var(--text-tertiary); --accent-notes-soft: var(--gray-100);
  --accent-success: #4ade80; --accent-success-soft: rgba(74,222,128,0.1);
  --accent-warning: #fbbf24; --accent-warning-soft: rgba(251,191,36,0.1);
  --accent-info: #38bdf8; --accent-info-soft: rgba(56,189,248,0.1);
  --accent-danger: #f87171; --accent-danger-soft: rgba(248,113,113,0.1);
}

/* ═══════════════════════════════════════════════════════════════
   SHARED TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] {
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.35);
  --shadow-xl: 0 20px 30px rgba(0,0,0,0.4);
}

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--surface-bg);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--primary-700); text-decoration: none; }
a:hover { color: var(--primary-600); }
[data-theme="dark"] a { color: var(--primary-600); }

/* ═══════════════════════════════════════════════════════════════
   THEME MENU — 3-dot trigger + popover pill
   ═══════════════════════════════════════════════════════════════ */
.theme-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* 3-dot trigger button */
.theme-trigger {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--surface-border);
  background: var(--surface-card); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease-out); flex-shrink: 0;
  color: var(--text-muted);
}
.theme-trigger:hover {
  border-color: var(--primary-600); color: var(--text-secondary);
  background: var(--surface-hover);
}
.theme-trigger svg {
  width: 18px; height: 18px; fill: currentColor;
}

/* Simple light/dark toggle button */
.theme-toggle-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--surface-border);
  background: var(--surface-card); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease-out); flex-shrink: 0;
  color: var(--text-muted);
}
.theme-toggle-btn:hover {
  border-color: var(--primary-600); color: var(--text-secondary);
  background: var(--surface-hover);
}
/* Show sun in dark mode, moon in light mode */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* Popover pill */
.theme-popover {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface-card);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  min-width: 240px;
  z-index: 500;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.theme-popover.open {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* In sidebar footer: open upward instead */
.admin-sidebar-footer .theme-popover {
  top: auto;
  bottom: calc(100% + 8px); /* Position above the button */
  left: 0; /* Align to left edge of button */
  right: auto;
  transform: translateY(6px) scale(0.97); /* Transform upward */
  z-index: 1000; /* Higher z-index to appear above sidebar content */
}
.admin-sidebar-footer .theme-popover.open {
  transform: translateY(0) scale(1);
}

/* Popover section labels */
.popover-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px;
}
.popover-divider {
  height: 1px; background: var(--surface-border); margin: 12px 0;
}

/* Mode toggle inside popover */
.mode-toggle {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface-inset); border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-full); padding: 3px;
  transition: all 0.3s ease;
  width: fit-content;
}
.mode-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; transition: all 0.25s var(--ease-out);
  color: var(--text-muted);
}
.mode-btn:hover { color: var(--text-secondary); }
.mode-btn.active {
  background: var(--primary-800); color: var(--text-inverted);
  box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .mode-btn.active {
  background: var(--primary-600); color: var(--surface-bg);
}

/* Scheme picker inside popover */
.scheme-picker {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.scheme-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid transparent; cursor: pointer;
  transition: all 0.2s var(--ease-out);
  position: relative;
}
.scheme-dot:hover { transform: scale(1.12); }
.scheme-dot.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--surface-card);
}
.scheme-dot[data-scheme="forest"] { background: #2d6a4f; }
.scheme-dot[data-scheme="terracotta"] { background: #c2592b; }
.scheme-dot[data-scheme="slate"] { background: #475569; }
.scheme-dot[data-scheme="sage"] { background: #5e7d5b; }
.scheme-dot[data-scheme="indigo"] { background: #4338ca; }

/* Active scheme label */
.scheme-active-label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
  margin-top: 6px; transition: color 0.3s;
}

/* ─── Compact theme toggle (admin header) ─────────────────── */
.theme-toggle-wrap {
  display: flex; align-items: center; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   SHARED PAGE ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ─── Page Container ──────────────────────────────────────── */
.vvc-container {
  max-width: 640px; margin: 0 auto;
  padding: calc(1.5rem + env(safe-area-inset-top, 0px)) calc(1.25rem + env(safe-area-inset-right, 0px)) calc(6rem + env(safe-area-inset-bottom, 0px)) calc(1.25rem + env(safe-area-inset-left, 0px));
}
.vvc-container--wide { max-width: 820px; }
.vvc-container--narrow { max-width: 560px; }

/* ─── Site Header (public pages) ──────────────────────────── */
.site-header {
  text-align: center; padding: 2rem 0 1.75rem; position: relative;
}
.site-header::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 48px; height: 3px; background: var(--primary-600); border-radius: 2px;
  transition: background 0.3s;
}
.site-logo {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 0.5rem;
  text-decoration: none;
}
.site-logo-mark {
  width: 40px; height: 40px; background: var(--primary-800); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: var(--text-inverted); font-size: 1rem; letter-spacing: -1px;
  transition: background 0.3s;
}
[data-theme="dark"] .site-logo-mark { background: var(--primary-600); color: var(--surface-bg); }
.site-title {
  font-size: 1.75rem; font-weight: 900; color: var(--text-primary);
  letter-spacing: -0.03em; line-height: 1.1; transition: color 0.3s;
}
.site-tagline {
  font-size: 0.875rem; color: var(--text-muted); font-weight: 500;
  margin-top: 0.375rem; letter-spacing: 0.01em; transition: color 0.3s;
}

/* ─── Admin Header ────────────────────────────────────────── */
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.75rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--surface-border); transition: border-color 0.3s;
}
.admin-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.admin-brand-mark {
  width: 32px; height: 32px; background: var(--primary-800); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: var(--text-inverted); font-size: 0.75rem; letter-spacing: -0.5px;
  transition: background 0.3s;
}
[data-theme="dark"] .admin-brand-mark { background: var(--primary-600); color: var(--surface-bg); }
.admin-brand-text {
  font-size: 1rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.02em; transition: color 0.3s;
}
.admin-breadcrumb { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.admin-nav { display: flex; gap: 6px; align-items: center; }

/* ─── Nav Button ──────────────────────────────────────────── */
.nav-btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--surface-border); background: var(--surface-card);
  color: var(--text-secondary); cursor: pointer; text-decoration: none;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 4px;
}
.nav-btn:hover { border-color: var(--primary-600); color: var(--primary-700); background: var(--primary-100); }
[data-theme="dark"] .nav-btn:hover { color: var(--primary-600); }

/* ─── Search ──────────────────────────────────────────────── */
.search-row {
  display: flex; align-items: center; gap: 8px; margin: 1.75rem 0;
}
.search-container { position: relative; flex: 1; }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; transition: color 0.3s;
}
.search-input {
  width: 100%; padding: 12px 16px 12px 44px;
  border: 1.5px solid var(--surface-border); border-radius: var(--radius-full);
  font-size: 0.875rem; font-family: inherit;
  background: var(--surface-card); color: var(--text-primary);
  transition: all 0.2s var(--ease-out); outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.12);
}
[data-theme="dark"] .search-input:focus { box-shadow: 0 0 0 3px rgba(82,183,136,0.08); }

/* ─── Filter Pills (public board) ─────────────────────────── */
.filter-pills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 1.25rem;
  animation: vvc-fadeInUp 0.4s var(--ease-out) 0.06s backwards;
}
.filter-pill {
  appearance: none; border: 1.5px solid var(--surface-border);
  background: var(--surface-card); color: var(--text-secondary);
  font-family: inherit; font-size: 0.7rem; font-weight: 600;
  text-align: center; padding: 6px 4px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s var(--ease-out);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-pill:hover {
  border-color: var(--primary-600); color: var(--primary-700);
  background: var(--primary-50);
}
.filter-pill.active {
  background: var(--primary-700); color: var(--text-inverted);
  border-color: var(--primary-700); font-weight: 700;
}
[data-theme="dark"] .filter-pill.active {
  background: var(--primary-600); border-color: var(--primary-600);
  color: var(--surface-bg);
}
@media (max-width: 480px) {
  .filter-pills { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Post Cards (public board) ───────────────────────────── */
.posts-stack { display: flex; flex-direction: column; gap: 8px; }

.post-card {
  background: var(--surface-card); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-out); position: relative; overflow: hidden;
  animation: vvc-fadeInUp 0.4s var(--ease-out) backwards;
}
.post-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%; border-radius: 0 2px 2px 0;
  opacity: 0; transition: opacity 0.25s var(--ease-out);
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.post-card:hover::before { opacity: 1; }

.post-card[data-section="ALERT"]::before { background: var(--accent-alert); }
.post-card[data-section="HAPPENINGS"]::before { background: var(--accent-happenings); }
.post-card[data-section="LOST_FOUND"]::before { background: var(--accent-lostfound); }
.post-card[data-section="NEIGHBORS"]::before { background: var(--accent-neighbors); }
.post-card[data-section="BOARD_NOTES"]::before { background: var(--accent-notes); }

.post-card.urgent { border-left: 3px solid var(--accent-alert); }
.post-card.urgent::before { display: none; }

.post-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 0.375rem;
}
.post-title {
  font-size: 1.0625rem; font-weight: 700; color: var(--text-primary);
  line-height: 1.35; letter-spacing: -0.01em; transition: color 0.3s;
}
.post-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.badge-urgent {
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; background: var(--accent-alert); color: white;
  padding: 2px 8px; border-radius: var(--radius-full);
}
.badge-pinned { font-size: 0.75rem; opacity: 0.6; }
.badge-top { font-size: 0.75rem; }

/* Section badges on flat feed */
.post-card .badge {
  font-size: 0.575rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Top post styling */
.post-card.top-post {
  border: 1.5px solid var(--primary-600);
  box-shadow: 0 0 0 1px var(--primary-200), var(--shadow-sm);
}
.post-card.top-post::before { background: var(--primary-600) !important; opacity: 1 !important; }
[data-theme="dark"] .post-card.top-post { border-color: var(--primary-500); }

.post-body {
  font-size: 0.8375rem; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: 0.5rem; transition: color 0.3s;
}
.post-body p { margin-bottom: 0.35rem; white-space: normal; }
.post-body p:last-child { margin-bottom: 0; }
.post-body img {
  max-width: 100%; height: auto; vertical-align: top;
  border-radius: var(--radius-sm); margin: 4px 2px; cursor: pointer;
}
.post-body p:has(> img) { text-align: center; }
.post-body video { max-width: 100%; border-radius: var(--radius-sm); margin: 6px 0; }
.post-body a { color: var(--primary-700); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="dark"] .post-body a { color: var(--primary-600); }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 6px 0; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: 2px; }
.post-body li p { margin-bottom: 0; }
.post-body blockquote { border-left: 3px solid var(--surface-border); padding-left: 10px; color: var(--text-tertiary); margin: 6px 0; }
/* Normalize legacy heading tags to body text size */
.post-body h1, .post-body h2, .post-body h3, .post-body h4, .post-body h5, .post-body h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0.35rem 0 0.2rem;
  color: inherit;
  line-height: 1.4;
}

.post-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text-muted); font-weight: 500; transition: color 0.3s;
}
.post-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); opacity: 0.5; }
.post-meta-section { font-weight: 600; color: var(--primary-700); }
[data-theme="dark"] .post-meta-section { color: var(--primary-500); }

/* Clickable post title */
a.post-title-link {
  font-size: 1.0625rem; font-weight: 700; color: var(--text-primary) !important;
  text-decoration: none; transition: color 0.15s;
  line-height: 1.35; letter-spacing: -0.01em;
}
a.post-title-link:hover { color: var(--primary-600) !important; text-decoration: underline; }
[data-theme="dark"] a.post-title-link { color: var(--text-primary) !important; }
[data-theme="dark"] a.post-title-link:hover { color: var(--primary-500) !important; }

/* Post footer (meta + actions row) */
.post-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
}
.post-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

/* Shared pill style for like + share */
.post-like-btn, .post-share-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--radius-full);
  border: 1.5px solid var(--surface-border); background: var(--surface-card);
  color: var(--text-secondary); font-size: 0.75rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.post-like-btn:hover, .post-share-btn:hover {
  border-color: var(--primary-500); color: var(--primary-700); background: var(--primary-100);
}
.post-like-btn.liked {
  border-color: var(--primary-600); color: var(--primary-700); background: var(--primary-100);
  cursor: default;
}
.post-like-btn.liked svg { fill: var(--primary-600); }
[data-theme="dark"] .post-like-btn:hover, [data-theme="dark"] .post-share-btn:hover {
  color: var(--primary-400); background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .post-like-btn.liked {
  color: var(--primary-400); border-color: var(--primary-500); background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .post-like-btn.liked svg { fill: var(--primary-500); }
.like-count { min-width: 8px; text-align: center; }

/* ─── Share Modal ────────────────────────────────────────── */
.share-modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.share-modal-backdrop.active { opacity: 1; pointer-events: auto; }
.share-modal {
  background: var(--surface-card); border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1.25rem; width: 90%; max-width: 380px;
  transform: translateY(12px); transition: transform 0.2s var(--ease-out);
}
.share-modal-backdrop.active .share-modal { transform: translateY(0); }
.share-modal-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
  margin: 0 0 0.75rem;
}
.share-modal-url {
  display: flex; gap: 6px; align-items: center;
}
.share-modal-url input {
  flex: 1; padding: 0.5rem 0.625rem; border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm); background: var(--surface-bg);
  color: var(--text-primary); font-size: 0.78rem; font-family: inherit;
  outline: none; min-width: 0;
}
.share-modal-url input:focus { border-color: var(--primary-500); }
.share-modal-copy {
  padding: 0.5rem 0.875rem; border: 1.5px solid var(--primary-600);
  border-radius: var(--radius-sm); background: var(--primary-600);
  color: white; font-size: 0.78rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.share-modal-copy:hover { background: var(--primary-700); }
.share-modal-copy.copied { background: var(--primary-800); }

/* ─── Individual Post Page ───────────────────────────────── */
.post-page-back {
  display: inline-block; font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; opacity: 0.7;
  transition: opacity 0.2s; margin-bottom: 0.25rem;
}
.post-page-back:hover { opacity: 1; color: var(--text-primary); }

/* ─── About Section ───────────────────────────────────────── */
.about-section {
  background: var(--surface-card); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-sm); margin-top: 2rem;
  border: 1px solid var(--surface-border); transition: all 0.3s;
}
.about-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--primary-800); margin-bottom: 0.5rem;
  transition: color 0.3s;
}
[data-theme="dark"] .about-title { color: var(--primary-600); }
.about-text {
  font-size: 0.8375rem; color: var(--text-tertiary); line-height: 1.7; transition: color 0.3s;
  white-space: pre-line;
}

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state-text { font-size: 1rem; font-weight: 600; color: var(--text-tertiary); margin-bottom: 0.25rem; }
.empty-state-sub { font-size: 0.8125rem; color: var(--text-muted); }

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer { text-align: center; padding: 2rem 0 1rem; }
.footer-text {
  font-size: 0.75rem; color: var(--text-muted); font-weight: 500; transition: color 0.3s;
}
.footer-text .dot {
  display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted); vertical-align: middle; margin: 0 8px; opacity: 0.5;
}

/* ─── FAB ─────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  right: calc(28px + env(safe-area-inset-right, 0px));
  width: 56px; height: 56px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-800), var(--primary-700));
  color: var(--text-inverted); border: none; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: all 0.3s var(--ease-spring); text-decoration: none; z-index: 100;
}
[data-theme="dark"] .fab { background: linear-gradient(135deg, var(--primary-600), var(--primary-500)); color: var(--surface-bg); }
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,0.3); color: var(--text-inverted); }
[data-theme="dark"] .fab:hover { color: var(--surface-bg); }
.fab:active { transform: scale(0.96); }
.fab svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2.5; fill: none; }

/* ─── Admin Return Link (inside container, admin-only) ── */
.admin-return-link {
  display: inline-block; margin-bottom: 0.25rem;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.01em;
  color: var(--text-muted); text-decoration: none; opacity: 0.65;
  transition: opacity 0.2s ease;
}
.admin-return-link:hover { opacity: 1; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   FORM ELEMENTS (shared)
   ═══════════════════════════════════════════════════════════════ */
.vvc-input, .vvc-select, .vvc-textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--surface-border); border-radius: var(--radius-sm);
  font-size: 0.875rem; font-family: inherit;
  background: var(--surface-card); color: var(--text-primary);
  outline: none; transition: all 0.2s var(--ease-out);
}
.vvc-input::placeholder, .vvc-textarea::placeholder { color: var(--text-muted); }
.vvc-input:focus, .vvc-select:focus, .vvc-textarea:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.12);
}
[data-theme="dark"] .vvc-input:focus,
[data-theme="dark"] .vvc-select:focus,
[data-theme="dark"] .vvc-textarea:focus { box-shadow: 0 0 0 3px rgba(82,183,136,0.06); }

.vvc-select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239d9fa5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.vvc-textarea { resize: vertical; min-height: 80px; }
.vvc-label {
  display: block; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 0.375rem; transition: color 0.3s;
}
.vvc-label .optional { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }
.vvc-hint { font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.375rem; line-height: 1.4; }
.field-group { margin-bottom: 1.25rem; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn-primary-vvc {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 24px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, var(--primary-800), var(--primary-700));
  color: var(--text-inverted); font-size: 0.875rem; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all 0.25s var(--ease-out);
}
[data-theme="dark"] .btn-primary-vvc { background: linear-gradient(135deg, var(--primary-600), var(--primary-500)); color: var(--surface-bg); }
.btn-primary-vvc:hover { filter: brightness(1.08); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary-vvc:active { transform: translateY(0); }
.btn-primary-vvc.full-width { width: 100%; }

.btn-outline-vvc {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm); background: var(--surface-card);
  color: var(--text-secondary); font-size: 0.8125rem; font-weight: 600;
  font-family: inherit; cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.btn-outline-vvc:hover { border-color: var(--text-tertiary); background: var(--surface-hover); color: var(--text-primary); }

/* ─── Back Link ───────────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
  text-decoration: none; transition: color 0.15s; margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--primary-700); }
[data-theme="dark"] .back-link:hover { color: var(--primary-600); }
.back-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── Privacy Note ────────────────────────────────────────── */
.privacy-note { text-align: center; margin-top: 1.25rem; }
.privacy-note-inner {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text-muted); font-weight: 500;
}
.privacy-note-inner svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── Page Title ──────────────────────────────────────────── */
.page-title-area { margin-bottom: 1.75rem; }
.page-title {
  font-size: 1.5rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 0.375rem; transition: color 0.3s;
}
.page-subtitle { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }

/* ─── Form Card ───────────────────────────────────────────── */
.form-card {
  background: var(--surface-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 1.75rem; transition: all 0.3s;
}

/* ─── Category Grid ───────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.category-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s var(--ease-out); background: var(--surface-card);
}
.category-option:hover { border-color: var(--gray-300); background: var(--surface-hover); }
.category-option.selected { border-color: var(--primary-600); background: var(--primary-100); }
.category-option input[type="radio"] { display: none; }
.category-icon { font-size: 1.25rem; flex-shrink: 0; }
.category-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); transition: color 0.3s; }
.category-option.selected .category-label { color: var(--primary-800); }
[data-theme="dark"] .category-option.selected .category-label { color: var(--primary-600); }

/* ─── Success Card ────────────────────────────────────────── */
.success-card {
  background: var(--surface-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 3rem 2rem; text-align: center;
}
.success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-100); color: var(--primary-700);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.success-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.success-title { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.success-text { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6; }
.success-actions { display: flex; gap: 10px; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   ADMIN-SPECIFIC STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ─── Alert Banners ───────────────────────────────────────── */
.alert-banner {
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 0.75rem;
  font-size: 0.8125rem; font-weight: 500; display: flex; align-items: center; gap: 8px;
  transition: all 0.3s;
}
.alert-banner.success { background: var(--accent-success-soft); color: var(--accent-success); border: 1px solid rgba(22,163,74,0.15); }
.alert-banner.warning { background: var(--accent-warning-soft); color: var(--accent-warning); border: 1px solid rgba(217,119,6,0.15); }
.alert-banner.danger { background: var(--accent-danger-soft); color: var(--accent-danger); border: 1px solid rgba(220,38,38,0.15); }
.alert-banner .alert-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.6; font-size: 1.1rem; padding: 0 4px;
}
.alert-banner .alert-close:hover { opacity: 1; }

/* ─── Required Field Indicator ────────────────────────────── */
.required-star { color: var(--accent-danger); font-weight: 700; }

/* ─── Validation Banner (below submit button) ────────────── */
.validation-banner {
  margin-top: 0.75rem; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 500; line-height: 1.5;
  background: var(--accent-danger-soft); color: var(--accent-danger);
  border: 1px solid rgba(220,38,38,0.15);
  animation: vvc-shake 0.4s ease;
}
.validation-banner ul { margin: 0.25rem 0 0 1.1rem; padding: 0; }
.validation-banner li { margin-bottom: 0.125rem; }

/* ─── Field Error State ──────────────────────────────────── */
.field-group.field-error .vvc-input,
.field-group.field-error .editor-wrapper {
  border-color: var(--accent-danger);
  box-shadow: 0 0 0 2px rgba(220,38,38,0.10);
}
.field-group.field-error .category-grid {
  outline: 2px solid var(--accent-danger);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}
@keyframes vvc-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ─── Admin Section Headers ───────────────────────────────── */
.admin-section { margin-bottom: 2.5rem; }
.admin-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1rem; padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-600); transition: border-color 0.3s;
}
.admin-section-title {
  font-size: 0.9375rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.01em; transition: color 0.3s;
}
.admin-section-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-full);
  background: var(--primary-800); color: var(--text-inverted);
  font-size: 0.6875rem; font-weight: 700; transition: background 0.3s;
}
[data-theme="dark"] .admin-section-count { background: var(--primary-600); color: var(--surface-bg); }
.admin-section-subtitle {
  font-size: 0.75rem; color: var(--text-muted); margin-left: auto; font-weight: 500;
}

/* ─── Post Rows (admin) ───────────────────────────────────── */
.post-row {
  background: var(--surface-card); border-radius: var(--radius-md);
  padding: 0.875rem 1.125rem; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-out);
}
.post-row:hover { box-shadow: var(--shadow-md); }
.post-row-header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 0.2rem; }
.post-row-title {
  font-size: 0.84rem; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.01em; transition: color 0.3s;
}

/* ─── Badges (admin) ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: var(--radius-full); white-space: nowrap;
}
.badge-section-ALERT { background: var(--accent-alert-soft); color: var(--accent-alert); }
.badge-section-HAPPENINGS { background: var(--accent-happenings-soft); color: var(--accent-happenings); }
.badge-section-LOST_FOUND { background: var(--accent-lostfound-soft); color: var(--accent-lostfound); }
.badge-section-NEIGHBORS { background: var(--accent-neighbors-soft); color: var(--accent-neighbors); }
.badge-section-BOARD_NOTES { background: var(--accent-notes-soft); color: var(--accent-notes); }
.badge-pinned-admin { background: var(--accent-warning-soft); color: var(--accent-warning); }
.badge-top-admin { background: var(--primary-100); color: var(--primary-700); font-weight: 700; }
[data-theme="dark"] .badge-top-admin { background: rgba(82,183,136,0.15); color: var(--primary-500); }
.badge-urgent-admin { background: var(--accent-danger); color: white; }
.badge-edited { background: var(--gray-100); color: var(--text-tertiary); }
.badge-mod { background: var(--primary-100); color: var(--primary-700); }
[data-theme="dark"] .badge-mod { color: var(--primary-600); }

/* ─── Post Row Content (mirrors .post-body for consistent rendering) ── */
.post-row-desc {
  font-size: 0.8375rem; color: var(--text-secondary); line-height: 1.6;
  margin: 0.375rem 0; transition: color 0.3s;
}
.post-row-desc p { margin-bottom: 0.35rem; white-space: normal; }
.post-row-desc p:last-child { margin-bottom: 0; }
.post-row-desc img {
  max-width: 100%; height: auto; vertical-align: top;
  border-radius: var(--radius-sm); margin: 4px 2px; cursor: pointer;
}
.post-row-desc p:has(> img) { text-align: center; }
.post-row-desc video { max-width: 100%; border-radius: var(--radius-sm); margin: 6px 0; }
.post-row-desc a { color: var(--primary-700); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="dark"] .post-row-desc a { color: var(--primary-600); }
.post-row-desc ul, .post-row-desc ol { padding-left: 1.5em; margin: 6px 0; }
.post-row-desc ul { list-style: disc; }
.post-row-desc ol { list-style: decimal; }
.post-row-desc li { margin-bottom: 2px; }
.post-row-desc li p { margin-bottom: 0; }
.post-row-desc blockquote { border-left: 3px solid var(--surface-border); padding-left: 10px; color: var(--text-tertiary); margin: 6px 0; }
/* Normalize legacy heading tags to body text size */
.post-row-desc h1, .post-row-desc h2, .post-row-desc h3, .post-row-desc h4, .post-row-desc h5, .post-row-desc h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0.35rem 0 0.2rem;
  color: inherit;
  line-height: 1.4;
}

.post-row-meta {
  font-size: 0.68rem; color: var(--text-muted); font-weight: 500;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap; transition: color 0.3s;
}
.post-row-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); opacity: 0.4; }
.post-row-share-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-family: monospace;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.post-row-share-link:hover { opacity: 1; color: var(--accent-primary); }

.mod-note-inline {
  font-size: 0.72rem; color: var(--text-tertiary); margin-top: 0.3rem;
  padding: 5px 9px; background: var(--surface-inset); border-radius: 6px; transition: all 0.3s;
}

/* ─── AI Panel ────────────────────────────────────────────── */
.ai-panel {
  background: var(--surface-inset); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-top: 0.5rem;
  border: 1px solid var(--surface-border); font-size: 0.72rem; transition: all 0.3s;
}
.ai-panel-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0.4rem; }
.ai-chip { display: inline-flex; align-items: center; gap: 4px; }
.ai-chip-label {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.ai-chip-value { font-weight: 600; font-size: 0.72rem; }
.urgency-LOW { color: var(--accent-success); }
.urgency-MEDIUM { color: var(--accent-warning); }
.urgency-HIGH { color: var(--accent-danger); }
.rec-APPROVE { color: var(--accent-success); }
.rec-FLAG { color: var(--accent-warning); }
.rec-REJECT { color: var(--accent-danger); }
.ai-reasoning { font-size: 0.72rem; color: var(--text-tertiary); font-style: italic; line-height: 1.5; }
.ai-pii-warning {
  font-size: 0.68rem; color: var(--accent-danger); font-weight: 600;
  display: flex; align-items: center; gap: 4px; margin-bottom: 0.3rem;
}

/* ─── Action Buttons (admin) ──────────────────────────────── */
.actions-row {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 0.6rem; align-items: center;
}
.action-group {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.actions-sep {
  width: 1px; height: 16px; background: var(--surface-border);
  margin: 0 2px; flex-shrink: 0; transition: background 0.3s;
}

.action-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; border-radius: var(--radius-sm);
  font-size: 0.68rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.15s; border: 1.5px solid transparent; white-space: nowrap;
}
.action-btn.approve { background: var(--accent-success); color: white; border-color: var(--accent-success); }
.action-btn.approve:hover { filter: brightness(1.1); }
.action-btn.reject { background: var(--accent-danger); color: white; border-color: var(--accent-danger); }
.action-btn.reject:hover { filter: brightness(1.1); }

.action-btn.outline { background: transparent; border-color: var(--surface-border); color: var(--text-secondary); }
.action-btn.outline:hover { border-color: var(--text-tertiary); background: var(--surface-hover); }

.action-btn.outline.top-post-action { border-color: var(--primary-200); color: var(--primary-700); }
.action-btn.outline.top-post-action:hover { background: var(--primary-50); }
.action-btn.outline.top-post-action.active { background: var(--primary-700); color: white; border-color: var(--primary-700); }
[data-theme="dark"] .action-btn.outline.top-post-action.active { background: var(--primary-600); border-color: var(--primary-600); }

.action-btn.outline.pin { border-color: var(--accent-warning-soft); color: var(--accent-warning); }
.action-btn.outline.pin:hover { background: var(--accent-warning-soft); }
.action-btn.outline.pin.active { background: var(--accent-warning); color: white; border-color: var(--accent-warning); }

.action-btn.outline.urgent-action { border-color: var(--accent-danger-soft); color: var(--accent-danger); }
.action-btn.outline.urgent-action:hover { background: var(--accent-danger-soft); }
.action-btn.outline.urgent-action.active { background: var(--accent-danger); color: white; border-color: var(--accent-danger); }

.action-btn.outline.ai { border-color: var(--accent-info-soft); color: var(--accent-info); }
.action-btn.outline.ai:hover { background: var(--accent-info-soft); }
.action-btn.outline.delete { border-color: var(--accent-danger-soft); color: var(--accent-danger); }
.action-btn.outline.delete:hover { background: var(--accent-danger-soft); }
.action-btn.outline.success { border-color: var(--accent-success-soft); color: var(--accent-success); }
.action-btn.outline.success:hover { background: var(--accent-success-soft); }
.action-btn.outline.warning { border-color: var(--accent-warning-soft); color: var(--accent-warning); }
.action-btn.outline.warning:hover { background: var(--accent-warning-soft); }
.action-btn.outline.undo { border-color: var(--accent-warning-soft); color: var(--accent-warning); }
.action-btn.outline.undo:hover { background: var(--accent-warning-soft); }

/* Status badges */
.badge-status-danger { background: var(--accent-danger-soft); color: var(--accent-danger); }
.badge-status-warning { background: var(--accent-warning-soft); color: var(--accent-warning); }

/* Text color utilities */
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }

.action-link {
  font-size: 0.75rem; font-weight: 600; color: var(--accent-info);
  cursor: pointer; border: none; background: none; padding: 2px 4px;
  font-family: inherit; transition: color 0.15s; text-decoration: none;
}
.action-link:hover { text-decoration: underline; color: var(--accent-info); }

.section-select {
  padding: 3px 24px 3px 8px; border: 1.5px solid var(--surface-border);
  border-radius: 6px; font-size: 0.71rem; font-weight: 600;
  font-family: inherit; background: var(--surface-card); color: var(--text-secondary);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239d9fa5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; transition: all 0.15s;
}
.section-select:focus { border-color: var(--primary-600); outline: none; box-shadow: 0 0 0 2px rgba(82,183,136,0.12); }

/* ─── Collapse Toggle ─────────────────────────────────────── */
.collapse-toggle {
  cursor: pointer; color: var(--accent-info); font-size: 0.75rem; font-weight: 600;
  border: none; background: none; padding: 2px 4px; font-family: inherit;
}
.collapse-toggle:hover { text-decoration: underline; }

/* ─── Inline Panels (edit, rewrite, mod note) ─────────────── */
.inline-panel {
  margin-top: 0.6rem; padding: 0.75rem; background: var(--surface-inset);
  border-radius: var(--radius-sm); border: 1px solid var(--surface-border); transition: all 0.3s;
}
.inline-panel .panel-actions { display: flex; gap: 6px; margin-top: 0.4rem; }
.admin-content .vvc-input,
.admin-content .vvc-select,
.admin-content .vvc-textarea {
  font-size: 0.8rem; padding: 7px 10px;
}
.admin-content .vvc-label { font-size: 0.72rem; }
.panel-btn-primary {
  padding: 5px 14px; border-radius: 6px; font-size: 0.72rem; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none;
  background: var(--primary-800); color: var(--text-inverted); transition: all 0.15s;
}
[data-theme="dark"] .panel-btn-primary { background: var(--primary-600); color: var(--surface-bg); }
.panel-btn-primary:hover { filter: brightness(1.1); }
.panel-btn-ghost {
  padding: 5px 14px; border-radius: 6px; font-size: 0.72rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  background: transparent; border: 1.5px solid var(--surface-border); color: var(--text-secondary); transition: all 0.15s;
}
.panel-btn-ghost:hover { border-color: var(--text-muted); }

/* ─── Composer (board notes) ──────────────────────────────── */
.composer-card {
  background: var(--surface-card); border-radius: var(--radius-md);
  padding: 1.25rem; box-shadow: var(--shadow-sm); transition: all 0.3s;
}
.composer-hint { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ─── Editor Wrapper (Tiptap) ─────────────────────────────── */
.editor-wrapper {
  border: 1.5px solid var(--surface-border); border-radius: var(--radius-sm);
  overflow: hidden; transition: all 0.2s var(--ease-out);
}
.editor-wrapper:focus-within { border-color: var(--primary-600); box-shadow: 0 0 0 3px rgba(82,183,136,0.1); }
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px;
  background: var(--surface-inset); border-bottom: 1px solid var(--surface-border); transition: all 0.3s;
}
.editor-toolbar button {
  background: none; border: 1px solid transparent; border-radius: 5px;
  padding: 4px 8px; font-size: 0.72rem; cursor: pointer;
  color: var(--text-tertiary); font-family: inherit; transition: all 0.15s;
}
.editor-toolbar button:hover { background: var(--surface-hover); color: var(--text-secondary); }
.editor-toolbar button.active { background: var(--primary-100); color: var(--primary-700); border-color: var(--primary-300); }
.editor-toolbar .sep { width: 1px; background: var(--surface-border); margin: 2px 4px; }

/* ─── Tiptap Editor Content (matches .post-body for WYSIWYG parity) ── */
.tiptap-content {
  min-height: 120px; padding: 10px 12px; outline: none;
  font-size: 0.8375rem; color: var(--text-secondary); line-height: 1.6;
  background: var(--surface-card);
}
.tiptap-content p { margin-bottom: 0.35rem; white-space: normal; }
.tiptap-content p:last-child { margin-bottom: 0; }
.tiptap-content img {
  max-width: 100%; height: auto; vertical-align: top;
  border-radius: var(--radius-sm); margin: 4px 2px; cursor: pointer;
}
.tiptap-content p:has(> img) { text-align: center; }
.tiptap-content video { max-width: 100%; border-radius: var(--radius-sm); margin: 6px 0; }
.tiptap-content a { color: var(--primary-700); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="dark"] .tiptap-content a { color: var(--primary-600); }
.tiptap-content ul, .tiptap-content ol { padding-left: 1.5em; margin: 6px 0; }
.tiptap-content ul { list-style: disc; }
.tiptap-content ol { list-style: decimal; }
.tiptap-content li { margin-bottom: 2px; }
.tiptap-content li p { margin-bottom: 0; }
.tiptap-content blockquote { border-left: 3px solid var(--surface-border); padding-left: 10px; color: var(--text-tertiary); margin: 6px 0; }
/* Normalize pasted legacy headings inside editor to body text size */
.tiptap-content h1, .tiptap-content h2, .tiptap-content h3, .tiptap-content h4, .tiptap-content h5, .tiptap-content h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0.35rem 0 0.2rem;
  color: inherit;
  line-height: 1.4;
}
.tiptap-content p.is-editor-empty:first-child::before {
  content: attr(data-placeholder); float: left; color: var(--text-muted); pointer-events: none; height: 0;
}
.tiptap-content .image-resizer { display: inline-block; position: relative; }
.tiptap-content .image-resizer img { display: block; max-width: 100%; }
.tiptap-content .image-resizer .resize-trigger {
  position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px;
  background: var(--primary-700); border: 2px solid var(--surface-card); border-radius: 2px; cursor: nwse-resize;
}

/* Admin editor — same font rendering, just smaller container */
.tiptap-content.admin-editor { min-height: 80px; padding: 8px; }

/* ─── Unified Rich Text Pattern (editor + rendered posts) ───── */
/* Single source of truth so admin editor, admin board, and public board match */
.post-body,
.post-row-desc,
.tiptap-content {
  font-size: 0.8375rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-body p,
.post-row-desc p,
.tiptap-content p {
  margin-bottom: 0.35rem;
  white-space: normal;
}

.post-body p:last-child,
.post-row-desc p:last-child,
.tiptap-content p:last-child { margin-bottom: 0; }

.post-body ul, .post-body ol,
.post-row-desc ul, .post-row-desc ol,
.tiptap-content ul, .tiptap-content ol {
  padding-left: 1.5em;
  margin: 6px 0;
}

.post-body li, .post-row-desc li, .tiptap-content li { margin-bottom: 2px; }
.post-body li p, .post-row-desc li p, .tiptap-content li p { margin-bottom: 0; }
.post-body li::marker, .post-row-desc li::marker, .tiptap-content li::marker { color: currentColor; }

/* Dark mode readability bump for rich text */
[data-theme="dark"] .post-body,
[data-theme="dark"] .post-row-desc,
[data-theme="dark"] .tiptap-content {
  color: #c8cdca;
}

/* ─── Super Admin Specifics ───────────────────────────────── */
.panel-card {
  background: var(--surface-card); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; margin-bottom: 12px; box-shadow: var(--shadow-sm); transition: all 0.3s;
}
.mod-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--surface-border); transition: border-color 0.3s;
}
.mod-row:last-child { border-bottom: none; }
.status-active { color: var(--accent-success); font-weight: 600; font-size: 0.75rem; }
.status-disabled { color: var(--accent-danger); font-weight: 600; font-size: 0.75rem; }
.model-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   ADMIN SIDEBAR LAYOUT
   ═══════════════════════════════════════════════════════════════ */

/* ─── Layout Shell ───────────────────────────────────────── */
.admin-layout {
  display: flex; min-height: 100vh; min-height: 100dvh;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.admin-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--surface-card);
  border-right: 1px solid var(--surface-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: background 0.3s, border-color 0.3s;
  overflow: visible; /* Allow popover to escape sidebar bounds */
}
[data-theme="dark"] .admin-sidebar {
  background: var(--surface-card);
}

.admin-sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--surface-border);
  transition: border-color 0.3s;
  flex-shrink: 0;
}
.admin-sidebar-header .admin-brand {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  margin-bottom: 2px;
}
.admin-sidebar-header .admin-breadcrumb {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-top: 4px;
  display: block;
}

/* ─── Sidebar Navigation ─────────────────────────────────── */
.admin-sidebar-nav {
  flex: 1; padding: 0.75rem 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  
  /* Styled scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--surface-border) transparent;
}
.admin-sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.admin-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.admin-sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: 3px;
}
.admin-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 1.25rem; margin: 1px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 600;
  color: var(--text-secondary); text-decoration: none;
  cursor: pointer; transition: all 0.15s var(--ease-out);
  position: relative;
  white-space: nowrap;
}
.sidebar-item:hover {
  background: var(--surface-hover); color: var(--text-primary);
}
.sidebar-item.active {
  background: var(--primary-100); color: var(--primary-800);
}
[data-theme="dark"] .sidebar-item.active {
  background: var(--primary-100); color: var(--primary-600);
}
.sidebar-item svg {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 1.75;
}
.sidebar-item-muted {
  opacity: 0.4;
  font-size: 0.75rem;
}
.sidebar-item-muted:hover { opacity: 0.7; }

/* Sidebar badge (pending count, etc.) */
.sidebar-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--accent-danger); color: white;
  font-size: 0.65rem; font-weight: 700;
}
.sidebar-badge.muted {
  background: var(--gray-200); color: var(--text-tertiary);
}

.sidebar-divider {
  height: 1px; background: var(--surface-border);
  margin: 8px 1.25rem;
  transition: background 0.3s;
}

.sidebar-section-label {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 12px 1.25rem 4px; margin-top: 4px;
}

/* ─── Sidebar Footer ─────────────────────────────────────── */
.admin-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--surface-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; transition: border-color 0.3s;
  margin-top: auto; /* Push to bottom, removes extra space */
  position: relative; /* Anchor for popover */
  flex-shrink: 0; /* Never shrink */
}

/* ─── Content Area ───────────────────────────────────────── */
.admin-content {
  flex: 1;
  margin-left: 260px;
  padding: 1.5rem 0 3rem; /* Remove horizontal padding from container */
  min-height: 100vh; min-height: 100dvh;
  overflow-y: auto;
  
  /* Center content with equal margins */
  display: flex;
  flex-direction: column;
  align-items: center;
  
  /* Styled scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--surface-border) transparent;
}
.admin-content > * {
  width: 100%;
  max-width: 900px;
  padding: 0 2rem; /* Letterbox padding */
}
.admin-content::-webkit-scrollbar {
  width: 8px;
}
.admin-content::-webkit-scrollbar-track {
  background: transparent;
}
.admin-content::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: 4px;
}
.admin-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── Tab Panels ─────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: vvc-fadeInUp 0.25s var(--ease-out); }

/* ─── Content Header (per-tab) ───────────────────────────── */
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; gap: 10px;
}
.content-title {
  font-size: 1.1rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.02em; transition: color 0.3s;
}
.content-subtitle {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
}

/* ─── Dashboard Stat Cards ───────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface-card); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-out); cursor: pointer;
  border: 1px solid var(--surface-border);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-value {
  font-size: 1.75rem; font-weight: 900; color: var(--text-primary);
  letter-spacing: -0.03em; line-height: 1;
}
.stat-card-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-top: 4px;
}
.stat-card.accent-danger .stat-card-value { color: var(--accent-danger); }
.stat-card.accent-success .stat-card-value { color: var(--accent-success); }
.stat-card.accent-warning .stat-card-value { color: var(--accent-warning); }
.stat-card.accent-info .stat-card-value { color: var(--accent-info); }

/* ─── Stats Strip (compact inline) ───────────────────────── */
.stats-strip {
  display: flex;
  gap: 2px;
  margin-bottom: 1rem;
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: 6px 4px;
  box-shadow: var(--shadow-sm);
}
.stats-strip-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.stats-strip-item:hover { background: var(--surface-hover); }
.stats-strip-val {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}
.stats-strip-val.accent-danger { color: var(--accent-danger); }
.stats-strip-val.accent-success { color: var(--accent-success); }
.stats-strip-val.accent-warning { color: var(--accent-warning); }
.stats-strip-val.accent-info { color: var(--accent-info); }
.stats-strip-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Quick Actions (dashboard) ──────────────────────────── */
.quick-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem;
}
.quick-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--surface-border); background: var(--surface-card);
  color: var(--text-secondary); cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.quick-action-btn:hover { border-color: var(--primary-600); color: var(--primary-700); background: var(--primary-100); }
.quick-action-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── Block List ─────────────────────────────────────────── */
.blocklist-table {
  width: 100%; border-collapse: collapse;
}
.blocklist-table th {
  text-align: left; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); padding: 8px 12px;
  border-bottom: 2px solid var(--surface-border);
}
.blocklist-table td {
  padding: 10px 12px; font-size: 0.8125rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-border); vertical-align: middle;
}
.blocklist-table tr:hover td { background: var(--surface-hover); }
.block-action-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--radius-full);
}
.block-action-badge.reject { background: var(--accent-danger-soft); color: var(--accent-danger); }
.block-action-badge.flag { background: var(--accent-warning-soft); color: var(--accent-warning); }

/* ─── Activity Log ───────────────────────────────────────── */
.audit-log-list { display: flex; flex-direction: column; gap: 0; }
.audit-log-entry {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8125rem;
}
.audit-log-entry:last-child { border-bottom: none; }
.audit-log-action {
  font-weight: 700; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 8px; border-radius: var(--radius-full);
  white-space: nowrap;
}
.audit-log-action.approve { background: var(--accent-success-soft); color: var(--accent-success); }
.audit-log-action.reject { background: var(--accent-danger-soft); color: var(--accent-danger); }
.audit-log-action.edit { background: var(--accent-info-soft); color: var(--accent-info); }
.audit-log-action.block { background: var(--accent-danger-soft); color: var(--accent-danger); }
.audit-log-action.pin { background: var(--accent-warning-soft); color: var(--accent-warning); }
.audit-log-action.default { background: var(--gray-100); color: var(--text-tertiary); }
.audit-log-details {
  flex: 1; color: var(--text-secondary); line-height: 1.4;
}
.audit-log-details .audit-user { font-weight: 600; color: var(--text-primary); }
.audit-log-time {
  font-size: 0.7rem; color: var(--text-muted); white-space: nowrap;
  margin-left: auto; flex-shrink: 0;
}

/* ─── Archive Filters ────────────────────────────────────── */
.archive-filters {
  display: flex; gap: 6px; margin-bottom: 1rem; flex-wrap: wrap;
}
.archive-filter-btn {
  padding: 5px 14px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--surface-border); background: var(--surface-card);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.archive-filter-btn:hover { border-color: var(--text-tertiary); }
.archive-filter-btn.active {
  background: var(--primary-800); color: var(--text-inverted);
  border-color: var(--primary-800);
}
[data-theme="dark"] .archive-filter-btn.active {
  background: var(--primary-600); color: var(--surface-bg);
  border-color: var(--primary-600);
}

/* ─── Mobile Sidebar Toggle ──────────────────────────────── */
.admin-sidebar-toggle {
  display: none; /* hidden on desktop */
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: calc(12px + env(safe-area-inset-left, 0px)); z-index: 300;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--surface-border); background: var(--surface-card);
  color: var(--text-secondary); cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.admin-sidebar-toggle:hover { border-color: var(--primary-600); color: var(--primary-700); }
.admin-sidebar-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Mobile sidebar backdrop */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 190;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 0.25s ease;
}
.sidebar-backdrop.visible { display: block; opacity: 1; }

/* ─── Mobile Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out), background 0.3s, border-color 0.3s;
    box-shadow: none;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .admin-sidebar-toggle { display: flex; }
  .admin-content {
    margin-left: 0; padding: 1.25rem 1rem 3rem;
    padding-top: calc(1.25rem + 52px + env(safe-area-inset-top, 0px)); /* room for hamburger + notch */
  }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes vvc-fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-header { animation: vvc-fadeInUp 0.5s var(--ease-out); }
.search-container { animation: vvc-fadeInUp 0.5s var(--ease-out) 0.05s backwards; }
.filter-pills { animation: vvc-fadeInUp 0.4s var(--ease-out) 0.06s backwards; }

/* Staggered card animations */
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }

/* ═══════════════════════════════════════════════════════════════
   SUBMITTER BADGE (admin only)
   ═══════════════════════════════════════════════════════════════ */
.badge-submitter {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.badge-submitter .submitter-count {
  font-weight: 400;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .vvc-container { padding: calc(1.25rem + env(safe-area-inset-top, 0px)) calc(1rem + env(safe-area-inset-right, 0px)) calc(5rem + env(safe-area-inset-bottom, 0px)) calc(1rem + env(safe-area-inset-left, 0px)); }
  .site-title { font-size: 1.5rem; }
  .post-card { padding: 0.875rem 1rem; }
  .fab { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: calc(20px + env(safe-area-inset-right, 0px)); width: 52px; height: 52px; }
  .category-grid { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .admin-nav { width: 100%; justify-content: flex-end; }
}

/* ═══════════════════════════════════════════════════════════════
   MAP PICKER & MINI-MAPS
   ═══════════════════════════════════════════════════════════════ */

/* Map pin button (Feather icon) */
.map-pin-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--surface-border);
  background: var(--surface-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-out);
  color: var(--text-muted);
  padding: 0;
}
.map-pin-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.map-pin-btn:hover {
  border-color: var(--primary-600);
  color: var(--primary-600);
  background: var(--surface-hover);
}
.map-pin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Submit page map container */
.submit-map-container {
  height: 280px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
}

.map-toggle {
  cursor: pointer;
  color: var(--primary-700);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 0;
  transition: color 0.15s ease;
}
.map-toggle:hover { color: var(--primary-600); }
.map-toggle .optional { font-weight: 400; color: var(--text-tertiary); }

#mapContainer {
  height: 300px;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
}
#mapContainer.show { display: block; }

.map-helper {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
}
.map-helper strong { color: var(--text-primary); }

.post-mini-map {
  height: 180px;
  border-radius: 10px;
  margin: 10px 0;
  border: 2px solid var(--surface-border);
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease;
}
/* Clickable overlay blocks scroll/wheel — lets layer toggle through */
.post-mini-map-wrap {
  position: relative;
  cursor: pointer;
}
.post-mini-map-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 999;
}
/* Layer toggle sits above the scroll-blocking ::before overlay (z-index 999) */
.post-mini-map .leaflet-bottom,
.post-mini-map .leaflet-top {
  z-index: 1000 !important;
  pointer-events: none !important;
}
.post-mini-map .leaflet-control-layer-toggle {
  pointer-events: auto !important;
}
.post-mini-map-wrap:hover .post-mini-map {
  border-color: var(--primary-600);
}
/* Hover chip — styled to match site design system */
.post-mini-map-wrap::after {
  content: 'Click to expand';
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-card);
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1001;
}
.post-mini-map-wrap:hover::after {
  opacity: 1;
}

/* Map modal */
.map-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
.map-modal.show {
  display: flex;
}
.map-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}
.map-modal-content {
  position: relative;
  width: 90vw;
  max-width: 1000px;
  height: 80vh;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  z-index: 10001;
}
.map-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10002;
  width: 40px;
  height: 40px;
  background: var(--surface-card);
  border: 1.5px solid var(--surface-border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-out);
  box-shadow: var(--shadow-md);
}
.map-modal-close:hover {
  background: var(--primary-700);
  color: var(--text-inverted);
  border-color: var(--primary-700);
}
.modal-map-container {
  width: 100%;
  height: 100%;
}

.leaflet-popup-content {
  color: #000 !important;
}
.map-popup-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #000;
}
.map-popup-content strong {
  display: block;
  margin-bottom: 4px;
  color: #000;
}
.map-popup-content small {
  color: #333;
}
.copy-address-btn {
  background: var(--primary-700);
  color: var(--text-inverted);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  margin-top: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease;
}
.copy-address-btn:hover { background: var(--primary-600); }

.admin-map-container {
  height: 250px;
  border-radius: 8px;
  margin: 8px 0;
  border: 1px solid var(--surface-border);
  overflow: hidden;
}
/* Layer toggle — override Leaflet .leaflet-bar defaults */
.leaflet-bar:has(.leaflet-control-layer-toggle) {
  border: none !important;
  box-shadow: none !important;
  background: none !important;
}
.leaflet-bar a.leaflet-control-layer-toggle,
.leaflet-bar a.leaflet-control-layer-toggle:link,
.leaflet-bar a.leaflet-control-layer-toggle:visited {
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: none !important;
  border-bottom: none !important;
  cursor: pointer;
  text-decoration: none !important;
  color: #333 !important;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: all 0.2s var(--ease-out);
  backdrop-filter: blur(4px);
}
.leaflet-bar a.leaflet-control-layer-toggle:hover {
  background: #fff !important;
  color: #111 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}
.leaflet-bar a.leaflet-control-layer-toggle.active {
  background: var(--primary-900, #1b4332) !important;
  color: var(--primary-200, #d8f3dc) !important;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.leaflet-bar a.leaflet-control-layer-toggle.active:hover {
  background: var(--primary-800, #2d6a4f) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}
/* Thumbnail toggle — smaller, punchy, sits above the scroll-blocking overlay */
.post-mini-map .leaflet-bar a.leaflet-control-layer-toggle {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px;
}
.post-mini-map .leaflet-control-layer-toggle svg {
  width: 13px;
  height: 13px;
}

.leaflet-control-rotate-btn {
  width: 30px !important;
  height: 30px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  line-height: 30px !important;
  text-align: center;
  background: white;
  cursor: pointer;
  text-decoration: none !important;
  color: #333 !important;
}
.leaflet-control-rotate-btn:hover {
  background: #f4f4f4;
  color: #000 !important;
}

.map-coord-display {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ─── Lightbox ────────────────────────────────────────────── */
.vvc-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; opacity: 0; transition: opacity 0.2s ease;
}
.vvc-lightbox.open { opacity: 1; }
.vvc-lightbox img {
  max-width: 92vw; max-height: 92vh; object-fit: contain;
  border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.vvc-lightbox-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
  background: none; border: none; color: #fff; font-size: 1.5rem;
  cursor: pointer; opacity: 0.7; transition: opacity 0.2s;
  line-height: 1; padding: 4px 8px;
}
.vvc-lightbox-close:hover { opacity: 1; }

/* ─── Stale Posts ─────────────────────────────────────────── */
.stale-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
  padding: 0 4px;
}
.stale-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  opacity: 0.5;
}
.stale-divider-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  opacity: 0.7;
  white-space: nowrap;
}
.post-age-old {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-hover);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* ─── Gate Page ─────────────────────────────────────────── */
.gate-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.gate-brand {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: 32px;
  user-select: none;
}
.gate-brand-mark {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}
.gate-brand-sub {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  line-height: 1;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gate-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 1.15rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.gate-input:focus {
  border-color: var(--accent);
}
.gate-input::placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.gate-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.gate-btn:hover { opacity: 0.88; }
.gate-btn:active { opacity: 0.75; }
.gate-error {
  color: var(--danger, #e53e3e);
  font-size: 0.85rem;
  margin: 0;
}

/* ─── Inline Edit Toggle ──────────────────────────────── */
.post-row .edit-view { display: none; }
.post-row.editing .edit-view { display: block; }
.post-row.editing .display-view { display: none; }
.post-row.editing { outline: 1px solid var(--primary-600); outline-offset: -1px; }

/* ─── Access Password Forms ────────────────────────────── */
.access-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.access-form-field { flex: 1; min-width: 140px; }
.access-form-row > .panel-btn-primary {
  padding: 7px 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Access Password Cards ────────────────────────────── */
.access-card { margin-bottom: 8px; }
.access-card--revoked { opacity: 0.5; }
.access-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.access-card-info { min-width: 0; }
.access-card-pw {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
  line-height: 1.4;
}
.access-card-pw--struck {
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 600;
}
.access-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.access-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.access-card-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.access-card-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.access-card-btn--danger {
  color: var(--danger, #e53e3e);
  border-color: color-mix(in srgb, var(--danger, #e53e3e) 40%, transparent);
}
.access-card-btn--danger:hover {
  color: #fff;
  background: var(--danger, #e53e3e);
  border-color: var(--danger, #e53e3e);
}

