/* =========================================================
   Crick3tSocial Nextdoor-style CSS (FINAL)
   - Font system updated to Nextdoor-like system stack
   - Base typography tuned (14px, weights, line-height)
   - No inline styles needed in PHP files
   ========================================================= */

/* Nextdoor-like system font stack (replaces Inter-first look) */
:root{
  --cs-font: system-ui, -apple-system, BlinkMacSystemFont,"Segoe UI", Roboto, Helvetica, Arial, sans-serif;
         }

/* Apply typography globally */
html,body{
  font-family: var(--cs-font) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* crick3tsocial-nextdoor.css
   A lightweight, Nextdoor-inspired UI kit for Crick3tSocial test pages.
*/
:root{
  --bg:#f6f7f9;
  --surface:#ffffff;
  --surface-2:#f2f4f7;
  --text:#0f172a;          /* slate-900 */
  --muted:#475569;         /* slate-600 */
  --muted-2:#64748b;       /* slate-500 */
  --border:#e5e7eb;        /* gray-200 */
  --brand:#1f7a3a;
  --brand-2:#0f5b26;
  --brand-soft:#e7f4eb;
  --shadow:0 1px 0 rgba(2,6,23,.04);
  --shadow-2:0 10px 30px rgba(2,6,23,.08);
  --radius:16px;
  --radius-sm:12px;
  --radius-xs:10px;
}

*{box-sizing:border-box;}
body{margin:0;background:var(--bg);color:var(--text);}

/* =========================================================
   CS SYSTEM OVERRIDES (authoritative) - keep at end of file
   Purpose: ensure cs-* layout works even if older styles exist
   ========================================================= */

:root{
  --cs-bg: var(--bg, #f6f7f9);
  --cs-card: var(--surface, #fff);
  --cs-text: var(--text, #0f172a);
  --cs-muted: var(--muted-2, #64748b);
  --cs-border: var(--border, #e5e7eb);
  --cs-brand: #1f7a3a;
  --cs-shadow: 0 2px 10px rgba(15,23,42,.06);
}

body.cs-app{
  background: var(--cs-bg);
  color: rgba(15,23,42,.92);
  margin: 0;

  /* Nextdoor-like base typography */
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ---- Layout grid ---- */
.cs-page{ width:100%; overflow-x:hidden; }
.cs-layout{
  display:grid !important;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items:start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px 28px;
}
.cs-left, .cs-center, .cs-right{ min-width:0; }

.cs-center{
  width:100%;
  max-width: 680px;
  justify-self: center;
}
.cs-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
}

/* Responsive */
@media (max-width: 1100px){
  .cs-layout{ grid-template-columns: 280px minmax(0, 1fr); }
  .cs-right{ display:none; }
}
@media (max-width: 900px){
  .cs-layout{ grid-template-columns: 1fr; gap: 12px; padding: 12px 12px 24px; }
  .cs-center{ max-width:100%; justify-self:stretch; }
  .cs-right{ display:none; }
}

/* ---- Topbar ---- */
.cs-topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15,23,42,.10);
}
.cs-topbar-inner{
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  padding: 0 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.cs-topbar-spacer{ height: 12px; }

.cs-brand{
  display:flex;
  align-items:center;
  gap: 10px;
  text-decoration:none;
  color: var(--cs-text);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.cs-brand-icon{
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: var(--cs-brand);
  color:#fff;
  font-weight: 900;
}
.cs-brand-text{ font-size: 18px; font-weight: 800; }

.cs-search{
  flex: 1;
  max-width: 520px;
  display:flex;
  align-items:center;
  gap:10px;
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 999px;
  padding: 8px 12px;
}
.cs-search input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  font-size: 14px;
}
.cs-search-icon{ color: rgba(15,23,42,.55); }

.cs-top-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}
.cs-icon-btn{
  width:40px;height:40px;
  border-radius:999px;
  display:grid;place-items:center;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  text-decoration:none;
  color: var(--cs-text);
  font-weight: 800;
}
.cs-avatar-btn{
  width:40px;height:40px;
  border-radius:999px;
  display:grid;place-items:center;
  background: rgba(31,122,58,.12);
  border:1px solid rgba(31,122,58,.25);
  text-decoration:none;
  color: var(--cs-brand);
  font-weight: 800;
}

@media (max-width: 900px){
  .cs-search{ display:none; }
}

/* ---- Tabs ---- */
.cs-tabs{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  margin: 4px 0 10px;
}
.cs-tab{
  border: 1px solid rgba(15,23,42,.14);
  background:#fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor:pointer;
  letter-spacing: -0.01em;
}
.cs-tab.is-active{
  background: rgba(31,122,58,.10);
  border-color: rgba(31,122,58,.25);
}

/* ---- Buttons ---- */
.cs-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  color: var(--cs-text);
  text-decoration:none;
  cursor:pointer;
}
.cs-btn-primary{
  background: var(--cs-brand);
  border-color: rgba(31,122,58,.35);
  color:#fff;
}
.cs-btn-ghost{
  background:#fff;
}
.cs-btn:disabled{ opacity:.6; cursor:not-allowed; }

/* ---- Cards / Utilities ---- */
.cs-card{
  background: var(--cs-card);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
  overflow:hidden;
}
.cs-card-pad{ padding: 14px; }

.cs-auth-title{ font-weight: 800; font-size: 16px; }
.cs-auth-sub{ margin-top: 8px; color: rgba(15,23,42,.75); font-weight: 500; }

.cs-row{ display:flex; }
.cs-gap-10{ gap:10px; }
.cs-wrap{ flex-wrap:wrap; }
.cs-mb-12{ margin-bottom:12px; }
.cs-mt-10{ margin-top:10px; }
.cs-mt-12{ margin-top:12px; }

.cs-hidden{ display:none !important; }

.cs-loadmore{
  display:flex;
  justify-content:center;
  margin: 14px 0 30px;
}

/* ---- Filter Bar (cs-*) ---- */
.cs-filterbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  background: rgba(31,122,58,.08);
  border: 1px solid rgba(31,122,58,.18);
  border-radius: 14px;
  margin-bottom: 12px;
}
.cs-filterpill{ font-weight: 700; color: rgba(15,23,42,.88); }
.cs-filterclear{
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor:pointer;
}

/* ---- Post cards ---- */
.cs-post{
  background: var(--cs-card);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
  overflow:hidden;
}
.cs-post-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 14px 8px;
}
.cs-post-user{ display:flex; align-items:center; gap:10px; min-width:0; }
.cs-avatar{
  width: 38px; height: 38px;
  border-radius: 999px;
  display:grid; place-items:center;
  background: rgba(31,122,58,.12);
  border: 1px solid rgba(31,122,58,.25);
  color: var(--cs-brand);
  font-weight: 800;
  flex: 0 0 auto;
}
.cs-name{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.1;
}
.cs-time{
  font-size: 12px;
  color: rgba(15,23,42,.55);
  font-weight: 500;
  margin-top:2px;
}
.cs-post-menu{
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  cursor:pointer;
  font-weight: 800;
}

.cs-post-body{
  padding: 6px 14px 10px;
  font-weight: 500;
  font-size: 14px;
  color: rgba(15,23,42,.90);
  line-height: 1.45;
  word-break: break-word;
}

.cs-post-media{
  width: 100%;
  overflow:hidden;
  border-top: 1px solid rgba(15,23,42,.06);
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.cs-post-media img{
  width:100%;
  max-width:100%;
  height:auto;
  display:block;
  object-fit: cover;
}

.cs-embed{ width:100%; max-width:100%; overflow:hidden; }
.cs-embed iframe{
  width:100% !important;
  max-width:100% !important;
  border:0;
  display:block;
  aspect-ratio: 16 / 9;
}

.cs-post-actions{
  display:flex;
  gap: 10px;
  padding: 10px 12px 12px;
}
.cs-post-actions button{
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor:pointer;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.cs-post-actions button:hover{
  background: rgba(15,23,42,.04);
}

/* ---- Link preview ---- */
.cs-linkcard{
  display:flex;
  gap: 12px;
  padding: 12px 14px;
  text-decoration:none;
  color: inherit;
}
.cs-linkcard-img{
  width:72px;
  height:72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(15,23,42,.08);
  flex: 0 0 auto;
}
.cs-linkcard-body{ min-width:0; }
.cs-linkcard-site{
  font-size: 12px;
  color: rgba(15,23,42,.60);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.cs-linkcard-title{ font-weight: 700; margin-top:2px; }
.cs-linkcard-desc{ font-size: 13px; color: rgba(15,23,42,.75); margin-top:4px; }

/* Skeleton (optional) */
.cs-linkcard-skel{ padding: 12px 14px; }
.cs-skel-line{
  height: 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
  margin: 8px 0;
}

/* ---- Right rail ---- */
.cs-railcard{
  background:#fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
}
.cs-railhead{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.cs-railtitle{ font-weight: 800; font-size: 16px; }
.cs-railsublabel{ color: rgba(15,23,42,.60); font-weight: 600; font-size: 12px; }
.cs-railrow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.10);
  background:#fff;
  text-decoration:none;
  font-weight: 600;
  color: var(--cs-text);
}
.cs-railmedia{
  width:100%;
  height: 140px;
  border-radius: 14px;
  background: #e5e7eb;
  background-image: linear-gradient(135deg, rgba(31,122,58,.10), rgba(34,197,94,.10));
}
.cs-railtext{
  color: rgba(15,23,42,.70);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 8px;
}
.cs-tagrow{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.cs-tag{
  display:inline-flex;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}

/* ---- Modal (cs-*) ---- */
.cs-modal{
  position: fixed;
  inset: 0;
  display:none;
  align-items:center;
  justify-content:center;
  background: rgba(15,23,42,.45);
  padding: 16px;
  z-index: 2000;
}
.cs-modal.show{ display:flex; }
.cs-modal-card{
  width: 100%;
  max-width: 680px;
  background:#fff;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: var(--cs-shadow);
  overflow:hidden;
}
.cs-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.cs-modal-title{ font-weight: 800; }
.cs-modal-close{
  width: 34px;height:34px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  cursor:pointer;
  font-weight: 800;
}
.cs-modal-body{ padding: 14px; }
.cs-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(15,23,42,.08);
}

/* Textarea + pills */
.cs-textarea{
  width:100%;
  min-height: 120px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  font-family: var(--cs-font);
}
.cs-textarea:focus{
  border-color: rgba(31,122,58,.35);
  box-shadow: 0 0 0 3px rgba(31,122,58,.12);
}
.cs-pill{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.03);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
  color: rgba(15,23,42,.82);
}

/* Paste preview */
.cs-paste-preview{
  margin-top: 12px;
  border:  1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  overflow:hidden;
}
.cs-paste-preview-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  background: rgba(15,23,42,.03);
}
.cs-paste-preview-title{ font-weight: 800; }
.cs-paste-remove{
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor:pointer;
}
.cs-paste-preview img{ width:100%; display:block; max-height: 340px; object-fit: contain; }

/* ---- Left Nav (cs-*) ---- */
.cs-left-card{
  position: sticky;
  top: 84px; /* below topbar */
  background:#fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 12px;
}
.cs-left-logo{
  display:flex;
  align-items:center;
  gap: 10px;
  text-decoration:none;
  color: var(--cs-text);
  font-weight: 800;
  padding: 8px 8px 10px;
}
.cs-left-logo-icon{
  width: 28px;height:28px;
  border-radius: 10px;
  display:grid;place-items:center;
  background: var(--cs-brand);
  color:#fff;
  font-weight: 900;
  line-height:1;
}
.cs-left-nav{ display:flex; flex-direction:column; gap: 6px; padding: 6px 4px 10px; }
.cs-left-link{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration:none;
  color: rgba(15,23,42,.88);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.cs-left-link:hover{ background: rgba(15,23,42,.04); }
.cs-left-link.is-active{
  background: rgba(31,122,58,.10);
  color: var(--cs-brand);
}
.cs-left-icon{
  width: 22px;
  height: 22px;
  display:grid;
  place-items:center;
  color: currentColor;
}
.cs-left-cta{ padding: 8px 4px 10px; }
.cs-post-btn{
  width:100%;
  height: 44px;
  border-radius: 999px;
  background: var(--cs-brand);
  border: 1px solid rgba(31,122,58,.35);
  color:#fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor:pointer;
}
.cs-left-links{
  padding: 10px 8px 4px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.cs-left-links a{
  color: rgba(15,23,42,.70);
  text-decoration:none;
  font-weight: 600;
  font-size: 14px;
}
.cs-left-links a:hover{ text-decoration: underline; }

@media (max-width: 900px){
  .cs-left-card{ position: static; top:auto; }
}
/* =========================================================
   CS SOCIAL UI PACK (Nextdoor-ish)
   Paste at the VERY END of crick3tsocial.css
   ========================================================= */

/* ---- Shared tokens ---- */
:root{
  --cs-danger:#dc2626;
  --cs-warn:#f59e0b;
  --cs-info:#2563eb;
  --cs-success:#16a34a;

  --cs-ring: 0 0 0 3px rgba(31,122,58,.14);
  --cs-ring2: 0 0 0 3px rgba(37,99,235,.14);
}

/* ---- Links / hashtags / mentions ---- */
a{ color: inherit; }
.hashtagLink,
.mentionLink{
  color: var(--cs-brand);
  text-decoration: none;
  font-weight: 700;
}
.hashtagLink:hover,
.mentionLink:hover{ text-decoration: underline; }
.hashtagLink:focus,
.mentionLink:focus{
  outline: none;
  box-shadow: var(--cs-ring);
  border-radius: 6px;
}

/* ---- Inputs / forms (consistent) ---- */
.cs-input,
.fb-input,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
select{
  font-family: var(--cs-font);
}

.cs-input,
.fb-input{
  height: 40px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 0 12px;
  background: #fff;
  outline: none;
  font-size: 14px;
}
.cs-input:focus,
.fb-input:focus{
  border-color: rgba(31,122,58,.35);
  box-shadow: var(--cs-ring);
}

.cs-helper{
  font-size: 12px;
  color: rgba(15,23,42,.62);
  margin-top: 6px;
  font-weight: 600;
}
.cs-error{ color: var(--cs-danger); }
.cs-success{ color: var(--cs-success); }

.cs-field{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.cs-label{
  font-size: 13px;
  font-weight: 700;
  color: rgba(15,23,42,.85);
}

/* Validation states */
.cs-input.is-invalid,
.fb-input.is-invalid{
  border-color: rgba(220,38,38,.55);
  box-shadow: 0 0 0 3px rgba(220,38,38,.14);
}
.cs-input.is-valid,
.fb-input.is-valid{
  border-color: rgba(22,163,74,.45);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}

/* ---- Alerts (inline) ---- */
.cs-alert{
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
  background: #fff;
  padding: 12px 12px;
  font-weight: 650;
  line-height: 1.35;
}
.cs-alert--info{
  border-color: rgba(37,99,235,.22);
  background: rgba(37,99,235,.06);
}
.cs-alert--warn{
  border-color: rgba(245,158,11,.28);
  background: rgba(245,158,11,.08);
}
.cs-alert--danger{
  border-color: rgba(220,38,38,.24);
  background: rgba(220,38,38,.06);
}
.cs-alert--success{
  border-color: rgba(22,163,74,.24);
  background: rgba(22,163,74,.06);
}

/* ---- Toasts (floating) ---- */
.cs-toasts{
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 3000;
  display:flex;
  flex-direction:column;
  gap: 10px;
  pointer-events:none;
}
.cs-toast{
  pointer-events:auto;
  min-width: 260px;
  max-width: 360px;
  background:#fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  padding: 12px 12px;
  box-shadow: 0 18px 40px rgba(2,6,23,.12);
  display:flex;
  gap: 10px;
  align-items:flex-start;
}
.cs-toast-icon{
  width: 30px; height: 30px;
  border-radius: 999px;
  display:grid; place-items:center;
  font-weight: 900;
  background: rgba(15,23,42,.05);
  border: 1px solid rgba(15,23,42,.08);
}
.cs-toast-body{ min-width:0; }
.cs-toast-title{ font-weight: 850; }
.cs-toast-text{
  margin-top: 4px;
  font-size: 13px;
  color: rgba(15,23,42,.72);
  font-weight: 600;
}
.cs-toast-close{
  margin-left:auto;
  width: 30px;height:30px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background:#fff;
  cursor:pointer;
  font-weight: 900;
}
.cs-toast--info .cs-toast-icon{ color: var(--cs-info); background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.18); }
.cs-toast--success .cs-toast-icon{ color: var(--cs-success); background: rgba(22,163,74,.08); border-color: rgba(22,163,74,.18); }
.cs-toast--warn .cs-toast-icon{ color: var(--cs-warn); background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.20); }
.cs-toast--danger .cs-toast-icon{ color: var(--cs-danger); background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.18); }

/* ---- Avatar sizes + badges ---- */
.cs-avatar-xs{ width: 24px; height: 24px; font-size: 12px; }
.cs-avatar-sm{ width: 32px; height: 32px; font-size: 13px; }
.cs-avatar-md{ width: 38px; height: 38px; font-size: 14px; }
.cs-avatar-lg{ width: 46px; height: 46px; font-size: 16px; }

.cs-badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
}
.cs-badge--verified{
  color: var(--cs-info);
  background: rgba(37,99,235,.07);
  border-color: rgba(37,99,235,.18);
}
.cs-badge--mod{
  color: var(--cs-success);
  background: rgba(22,163,74,.08);
  border-color: rgba(22,163,74,.18);
}
.cs-badge--admin{
  color: var(--cs-danger);
  background: rgba(220,38,38,.06);
  border-color: rgba(220,38,38,.18);
}

/* ---- Post header meta row (optional) ---- */
.cs-meta{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-top: 2px;
  color: rgba(15,23,42,.56);
  font-size: 12px;
  font-weight: 600;
}
.cs-dot{ opacity:.6; }

/* ---- Dropdown menus (post ⋯ / profile) ---- */
.cs-menu-wrap{ position: relative; }
.cs-menu{
  position:absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(2,6,23,.12);
  overflow:hidden;
  display:none;
  z-index: 2500;
}
.cs-menu.is-open{ display:block; }
.cs-menu a,
.cs-menu button{
  width:100%;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  background:#fff;
  border:0;
  text-decoration:none;
  color: rgba(15,23,42,.92);
  font-weight: 650;
  font-size: 14px;
  cursor:pointer;
}
.cs-menu a:hover,
.cs-menu button:hover{
  background: rgba(15,23,42,.04);
}
.cs-menu-sep{
  height: 1px;
  background: rgba(15,23,42,.08);
}

/* ---- Reactions / engagement bar ---- */
.cs-reactbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 14px 0;
  color: rgba(15,23,42,.62);
  font-size: 13px;
  font-weight: 650;
}
.cs-reactleft{
  display:flex;
  align-items:center;
  gap: 8px;
}
.cs-count-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.02);
}
.cs-action-active{
  background: rgba(31,122,58,.10) !important;
  border-color: rgba(31,122,58,.22) !important;
  color: var(--cs-brand) !important;
}

/* ---- Comments & replies ---- */
/* Works with your existing: #commentsWrap-xx, .fb-comments, .fb-comment-form */
.fb-comments{
  padding: 10px 12px 0;
}
.fb-comment{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  margin: 10px 0;
}
.fb-bubble{
  background: rgba(15,23,42,.03);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 0;
}
.fb-bubble strong{
  font-weight: 800;
  color: rgba(15,23,42,.92);
}
.fb-bubble div{
  margin-top: 4px;
  font-weight: 600;
  color: rgba(15,23,42,.86);
  line-height: 1.35;
  word-break: break-word;
}

/* Comment actions row (optional) */
.cs-comment-meta{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(15,23,42,.55);
  font-weight: 650;
}
.cs-comment-meta a{
  color: rgba(15,23,42,.65);
  text-decoration:none;
  font-weight: 750;
}
.cs-comment-meta a:hover{ text-decoration: underline; }

/* Reply indentation helpers */
.cs-reply{
  margin-left: 48px;
}
.cs-replyline{
  position: relative;
}
.cs-replyline::before{
  content:"";
  position:absolute;
  left: 18px;
  top: -10px;
  bottom: 0;
  width: 2px;
  background: rgba(15,23,42,.08);
}

/* Comment composer */
.fb-comment-form{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px 12px 12px;
}
.fb-send{
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--cs-brand);
  border: 1px solid rgba(31,122,58,.35);
  color:#fff;
  font-weight: 750;
  cursor:pointer;
  letter-spacing: -0.01em;
}
.fb-send:hover{ background: var(--brand-2, #0f5b26); }

/* ---- Empty state ---- */
.cs-empty{
  background:#fff;
  border: 1px dashed rgba(15,23,42,.18);
  border-radius: 16px;
  padding: 18px 14px;
  text-align:center;
}
.cs-empty-title{
  font-weight: 850;
  font-size: 16px;
}
.cs-empty-text{
  margin-top: 6px;
  color: rgba(15,23,42,.70);
  font-weight: 600;
  font-size: 13px;
}

/* ---- Loading: skeletons + spinner ---- */
.cs-skeleton{
  position: relative;
  overflow:hidden;
  background: rgba(15,23,42,.06);
  border-radius: 12px;
}
.cs-skeleton::after{
  content:"";
  position:absolute;
  inset:0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: cs-shimmer 1.2s infinite;
}
@keyframes cs-shimmer{
  100%{ transform: translateX(100%); }
}
.cs-skel-row{ height: 10px; margin: 10px 0; border-radius: 999px; }
.cs-skel-avatar{ width: 38px; height: 38px; border-radius: 999px; }
.cs-spinner{
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(15,23,42,.16);
  border-top-color: var(--cs-brand);
  animation: cs-spin .8s linear infinite;
}
@keyframes cs-spin{ to{ transform: rotate(360deg); } }

/* ---- Media grids (2/3/4 images) ---- */
.cs-media-grid{
  display:grid;
  gap: 6px;
  padding: 0;
}
.cs-media-grid img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  border-radius: 10px;
}
.cs-media-2{ grid-template-columns: 1fr 1fr; }
.cs-media-3{ grid-template-columns: 2fr 1fr; }
.cs-media-3 .cs-media-tall{ grid-row: span 2; }
.cs-media-4{ grid-template-columns: 1fr 1fr; }

/* Lightbox base (if you add JS later) */
.cs-lightbox{
  position: fixed;
  inset:0;
  background: rgba(15,23,42,.70);
  display:none;
  align-items:center;
  justify-content:center;
  z-index: 4000;
  padding: 16px;
}
.cs-lightbox.show{ display:flex; }
.cs-lightbox img{
  max-width: min(1000px, 96vw);
  max-height: 92vh;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(2,6,23,.30);
}

/* ---- Chat UI (right-bottom dock like Nextdoor) ---- */
.cs-chatdock{
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 340px;
  max-width: calc(100vw - 28px);
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  box-shadow: 0 18px 40px rgba(2,6,23,.14);
  overflow:hidden;
  z-index: 2800;
}
.cs-chathead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.cs-chathead-title{
  font-weight: 850;
}
.cs-chathead-actions{
  display:flex;
  gap: 8px;
}
.cs-chatbtn{
  width: 34px;height:34px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background:#fff;
  cursor:pointer;
  font-weight: 900;
}
.cs-chatlist{
  max-height: 320px;
  overflow:auto;
}
.cs-chatitem{
  display:flex;
  gap: 10px;
  padding: 10px 12px;
  cursor:pointer;
}
.cs-chatitem:hover{ background: rgba(15,23,42,.03); }
.cs-chatmeta{
  min-width:0;
}
.cs-chatname{ font-weight: 800; }
.cs-chatpreview{
  margin-top: 2px;
  font-size: 13px;
  color: rgba(15,23,42,.70);
  font-weight: 600;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.cs-unread{
  margin-left:auto;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--cs-brand);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight: 900;
  font-size: 12px;
}

/* Chat thread */
.cs-thread{
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding: 12px;
  max-height: 320px;
  overflow:auto;
  background: rgba(15,23,42,.02);
}
.cs-msg{
  max-width: 78%;
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,.08);
  background:#fff;
  font-weight: 600;
  line-height: 1.35;
}
.cs-msg.me{
  margin-left:auto;
  background: rgba(31,122,58,.10);
  border-color: rgba(31,122,58,.18);
}
.cs-chatcomposer{
  display:flex;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(15,23,42,.08);
  background:#fff;
}
.cs-chatcomposer input{
  flex:1;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 0 12px;
  outline:none;
}
.cs-chatcomposer input:focus{
  border-color: rgba(31,122,58,.35);
  box-shadow: var(--cs-ring);
}
.cs-chatcomposer button{
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(31,122,58,.35);
  background: var(--cs-brand);
  color:#fff;
  font-weight: 800;
  cursor:pointer;
}

/* Hide chat on small screens unless you want it */
@media (max-width: 900px){
  .cs-chatdock{ display:none; }
}

/* ---- Accessibility / focus ---- */
.cs-btn:focus,
.cs-post-btn:focus,
.cs-tab:focus,
.cs-icon-btn:focus,
.cs-avatar-btn:focus,
.cs-post-actions button:focus,
.fb-send:focus,
.cs-post-menu:focus{
  outline: none;
  box-shadow: var(--cs-ring);
}

/* ---- Small polish for "cards inside posts" ---- */
.cs-post .cs-linkcard{
  border-top: 1px solid rgba(15,23,42,.06);
}
.cs-post .cs-linkcard:hover{
  background: rgba(15,23,42,.02);
}

/* ---- Reduce motion (prefers-reduced-motion) ---- */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* =========================================================
   CS REACTION META (likes / comments) – Nextdoor style
   Append at END of crick3tsocial.css
   ========================================================= */

/* Meta row under post body */
.cs-reactbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 6px 14px 2px;
  font-size: 13px;
  color: rgba(15,23,42,.62);
  font-weight: 600;
}

.cs-reactleft{
  display:flex;
  align-items:center;
  gap: 8px;
}

/* Like count pill */
.cs-count-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.10);
  font-weight: 700;
  font-size: 13px;
}

/* Right side: comments count */
.cs-reactmeta{
  font-size: 12px;
  font-weight: 600;
  color: rgba(15,23,42,.55);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Like button states
   --------------------------------------------------------- */

.cs-post-actions{
  display:flex;
  gap: 10px;
  padding: 8px 12px 12px;
}

.cs-post-actions button{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor:pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

/* Hover */
.cs-post-actions button:hover{
  background: rgba(15,23,42,.04);
}

/* Active Like */
.cs-post-actions .cs-action-active{
  background: rgba(31,122,58,.12);
  border-color: rgba(31,122,58,.30);
  color: var(--cs-brand);
}

/* Accessibility focus */
.cs-post-actions button:focus{
  outline:none;
  box-shadow: 0 0 0 3px rgba(31,122,58,.18);
}

/* Mobile tightening */
@media (max-width: 480px){
  .cs-post-actions{
    gap: 6px;
  }
  .cs-post-actions button{
    padding: 7px 10px;
    font-size: 13px;
  }
}
/* =========================================================
   /* =========================================================
   CS LEFT NAV + DRAWER (CLEAN / SINGLE SOURCE OF TRUTH)
   ========================================================= */

/* Desktop left column exists (grid controls width) */
/*.cs-left{ position: sticky; }

/* Sticky nav card */
.cs-left-card{
  position: sticky;
  top: 84px; /* below topbar */
  max-height: calc(100vh - 96px);
  overflow: auto;
  overscroll-behavior: contain;
}

/* Subtle scrollbar (WebKit) */
.cs-left-card::-webkit-scrollbar{ width: 10px; }
.cs-left-card::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.14);
  border-radius: 10px;
  border: 3px solid rgba(255,255,255,.85);
}
.cs-left-card::-webkit-scrollbar-track{ background: transparent; }

/* Drawer variant: prevent boxed card inside drawer */
.cs-left-card--drawer{
  position: static !important;
  top: auto !important;
  max-height: none !important;
  overflow: visible !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Mobile: hide desktop left column entirely (drawer handles nav) */
@media (max-width: 900px){
  .cs-left{ display: none !important; }
}

/* -------- Mobile Drawer -------- */
.cs-drawer-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 2600;
}

.cs-drawer{
  position: fixed;
  top: 0; bottom: 0;
  left: 0;
  width: min(340px, 88vw);
  background: #fff;
  border-right: 1px solid rgba(15,23,42,.12);
  transform: translateX(-105%);
  transition: transform .18s ease;
  z-index: 2700;
  display: flex;
  flex-direction: column;
}

.cs-drawer-head{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 12px;
  border-bottom: 1px solid rgba(15,23,42,.08);
}

.cs-drawer-title{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 900;
}

.cs-drawer-close{
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  cursor:pointer;
  font-weight: 900;
}

.cs-drawer-body{
  padding: 12px;
  overflow: auto;
}

/* Open state */
body.cs-drawer-open{ overflow: hidden; }
body.cs-drawer-open .cs-drawer-overlay{
  opacity: 1;
  pointer-events: auto;
}
body.cs-drawer-open .cs-drawer{
  transform: translateX(0);
}

/* Hamburger button for header */
.cs-hamburger{
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: #fff;
  cursor: pointer;
  display: none; /* only mobile */
  font-weight: 900;
}

@media (max-width: 900px){
  .cs-hamburger{ display: grid; place-items: center; }
}

/* Safety: force 3-column grid on wide desktop */
@media (min-width: 1101px){
  .cs-layout{
    grid-template-columns: 280px minmax(0, 1fr) 340px !important;
  }
}

