/* ══════════════════════════════════════
   LOGIN & FORGOT-PASSWORD PAGES
══════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f3fe;
  padding: 24px 16px;
}

.login-card {
  background: #fff;
  border: 1px solid #e5e3f7;
  border-radius: 18px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(83,74,183,0.07);
}

/* Brand header */
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #534AB7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.login-brand-icon--lock  { background: #7F77DD; }
.login-brand-icon--mail  { background: #534AB7; }
.login-brand-icon--shield { background: #3C3489; }

.login-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}
.login-brand-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 1px;
}

/* Headings */
.login-title {
  font-size: 22px;
  font-weight: 600;
  color: #111;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.55;
  margin-bottom: 24px;
}

/* Error banner */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #b91c1c;
  margin-bottom: 18px;
}
/* Success banner (used on change-password page) */
.login-success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #15803d;
  margin-bottom: 18px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-pw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.login-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}
.login-input {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: #111;
  background: #fff;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.login-input:focus {
  border-color: #7F77DD;
  box-shadow: 0 0 0 3px rgba(127,119,221,0.18);
}
.login-input--code {
  font-size: 24px;
  letter-spacing: 10px;
  text-align: center;
  font-weight: 600;
  padding: 12px 14px;
}
.login-forgot {
  font-size: 12px;
  color: #534AB7;
  text-decoration: none;
  font-weight: 500;
}
.login-forgot:hover { text-decoration: underline; }

.login-submit {
  background: #534AB7;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}
.login-submit:hover { background: #3C3489; }
.login-submit:active { transform: scale(0.98); }

.login-back {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
}
.login-back:hover { color: #111; }

/* "Didn't get it? Resend" line */
.login-resend {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: #6b7280;
}
.login-resend-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #534AB7;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.login-resend-btn:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .login-card { padding: 28px 20px; border-radius: 16px; }
  .login-title { font-size: 19px; }
}

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

:root {
  --blue: #2563eb;
  --text: #111;
  --muted: #6b7280;
  --border: #e5e7eb;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #fff;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══════════════════════════════════════
   HERO & NAV
══════════════════════════════════════ */

.hero {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

.hero_micro { height: 75px; }

.hero-bg {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(14px) brightness(1.05) saturate(1.1);
  transform: scale(1.08);
}

.hero::before, .hero::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 200px;
  z-index: 2;
  pointer-events: none;
}
.hero::before { left: 0; background: linear-gradient(to right, rgba(255,255,255,0.95), transparent); }
.hero::after  { right: 0; background: linear-gradient(to left, rgba(255,255,255,0.95), transparent); }

.hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 260px;
  background: linear-gradient(to bottom, transparent, #fff);
  z-index: 2;
}

/* ── Topnav ── */
.topnav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  padding: 16px 24px;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 17px;
  color: #111;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.nav-pill {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 999px;
  padding: 4px 12px;
    text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(8px);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-pill:hover { background: rgba(255,255,255,0.96); color: #111; }
.nav-pill.active { background: #111; color: #fff; border-color: #111; }

.nav-search {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 999px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  width: 100%;
  max-width: 340px;
  cursor: text;
}

.nav-center {
  display: flex;
  width: 100%;
}

.nav-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  color: #111;
  flex: 1;
  min-width: 0;
}
.nav-search input::placeholder { color: #aaa; }

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-notif {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(0,0,0,0.1);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  color: #444;
  text-decoration: none;
}
.nav-notif:hover { background: rgba(255,255,255,0.96); }

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid #fff;
  line-height: 1;
}

/* kept for any legacy references */
.notif-dot {
  width: 7px; height: 7px;
  background: #ef4444;
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 7px;
  border: 1.5px solid #fff;
}

/* ── Notifications drawer ────────────────────────────────── */
.notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}
.notif-drawer {
  width: 380px;
  max-width: 100vw;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
.notif-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.notif-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background 0.1s, color 0.1s;
}
.notif-drawer-close:hover { background: #f3f4f6; color: var(--text); }
.notif-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 24px;
}

/* ── Notifications list (used in drawer) ─────────────────── */
.notifs-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 60px;
}
.notifs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.notifs-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0;
}
.notifs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--muted, #9ca3af);
  font-size: 15px;
}
.notifs-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-item {
  border-radius: 12px;
  transition: background 0.12s;
}
.notif-item.notif-unread {
  background: rgba(var(--blue-rgb, 59,130,246), 0.06);
}
.notif-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
}
.notif-link:hover { background: var(--hover, #f3f4f6); }
.notif-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}
.notif-avatar img { width: 100%; height: 100%; object-fit: cover; }
.notif-avatar-fallback {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.notif-body {
  flex: 1;
  min-width: 0;
}
.notif-text {
  margin: 0 0 3px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text, #111);
}
.notif-time {
  font-size: 12px;
  color: var(--muted, #9ca3af);
}
.notif-blurb {
  margin: 3px 0 4px;
  font-size: 12.5px;
  color: var(--muted, #6b7280);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.notif-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  margin-left: 8px;
  background: #f3f4f6;
}
.notif-unread-dot {
  width: 8px; height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: opacity 0.15s;
}
.nav-avatar:hover { opacity: 0.88; }

/* Avatar dropdown wrapper — needs relative so the menu is anchored to it */
.nav-avatar-wrap {
  position: relative;
}

/* Dropdown panel — fixed so it escapes overflow:hidden on .hero */
.nav-dropdown {
  position: fixed;
  right: 16px;   /* CSS owns this; never drifts off-screen */
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
  padding: 6px;
  z-index: 1000;
}

/* Individual items */
.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.nav-dd-item:hover {
  background: #f3f4f6;
}
.nav-dd-item svg {
  color: #6b7280;
  flex-shrink: 0;
}

/* Logout item gets a subtle separator above it */
.nav-dd-logout {
  color: #dc2626;
  margin-top: 2px;
  border-top: 1px solid #f3f4f6;
  border-radius: 0 0 8px 8px;
  padding-top: 10px;
}
.nav-dd-logout:hover {
  background: #fef2f2;
}
.nav-dd-logout svg {
  color: #dc2626;
}

/* ══════════════════════════════════════
   EVENT DETAIL
══════════════════════════════════════ */

.content {
  position: relative;
  z-index: 5;
  max-width: 640px;
  margin: -400px auto 0;
  padding: 0 28px 0;
}

.content .extra_wide{
  width: 150%;
  margin-left: -25%;
}

.event-image {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 6px 28px rgba(0,0,0,0.13);
  aspect-ratio: 16/9;
  border: 5px solid #fff;
}
.event-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Hero image carousel ── */
.hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Alpine transition classes for the crossfade */
.hero-fade-enter { transition: opacity 0.6s ease; }
.hero-fade-start { opacity: 0; }
.hero-fade-end   { opacity: 1; }

/* Caption pill for feed slideshow */
.hero-caption {
  position: absolute;
  bottom: 36px; /* sit above the dots */
  left: 12px;
  z-index: 3;
  display: inline-block;
  max-width: calc(100% - 24px);
  padding: 4px 12px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-caption:hover { background: rgba(0,0,0,0.72); color: #fff; }

/* Tagged-people pill — lower right of feed slideshow */
.hero-people {
  position: absolute;
  bottom: 36px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  max-width: calc(50% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-people svg { flex-shrink: 0; opacity: 0.85; }

.hero-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s;
}
.hero-dot:hover   { background: rgba(255,255,255,0.75); }
.hero-dot-active  { background: rgba(255,255,255,0.95) !important; transform: scale(1.35); }

/* Fullscreen expand button */
.hero-expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.42);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, opacity 0.18s;
  opacity: 0;
}
.event-image:hover .hero-expand-btn { opacity: 1; }
.hero-expand-btn:hover { background: rgba(0,0,0,0.68); }

/* ── Fullscreen overlay (CSS fixed layer — no native API) ── */
.fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0,0,0,0.96);
  display: block; /* Alpine x-show sets inline display:none when hidden; removing it reveals this */
}
.fs-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.fs-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9991;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.fs-close:hover { background: rgba(255,255,255,0.3); }
.fs-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9991;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.13);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.fs-nav:hover { background: rgba(255,255,255,0.28); }
.fs-prev { left: 18px; }
.fs-next { right: 18px; }
/* Hide nav chrome while fullscreen carousel is open */
body.fs-open .topnav,
body.fs-open .bottom-nav { display: none !important; }

.fs-caption {
  position: fixed;
  bottom: 52px; /* sit above the fs-dots */
  left: 18px;
  z-index: 1002;
  display: inline-block;
  max-width: calc(100vw - 36px);
  padding: 5px 14px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-caption:hover { background: rgba(0,0,0,0.75); color: #fff; }

.fs-dots {
  position: fixed;
  bottom: 22px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 9991;
}
.fs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s;
}
.fs-dot:hover, .fs-dot-active, .fs-dot.active { background: rgba(255,255,255,0.95); }

/* ── Post fullscreen (expand button + overlay) ── */
.post-fs-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 11;
  background: rgba(0,0,0,0.45);
  border: none;
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}
.post-fs-expand-btn:hover { background: rgba(0,0,0,0.72); }

/* Slide wrapper inside the post fullscreen overlay */
.post-fs-slide {
  position: absolute;
  inset: 0;
}

/* Counter pill top-left when in post fullscreen multi-image */
.post-fs-counter {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 9991;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Info panel at bottom of post fullscreen */
.post-fs-info {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  z-index: 9992;
  font-size: 13px;
  line-height: 1.5;
  max-height: 35vh;
  overflow-y: auto;
}
.post-fs-username {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  margin-right: 4px;
}
.post-fs-info a.post-hashtag { color: #93c5fd; }
.post-fs-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.post-fs-people { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.post-fs-people .post-tagged-chip {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}

.badge {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: #111;
  backdrop-filter: blur(6px);
}

.event-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #6b7280);
  text-decoration: none;
  transition: color 0.12s;
}
.event-breadcrumb:hover {
  color: var(--color-text-primary, #111827);
}

.event-title {
  font-family: 'DM Serif Display', serif;
  font-size: 27px;
  font-weight: 400;
  margin-top: 10px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.event-meta {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); display: inline-block; }

/* Location */
.location-block {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  height: 90px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.location-block:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

/* Sub-event schedule cards */
.subevent-section { margin-top: 20px; }
.subevent-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.subevent-list { display: flex; flex-direction: column; gap: 8px; }
.subevent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
}
.subevent-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); border-color: #d1d5db; }
.subevent-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #f3f4f6;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.subevent-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.subevent-thumb-icon { width: 26px; height: 26px; color: #9ca3af; }
.subevent-date {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 38px;
}
.subevent-month {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.subevent-day {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.subevent-info { flex: 1; min-width: 0; }
.subevent-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subevent-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subevent-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
}
.subevent-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #9ca3af;
}

/* Pinned posts — admin-curated highlight cards */
.pinned-section { margin-top: 20px; }
.pinned-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.pinned-section-icon { color: #d97706; flex-shrink: 0; }
.pinned-list { display: flex; flex-direction: column; gap: 8px; }
.pinned-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
}
.pinned-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); border-color: #d1d5db; }
.pinned-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #f3f4f6;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pinned-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pinned-thumb-icon { width: 26px; height: 26px; color: #9ca3af; }
.pinned-info { flex: 1; min-width: 0; }
.pinned-caption {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pinned-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.pinned-author {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.pinned-stats {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pinned-stats svg { flex-shrink: 0; }

.location-map {
  width: 110px;
  flex-shrink: 0;
  background: #e8eeea;
  position: relative;
  overflow: hidden;
}
.location-map::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 70%, rgba(255,255,255,0.15));
  pointer-events: none;
  z-index: 1;
}

.location-info {
  flex: 1;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  background: #fff;
}
.location-name { font-size: 13.5px; font-weight: 600; color: #111; line-height: 1.2; }
.location-address { font-size: 12px; color: var(--muted); line-height: 1.4; }
.location-directions {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.location-directions:hover { text-decoration: underline; }

/* Guests */
.guests-row { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.guests-label { font-size: 13.5px; color: #444; font-weight: 500; }
.avatar-stack { display: flex; }

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-left: -7px;
  flex-shrink: 0;
}
.avatar:first-child { margin-left: 0; }
.av-count { background: #9ca3af; font-size: 9px; }

.view-link { color: var(--blue); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }

/* Check in */
.btn-checkin {
  margin-top: 20px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 30px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}
.btn-checkin.liked { background: #e24b4a; }

/* Tabs */
.tabs {
  margin-top: 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 4px;
}

.tab {
  padding: 10px 22px 10px 0;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  white-space: nowrap;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.desc-label { margin-top: 22px; font-size: 13px; color: var(--muted); font-weight: 500; }
.desc-body { margin-top: 10px; font-size: 14.5px; line-height: 1.68; color: #333; }

.cohost-row {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  padding-bottom: 36px;
}
.cohost-label { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ══════════════════════════════════════
   MOMENTS FEED
══════════════════════════════════════ */

.feed-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 28px 60px;
  border-top: 1px solid var(--border);
}

/* When feed-section lives inside .content, the parent already constrains
   width and provides horizontal padding — reset to avoid doubling. */
.content .feed-section {
  max-width: none;
  margin: 0;
  padding: 0 0 60px;
}



.moments-empty-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 24px;
  color: var(--muted, #9ca3af);
  text-align: center;
}
.moments-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #111);
  margin: 0;
}
.moments-empty-sub {
  font-size: 14px;
  color: var(--muted, #9ca3af);
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}
.moments-empty-sub strong { color: var(--text, #111); }

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 20px;
}

.feed-title { font-family: 'DM Serif Display', serif; font-size: 20px; font-weight: 400; letter-spacing: -0.01em; }
.feed-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.feed-explore { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.feed-explore > span { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Feed search bar */
.feed-search {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.feed-search-input {
  height: 34px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface, #f3f4f6);
  font-size: 13px;
  color: var(--text);
  width: 160px;
  outline: none;
  transition: border-color 0.15s, width 0.2s;
}
.feed-search-input:focus {
  border-color: var(--accent, #6366f1);
  width: 200px;
}
.feed-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface, #f3f4f6);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.feed-search-btn:hover { background: var(--accent, #6366f1); color: #fff; border-color: var(--accent, #6366f1); }
.feed-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface, #f3f4f6);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
}
.feed-search-clear:hover { background: var(--border); color: var(--text); }

.feed-add-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.feed-add-btn:hover { background: #f9fafb; border-color: #d1d5db; }

/* Post card */
.post {
  margin-bottom: 24px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  width: 100%;
  min-width: 0;
  transition: box-shadow 0.2s;
}
.post:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
}
.post-user { display: flex; align-items: center; gap: 10px; }

.post-avatar-ring {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
  padding: 2.5px;
  flex-shrink: 0;
}
.post-avatar-ring img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2.5px solid #fff;
}

.post-user-info { display: flex; flex-direction: column; gap: 1px; }
.post-username { font-size: 13.5px; font-weight: 600; color: #111; line-height: 1.2; }
.post-time { font-size: 11.5px; color: var(--muted); }
.post-event-crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  text-align: right;
}
.post-crumb-link {
  font-size: 13px;
  color: #6366f1;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.post-crumb-link:hover { text-decoration: underline; }
.post-crumb-sep { font-size: 12px; color: var(--muted); }

/* Post image */
.post-image {
  width: 100%;
  overflow: hidden;
  position: relative;
  background: #f3f4f6;
  display: block;
}
.post-image img {
  width: 100%; height: auto;
  display: block;
  max-width: 100%;
}

/* ── Post video player ── */
.post-image-video {
  width: 100%;
  background: #000;
  display: block;
  position: relative;
}
.post-video-player {
  width: 100%;
  height: auto;
  max-height: 70vh;
  background: #000;
  display: block;
  /* preserve aspect ratio */
  object-fit: contain;
}

/* Pending / processing placeholder */
.post-video-pending {
  width: 100%;
  min-height: 200px;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 16px;
  box-sizing: border-box;
}
.post-video-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: video-spin 0.8s linear infinite;
}
@keyframes video-spin {
  to { transform: rotate(360deg); }
}
.post-video-pending-label {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  text-align: center;
}

/* Failed state */
.post-video-failed {
  width: 100%;
  min-height: 120px;
  background: #1a0000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  box-sizing: border-box;
}
.post-video-failed-icon {
  font-size: 28px;
}
.post-video-failed-label {
  color: rgba(255,100,100,0.85);
  font-size: 13px;
  text-align: center;
}

/* ── Post carousel ── */
.post-carousel {
  user-select: none;
}

.post-carousel-slide {
  width: 100%;
  height: auto;
  display: block;
}

/* Video inside post */
.post-media-video {
  width: 100%;
  height: auto;
  max-height: 80vh;
  display: block;
  background: #000;
}

/* Arrows */
.post-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
  backdrop-filter: blur(4px);
}
.post-carousel-btn:hover { background: rgba(0,0,0,0.65); }
.post-carousel-prev { left: 10px; }
.post-carousel-next { right: 10px; }

/* Dot row */
.post-carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 10;
}
.post-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}
.post-carousel-dot.active {
  background: #fff;
  transform: scale(1.25);
}

/* Counter badge top-left */
.post-carousel-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  z-index: 10;
  backdrop-filter: blur(4px);
  letter-spacing: 0.03em;
}

/* ── Photo tagging ── */

/* Wrapper for each carousel slide */
.post-carousel-slot {
  position: relative;
  width: 100%;
}

/* Wrappers for post-detail hero slides and single hero image */
.hero-slide-wrap,
.hero-tagger-wrap {
  position: absolute;
  inset: 0;
}

/* Crosshair cursor when placing a tag */
.tag-cursor { cursor: crosshair !important; }

/* Tag circles layer — sits over the image */
.tag-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.tag-pins-active { pointer-events: auto; }

/* Individual tag pin — positioned by left/top % */
.tag-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* The circle button */
.tag-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.tag-circle:hover { background: rgba(0,0,0,0.65); transform: scale(1.08); }

/* Name pill below the circle */
.tag-label {
  pointer-events: auto;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, background 0.15s;
}
.post:hover .tag-label,
.event-image:hover .tag-label { opacity: 1; }
.tag-label:hover { background: rgba(0,0,0,0.82); }

/* × remove button (visible only in tagMode) */
.tag-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239,68,68,0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.tag-remove-btn:hover { background: #ef4444; }

/* "Tag people" button — bottom-right corner of the image */
.tag-people-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.tag-people-btn:hover { background: rgba(0,0,0,0.72); }
.tag-people-btn-active { background: rgba(255,255,255,0.18); }

/* Fixed search panel (appended to body, escapes overflow:hidden) */
.tag-search-panel {
  font-family: inherit;
}
.tag-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  background: #f9fafb;
  color: #111;
  outline: none;
}
.tag-search-input:focus { border-color: #6b7280; }
.tag-search-results {
  margin-top: 6px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tag-search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.1s;
}
.tag-search-item:hover { background: #f3f4f6; }
.tag-search-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.tag-search-name { font-size: 13px; color: #111; }
.tag-search-empty { font-size: 12px; color: #6b7280; padding: 6px 8px; }

/* Actions */
.post-actions {
  display: flex;
  align-items: center;
  padding: 10px 12px 4px;
  gap: 2px;
}

.act {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #222;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.12s;
}
.act:hover { background: #f3f4f6; }
.act.liked .heart { fill: #ef4444; stroke: #ef4444; }

/* Like/reaction split: icon button + count button side-by-side */
.act-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.act-wrap .act-icon {
  /* icon only — no count inside */
  padding-right: 4px;
}
.act-count {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #374151;
  padding: 6px 6px 6px 2px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.act-count:hover { background: #f3f4f6; color: #111; }
.act-count-zero { color: #9ca3af; padding: 6px 6px 6px 2px; font-size: 13px; font-weight: 500; }

/* Reactor popup */
[x-cloak] { display: none !important; }
.reactor-popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 120;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 6px 0;
  min-width: 160px;
  max-width: 220px;
  max-height: 260px;
  overflow-y: auto;
}
.reactor-popup-loading {
  display: flex;
  justify-content: center;
  padding: 12px;
}
.reactor-popup-spinner {
  width: 20px; height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: video-spin 0.7s linear infinite;
}
.reactor-popup-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
}
.reactor-popup-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}
.reactor-popup-user:hover { background: #f9fafb; }
.reactor-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.reactor-name {
  font-size: 13px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Edit post button */
.post-edit-btn { color: #9ca3af; }
.post-edit-btn:hover { background: #f0f4ff; color: #2563eb; }

/* Delete post button — pushes to far right, red on hover */
.post-delete-btn { margin-left: auto; color: #9ca3af; }
.post-delete-btn:hover { background: #fef2f2; color: #ef4444; }

/* Post detail edit + delete action row */
.pdp-post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 0;
}
.pdp-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.pdp-edit-btn:hover { background: #f0f4ff; color: #2563eb; border-color: #bfdbfe; }
.pdp-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  color: #9ca3af;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.pdp-delete-btn:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }

/* Emoji picker */
.act.emoji-btn { position: relative; }

.emoji-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 125%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  padding: 10px 10px;
  z-index: 100;
  /* width: 220px; */
}
.emoji-picker.open {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  align-items: center;
}
.emoji-picker::after {
  content: '';
  position: absolute;
  top: 100%; left: 40%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
  filter: drop-shadow(0 1px 0 #e5e7eb);
}

.emoji-opt {
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  line-height: 1;
  transition: transform 0.12s, background 0.1s;
  border: none;
  background: none;
  text-align: center;
  width: 100%;
}
.emoji-opt:hover { transform: scale(1.25); background: #f3f4f6; }

/* Reactions */
.reactions-row {
  padding: 0 20px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Reaction chip: wrapper groups emoji toggle + count popup button */
.reaction-chip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  border: 1.5px solid transparent;
  border-radius: 999px;
  transition: border-color 0.12s, background 0.12s;
}
.reaction-chip-wrap:has(.reaction-chip-emoji.mine) {
  background: #eff6ff;
  border-color: #93c5fd;
}
.reaction-chip-wrap:hover { background: #e9f0fe; border-color: #bfdbfe; }

.reaction-chip,
.reaction-chip-emoji {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: none;
  border: none;
  border-radius: 999px 0 0 999px;
  padding: 3px 4px 3px 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.reaction-chip-emoji .e { font-size: 16px; line-height: 1; }
.reaction-chip-emoji.mine .e { /* already handled by wrapper */ }

.reaction-chip-count {
  background: none;
  border: none;
  border-radius: 0 999px 999px 0;
  padding: 3px 9px 3px 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.reaction-chip-count:hover { color: #111; }

.post-likes { padding: 2px 20px 0; font-size: 13.5px; font-weight: 600; color: #111; }

.post-caption { padding: 5px 20px 0; font-size: 13.5px; line-height: 1.55; color: #333; }
.post-caption strong { font-weight: 600; color: #111; margin-right: 5px; }
.tags { color: var(--blue); font-weight: 500; }

/* Tagged people row — shown beneath the caption on cards and detail page */
.post-tagged-people,
.pdp-tagged-people {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 20px 0;
}
.post-tagged-label { font-size: 12px; color: var(--muted); }
.post-tagged-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  background: var(--surface, #f3f4f6);
  border-radius: 20px;
  padding: 2px 8px 2px 3px;
  transition: background 0.15s;
}
.post-tagged-chip:hover { background: var(--border); }
.post-tagged-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}
/* On the detail page, give it a little more breathing room */
.pdp-tagged-people { padding: 8px 0 2px; }

.view-comments { padding: 4px 20px 0; font-size: 13px; color: var(--muted); cursor: pointer; }
.view-comments:hover { color: #444; }
.view-comments-hidden { display: none; }

.comment-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.me-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.comment-input {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
}

.comment-post {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  opacity: 1;
  transition: opacity 0.15s;
  margin-right: 11px;
}
.comment-post:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.comment-post.ready { opacity: 1; }

/* Load more */
.load-more { text-align: center; padding: 8px 0 0; }
.load-more-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 11px 32px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.load-more-btn:hover { background: #f9fafb; border-color: #d1d5db; }

/* ══════════════════════════════════════
   UPLOAD POST MODAL
══════════════════════════════════════ */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

@media (max-width: 768px) {
  /* Anchor modal to the top so the title is never clipped, then cap its height
     so it stops before the bottom nav (64px + 12px gap). Internal scroll
     handles content that's taller than the available space. */
  .upload-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 20px 16px 0;
  }
  .upload-box {
    max-height: calc(100dvh - 20px - max(96px, calc(env(safe-area-inset-bottom, 0px) + 80px)));
    overflow-y: auto;
  }
}

.upload-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.upload-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.upload-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
}

.upload-destination {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Destination dropdown row in upload modal header */
.upload-dest-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.upload-dest-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.upload-dest-select {
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  color: #111;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 22px 3px 8px;
  appearance: none;
  -webkit-appearance: none;
  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='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  cursor: pointer;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-dest-select:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #fff;
}

.upload-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
.upload-close:hover { background: #f3f4f6; color: #333; }

.upload-box form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.upload-drop-zone {
  position: relative;
  margin: 16px 20px 0;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over { border-color: #6366f1; background: #f5f3ff; }
.upload-drop-zone.has-files { min-height: auto; max-height: 240px; overflow-y: auto; border-style: solid; border-color: #e5e7eb; }

.upload-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.upload-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  padding: 28px 20px;
  pointer-events: none;
  text-align: center;
}
.upload-empty-state span { font-size: 13px; }
.upload-or { font-size: 12px; color: #6366f1; font-weight: 500; }

/* Camera capture button — hidden on desktop, shown on touch (pointer: coarse) only */
.upload-camera-btn { display: none; }
@media (pointer: coarse) {
  .upload-camera-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 20px 0;
    padding: 10px 16px;
    width: calc(100% - 40px);
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
  }
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
  padding: 10px;
  width: 100%;
  pointer-events: none;
}

.upload-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  pointer-events: all;
}

.upload-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-video-thumb {
  width: 100%;
  height: 100%;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.upload-caption {
  margin: 12px 20px 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13.5px;
  resize: vertical;
  font-family: inherit;
  color: #111;
  transition: border-color 0.15s;
  min-height: 72px;
}
.upload-caption:focus { outline: none; border-color: #6366f1; }
.upload-caption::placeholder { color: #9ca3af; }

.upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 20px;
}

.upload-file-count {
  font-size: 12px;
  color: #9ca3af;
}

/* File validation errors — shown when addFile() rejects one or more files */
.upload-file-errors {
  margin: 0 20px 4px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}
.upload-file-error {
  font-size: 13px;
  color: #b91c1c;
  margin: 0;
  line-height: 1.5;
}
.upload-file-error + .upload-file-error {
  margin-top: 3px;
}

.upload-submit {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 9px 24px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.upload-submit:hover:not(:disabled) { background: #374151; }
.upload-submit:disabled,
.upload-submit.submitting { opacity: 0.55; cursor: not-allowed; }

.upload-loc-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 20px 0;
  font-size: 12.5px;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}
.upload-loc-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #6366f1;
  cursor: pointer;
  flex-shrink: 0;
}
.upload-loc-toggle:has(input:checked) { color: #4f46e5; }
.upload-split-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 20px 0;
  font-size: 12.5px;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}
.upload-split-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #6366f1;
  cursor: pointer;
  flex-shrink: 0;
}
.upload-split-toggle:has(input:checked) { color: #4f46e5; }

/* ══════════════════════════════════════
   COMMENT ITEMS
══════════════════════════════════════ */
.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.comment-item.reply {
  margin-top: 8px;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.comment-item.reply .comment-avatar,
.comment-item.reply .comment-avatar-fallback {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

.comment-body-wrap { flex: 1; min-width: 0; }

.comment-bubble {
  background: var(--surface-2, #f3f4f6);
  border-radius: 0 12px 12px 12px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text, #111);
  line-height: 1.5;
  word-break: break-word;
}
.comment-author {
  font-weight: 600;
  margin-right: 5px;
  color: var(--text, #111);
}
.comment-media {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 220px;
}
.comment-media-img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding-left: 2px;
}
.comment-time { font-size: 11px; color: var(--muted, #9ca3af); }

.comment-like-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted, #9ca3af);
  padding: 0;
  transition: color 0.15s;
}
.comment-like-btn.liked { color: #ef4444; }
.comment-like-btn:hover { color: #ef4444; }

.comment-reply-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted, #9ca3af);
  padding: 0;
}
.comment-reply-btn:hover { color: #374151; }

.comment-replies {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--border, #e5e7eb);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Reply form ── */
.reply-form {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}
.reply-input-wrap {
  flex: 1;
}
.reply-input {
  flex: 1;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #fff);
  color: var(--text, #111);
  outline: none;
  transition: border-color 0.15s;
}
.reply-input:focus { border-color: #6366f1; }

.me-dot.small {
  width: 22px;
  height: 22px;
  font-size: 8px;
  flex-shrink: 0;
}

/* ── sr-only utility ── */
[x-cloak] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ══════════════════════════════════════
   COMMENT INPUT BARS (shared)
══════════════════════════════════════ */
.pdp-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pdp-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2, #f3f4f6);
  border-radius: 22px;
  padding: 4px 4px 4px 14px;
}
.pdp-input-row .comment-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 4px 0;
}
.pdp-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted, #9ca3af);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.pdp-attach:hover { background: var(--border, #e5e7eb); color: #374151; }

.pdp-img-preview {
  position: relative;
  display: inline-flex;
  margin-left: 4px;
}
.pdp-preview-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.pdp-img-clear {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #374151;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Post detail page (event-style layout) ── */

/* Breadcrumb back-link */
.pdp-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 8px;
  padding: 6px 10px;
  border-radius: 20px;
  background: rgba(0,0,0,0.04);
  color: var(--text-muted, #6b7280);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pdp-breadcrumb:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text, #111827);
}
.pdp-breadcrumb svg {
  flex-shrink: 0;
}

/* WYSIWYG body for update-type posts on the detail page */
.pdp-body-html {
  padding: 12px 20px 4px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

/* Author thumbnail inside location-block */
.pdp-author-thumb-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdp-author-initial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

/* Reactions wrapper — small top margin under desc-body */
.pdp-reactions-wrap {
  margin-top: 14px;
}

/* Hashtags */
.post-hashtag {
  color: var(--blue, #2563eb);
  font-weight: 500;
  text-decoration: none;
  margin-right: 2px;
}
.post-hashtag:hover { text-decoration: underline; }

.pdp-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.pdp-hashtag {
  font-size: 13px;
  color: var(--blue, #2563eb);
  font-weight: 500;
  text-decoration: none;
}
.pdp-hashtag:hover { text-decoration: underline; }

/* Comments section inside .content */
.pdp-comments-section {
  margin-top: 32px;
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 20px;
}
.pdp-comments-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}
.pdp-comments-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}
.pdp-comments-count {
  font-size: 13px;
  color: var(--muted, #6b7280);
}
.pdp-comments {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.pdp-comment-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--border, #e5e7eb);
}

/* ── Post detail page (legacy side-panel layout — kept for reference) ── */
.post-detail-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 80px;
}
.post-detail-media {
  flex: 1;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.post-detail-media .post-image,
.post-detail-media .post-carousel {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: unset;
}
.post-detail-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.post-detail-text-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f9fafb;
}
.post-detail-panel {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border, #e5e7eb);
  height: calc(100vh - 80px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}
.pdp-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.pdp-back {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #6b7280;
  transition: background 0.15s;
}
.pdp-back:hover { background: #f3f4f6; }
.pdp-caption {
  padding: 10px 20px 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #333;
}
.pdp-caption strong { font-weight: 600; color: #111; margin-right: 5px; }
.pdp-actions {
  display: flex;
  align-items: center;
  padding: 10px 12px 4px;
  gap: 2px;
}
.pdp-comments {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pdp-comment-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   POST EDIT MODAL
══════════════════════════════════════ */
.post-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.post-edit-box {
  background: var(--bg, #fff);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.post-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.post-edit-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin: 0;
}
.post-edit-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.post-edit-close:hover { background: #f3f4f6; color: #374151; }
.post-edit-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.post-edit-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.post-edit-section { display: flex; flex-direction: column; gap: 6px; }
.post-edit-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.post-edit-cancel {
  background: none;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}
.post-edit-cancel:hover { background: #f3f4f6; }
.post-edit-save {
  background: #3C3489;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.post-edit-save:hover { background: #312c72; }
.post-edit-save:disabled { opacity: 0.6; cursor: not-allowed; }

/* ══════════════════════════════════════
   COMMENTS MODAL
══════════════════════════════════════ */
.comments-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.comments-modal-box {
  background: var(--bg, #fff);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--border, #e5e7eb);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  overflow: hidden;
}

.comments-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.comments-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #111);
}
.comments-modal-count {
  font-size: 12px;
  color: var(--muted, #9ca3af);
}
.comments-modal-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2, #f3f4f6);
  border: 0.5px solid var(--border, #e5e7eb);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #9ca3af);
  transition: background 0.15s, color 0.15s;
}
.comments-modal-close:hover { background: var(--border, #e5e7eb); color: var(--text, #111); }

.comments-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comments-modal-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 18px 16px;
  border-top: 0.5px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 600px)
══════════════════════════════════════ */
@media (max-width: 600px) {

  .topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 0;
    padding: 12px 16px;
  }

  .nav-left { order: 1; flex: 1; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
  .nav-right { order: 2; flex: 0; }
  .nav-search {
    order: 3;
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 8px 14px;
  }

  .content .extra_wide {
    width: 100%;
    margin-left: 0%;
  }

  .nav-notif {  }
  .nav-brand { font-size: 15px; }
  .nav-pill { font-size: 11px; padding: 3px 10px; }

  .hero { height: 400px; }
  .hero-fade { height: 100px; }

  .content { padding: 0 16px 0; margin-top: -215px; }
  .feed-section { padding: 0 16px 48px; }

  .event-title { font-size: 21px; margin-top: 16px; }
  .event-meta { font-size: 12.5px; }

  .location-block { height: 80px; }
  .location-map { width: 80px; }
  .location-info { padding: 10px 12px; }
  .location-name { font-size: 12.5px; }
  .location-address { font-size: 11px; }

  .btn-checkin { width: 100%; justify-content: center; padding: 13px 22px; font-size: 14px; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { font-size: 13px; padding: 10px 16px 10px 0; }

  .desc-body { font-size: 13.5px; }
  .cohost-label { font-size: 12px; }

  .feed-title { font-size: 18px; }
  .feed-subtitle { font-size: 12px; }
  .feed-add-btn { padding: 7px 13px; font-size: 12px; }

  /* Feed header: stack vertically so the search doesn't overflow */
  .feed-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
  }
  .feed-search {
    width: 100%;
  }
  .feed-search-input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .feed-search-input:focus {
    width: auto;
  }

  /* Bottom nav: cap width to viewport and clip any accidental overflow */
  .bottom-nav {
    max-width: calc(100vw - 24px);
    overflow: hidden;
  }

  .post { border-radius: 14px; margin-bottom: 16px; }
  .post-header { padding: 11px 13px; }
  .post-username { font-size: 13px; }
  .post-time { font-size: 11px; }

  .post-actions { padding: 8px 8px 4px; gap: 0; }
  .act { padding: 5px 6px; font-size: 12px; }

  .reactions-row { padding: 0 14px 4px; gap: 5px; }
  .reaction-chip { padding: 3px 8px 3px 6px; font-size: 12px; }
  .reaction-chip .e { font-size: 14px; }

  .post-likes { padding: 2px 14px 0; font-size: 13px; }
  .post-caption { padding: 5px 14px 0; font-size: 13px; }
  .view-comments { padding: 4px 14px 0; font-size: 12px; }

  .comment-bar { padding: 8px 12px 12px; gap: 8px; }
  .me-dot { width: 26px; height: 26px; font-size: 9px; }
  .comment-input { font-size: 12.5px; }
  .comment-post { font-size: 12.5px; }

  .emoji-picker { left: 0; transform: none; }
  .emoji-picker::after { left: 20px; transform: none; }
  .emoji-opt { font-size: 20px; padding: 3px 4px; }

  .load-more-btn { width: 100%; }
}

/* ══════════════════════════════════════
   ADMIN
══════════════════════════════════════ */

.admin-page {
  display: flex;
  min-height: calc(100vh - 64px);
  background: #f9fafb;
  border-top: 1px solid var(--border);
}

/* ── Sidebar ── */
.admin-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 0;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.admin-nav-item:hover { background: #f3f4f6; color: var(--text); }
.admin-nav-item.active { background: #eff6ff; color: #2563eb; }

/* ── Content area ── */
.admin-content {
  flex: 1;
  padding: 32px;
  min-width: 0;
}

.admin-section {}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* ── Admin help panels ── */
.admin-help-wrap {
  margin: 0 0 16px;
}

.admin-help-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.admin-help-toggle:hover {
  color: var(--accent, #6366f1);
}
.admin-help-toggle svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.admin-help-panel {
  margin-top: 10px;
  background: var(--surface-subtle, #f9fafb);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
}

.admin-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px 32px;
}

.admin-help-block h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.admin-help-block p {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  line-height: 1.55;
  margin: 0;
}

.admin-help-block code {
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, monospace;
}

/* ── Dashboard stat cards ── */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.admin-stat-icon {
  color: var(--primary);
  opacity: 0.8;
}

.admin-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.admin-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Search bar ── */
.admin-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 16px;
  max-width: 480px;
}

.admin-inactive-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-family: inherit;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.admin-inactive-btn:hover { background: #e5e7eb; }
.admin-inactive-btn-on {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.admin-search-input {
  border: none;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  flex: 1;
  background: none;
}
.admin-search-input::placeholder { color: #aaa; }

/* ── Table ── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13.5px;
}

.admin-table thead tr {
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

.admin-tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.admin-tr:last-child { border-bottom: none; }
.admin-tr:hover { background: #fafafa; }
.admin-tr.inactive { opacity: 0.5; }
.admin-tr-child { background: #fafafa; }
.admin-tr-child:hover { background: #f3f4f6; }

.admin-table td {
  padding: 11px 14px;
  vertical-align: middle;
  color: var(--text);
}

.admin-td-expand { width: 36px; padding: 0 6px 0 12px; }
.admin-td-name { font-weight: 500; }
.admin-td-indent { padding-left: 28px !important; color: var(--muted); }
.admin-td-actions { white-space: nowrap; text-align: right; }
.admin-td-caption { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-empty { text-align: center; color: var(--muted); padding: 32px; font-size: 13px; }

/* ── Admin avatar ── */
.admin-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 8px;
}

/* ── Expand button ── */
.btn-expand {
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  transition: background 0.1s, color 0.1s;
}
.btn-expand:hover { background: #f3f4f6; color: var(--text); }

/* ── Badges ── */
.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #e5e7eb;
  color: #374151;
}
.admin-badge-green  { background: #dcfce7; color: #15803d; }
.admin-badge-gray   { background: #f3f4f6; color: #6b7280; }
.admin-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.admin-badge-orange { background: #ffedd5; color: #c2410c; }

/* ── Buttons ── */
.btn-admin-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-admin-primary:hover { background: #1d4ed8; }

.btn-admin-secondary {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-admin-secondary:hover { background: #f9fafb; }

.btn-admin-link {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  transition: background 0.1s;
  text-decoration: none;
}
.btn-admin-link:hover { background: #eff6ff; }

/* "Make main" button — subtle amber outline, sits in the Main column */
.btn-admin-make-main {
  background: none;
  border: 1px solid #d97706;
  color: #d97706;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.btn-admin-make-main:hover { background: #fffbeb; }

/* "★ Main" badge — shown on the currently designated main event */
.admin-main-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.admin-td-main { white-space: nowrap; }

/* "📌 Pinned" badge — shown on posts pinned to an event's detail page */
.admin-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.admin-pin-badge-on {
  background: #fef3c7;
  color: #92400e;
}

/* Pin/Unpin row-action link — amber accent while the post is pinned */
.admin-pin-active {
  color: #92400e;
  background: #fef3c7;
}
.admin-pin-active:hover { background: #fde68a; }

.btn-admin-danger {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  transition: background 0.1s;
}
.btn-admin-danger:hover { background: #fef2f2; }

/* ── Modal ── */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.admin-modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 760px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  overflow: hidden;
}
/* Wide variant for the family tree modal */
.admin-modal-box--wide {
  max-width: 90vw;
  width: 90vw;
}
/* Scrollable tree body inside the modal */
.admin-modal-tree-body {
  max-height: calc(85vh - 72px);
  overflow-y: auto;
  padding: 20px 24px;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.1s;
}
.modal-close:hover { background: #f3f4f6; color: var(--text); }

.admin-modal-form { display: contents; }

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  padding: 20px 24px;
}

/* Name parts row: prefix select + first + middle + last + suffix */
.admin-name-row {
  display: grid;
  grid-template-columns: 140px 1fr 1fr 1fr 120px;
  gap: 10px 14px;
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group.full-width { grid-column: 1 / -1; }

.admin-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-hint {
  font-size: 11.5px;
  color: #9ca3af;
  margin-top: 2px;
}

.admin-subsection-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #f9fafb;
  grid-column: 1 / -1;
}

.admin-modal-meta {
  padding: 12px 24px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 16px;
}

/* Inputs inside modal reuse site-wide input styles but we ensure them here */
.admin-modal-box input[type="text"],
.admin-modal-box input[type="email"],
.admin-modal-box input[type="tel"],
.admin-modal-box input[type="number"],
.admin-modal-box input[type="datetime-local"],
.admin-modal-box input[type="file"],
.admin-modal-box textarea,
.admin-modal-box select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.admin-modal-box input:focus,
.admin-modal-box textarea:focus,
.admin-modal-box select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.admin-modal-box textarea { resize: vertical; min-height: 80px; }
.admin-modal-box input[type="file"] { padding: 5px 8px; }
.admin-modal-box select { cursor: pointer; }
.admin-post-ce {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  min-height: 80px;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.admin-post-ce:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.admin-post-ce:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* ── Avatar row in user modal ── */
.admin-avatar-upload-row {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.admin-avatar-preview {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.admin-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

/* ── Password reset row ── */
.admin-password-section .admin-label { margin-bottom: 6px; }
.admin-hint-inline { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.admin-password-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 480px) {
  .admin-password-row { grid-template-columns: 1fr; }
}

/* ── Checkbox row ── */
.admin-checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 20px;
}
.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.admin-checkbox-label input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: #2563eb;
  cursor: pointer;
}

/* ── Form validation errors ── */
.admin-form-errors {
  margin: 0 24px 4px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.5;
}

/* ── Event images panel ── */
.admin-images-panel {
  border-top: 1px solid var(--border);
  padding: 20px 24px 24px;
}
.admin-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.admin-image-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f3f4f6;
}
.admin-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-image-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.admin-image-thumb:hover .admin-image-delete { opacity: 1; }

.admin-image-upload-form { margin-top: 4px; }
.admin-image-upload-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s;
}
.admin-image-upload-label:hover {
  border-color: #9ca3af;
  background: #f9fafb;
  color: var(--text);
}
.admin-image-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

/* ── Pinned-posts picker (event modal) ── */
.admin-pin-picker {
  position: relative;
  gap: 8px;
}
.admin-pin-results {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.admin-pin-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.admin-pin-result-item:last-child { border-bottom: none; }
.admin-pin-result-item:hover { background: #f9fafb; }
.admin-pin-add {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  background: #fef3c7;
  padding: 3px 8px;
  border-radius: 20px;
}
.admin-pin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-pin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #92400e;
  background: #fef3c7;
  padding: 5px 6px 5px 10px;
  border-radius: 20px;
  max-width: 280px;
}
.admin-pin-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-pin-chip-remove {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(146,64,14,0.12);
  color: #92400e;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s;
}
.admin-pin-chip-remove:hover { background: rgba(146,64,14,0.22); }
.admin-pin-hint {
  font-size: 11.5px;
  color: #9ca3af;
  margin-top: 2px;
}

/* ── Sidebar nav divider ── */
.admin-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ── Admin event full-page (aep) ── */
.aep-content {
  max-width: 860px;
  padding: 32px 40px 80px;
}
.aep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.aep-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.aep-header-actions { display: flex; gap: 8px; }
.aep-form { display: contents; }
.aep-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 28px;
  background: #fff;
  overflow: hidden;
}
.aep-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  margin: 0;
  background: #fafafa;
}
.aep-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.aep-section-header .aep-section-title {
  padding: 0;
  border: none;
  background: none;
}
.aep-save-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.aep-section .admin-form-grid {
  padding: 20px 24px;
}
.aep-section-desc {
  padding: 0 24px 16px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.aep-empty {
  padding: 20px 24px;
  color: #9ca3af;
  font-size: 13.5px;
  margin: 0;
}

/* ── Update rows ── */
.aep-updates-list { padding: 12px 0; }
.aep-update-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.aep-update-row:last-child { border-bottom: none; }
.aep-update-row-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.aep-update-row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aep-update-row-meta {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}
.aep-update-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.aep-update-badge-active {
  background: #dcfce7;
  color: #15803d;
}
.aep-update-badge-expired {
  background: #f3f4f6;
  color: #6b7280;
}

/* ── Registrations section ── */
.aep-reg-count {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.admin-sort-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-sort-btn:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-content { padding: 16px; }
  .aep-content { padding: 16px 16px 60px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-name-row { grid-template-columns: 1fr 1fr; }
  .admin-modal-box { max-width: 100%; margin: 0; border-radius: 0; }
  .admin-modal-overlay { padding: 0; align-items: flex-end; }
}

/* ═══════════════════════════════════════════════════════════
   EVENT UPDATE BANNERS
   ═══════════════════════════════════════════════════════════ */

.event-updates-list {
  margin: 16px 0 20px;
}

.event-update-card {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px 20px 18px;
  margin-bottom: 12px;
}

.event-update-card.event-update-expired {
  background: #f9fafb;
  border-color: var(--border);
  opacity: 0.75;
}

.event-update-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.event-update-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1d4ed8;
  text-decoration: none;
}
.event-update-label:hover {
  text-decoration: underline;
  text-decoration-color: rgba(29,78,216,0.4);
}

.event-update-card.event-update-expired .event-update-label {
  color: #6b7280;
}

.event-update-expired-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #6b7280;
}

.event-update-time {
  font-size: 12px;
  color: #9ca3af;
  margin-left: auto;
}

.event-update-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.event-update-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
}

.event-update-title-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.event-update-title-link:hover .event-update-title {
  text-decoration: underline;
  text-decoration-color: rgba(37,99,235,0.4);
}

/* Update card footer actions */
.event-update-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(37,99,235,0.12);
}

.event-update-card.event-update-expired .event-update-footer {
  border-top-color: rgba(0,0,0,0.08);
}

.update-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.update-act:hover {
  background: rgba(37,99,235,0.08);
  color: #2563eb;
}

.update-act.liked {
  color: #ef4444;
}

.update-act.liked:hover {
  background: rgba(239,68,68,0.08);
}

.update-act-link {
  margin-left: auto;
  text-decoration: none;
}

/* emoji picker inside update card keeps its own positioning */
.event-update-footer .emoji-btn {
  padding: 5px 9px;
  color: #555;
}

/* reactions row inside update cards — shares global .reactions-row styles */
.event-update-card .reactions-row {
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════ */

.profile-page {
    max-width: 935px;
    margin: -300px auto 0;
    padding: 0 0 60px;
    position: relative;
    background-color: #fff;
    z-index: 100;
}

/* ── Cover / hero ── */
.profile-hero {
  position: relative;
}

.profile-cover {
  position: relative;
  height: 400px;
  background: #e5e7eb;
  overflow: hidden;
}

.profile-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-cover-blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(0);
}

.profile-cover-gradient {
  width: 100%;
  height: 100%;
}

.profile-cover-edit {
  position: absolute;
  bottom: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  cursor: pointer;
  transition: background 0.15s;
}
.profile-cover-edit:hover { background: rgba(0,0,0,0.65); }

/* ── Cover action buttons (change / remove) ── */
.profile-cover-actions {
  position: absolute;
  bottom: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-cover-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: none;
  background: rgba(0, 0, 0, 0.50);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.profile-cover-btn:hover { background: rgba(0, 0, 0, 0.70); }

.profile-cover-btn--remove {
  background: rgba(180, 30, 30, 0.55);
}
.profile-cover-btn--remove:hover { background: rgba(180, 30, 30, 0.80); }

/* ── Identity row ── */
.profile-identity {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-wrap: wrap;
}

.profile-avatar-wrap {
  position: relative;
  margin-top: -40px;
  flex-shrink: 0;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.profile-avatar-fallback {
  background: #60a5fa;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  cursor: pointer;
  transition: background 0.15s;
}
.profile-avatar-edit:hover { background: rgba(0,0,0,0.75); }

.profile-info {
  flex: 1;
  min-width: 0;
  padding-bottom: 4px;
}

.profile-names {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.profile-fullname {
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0;
}

.profile-username {
  font-size: 14px;
  color: var(--muted, #6b7280);
}

.profile-bio {
  font-size: 14px;
  color: var(--text, #111);
  margin: 4px 0 6px;
}
.profile-dates {
  font-size: 12.5px;
  color: var(--muted, #6b7280);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.profile-dates::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
  opacity: 0.6;
}

.profile-birthday {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.profile-birthday-date {
  font-weight: 600;
  color: var(--text);
}
.profile-birthday-age {
  color: var(--muted, #6b7280);
}
.profile-birthday-countdown {
  background: #fef3c7;
  color: #92400e;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
}

.profile-stats {
  display: flex;
  gap: 28px;
}

/* ── Profile contact info ── */
.profile-contact-wrap {
  margin-top: 10px;
}
.profile-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 4px 12px 4px 10px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.profile-contact-btn:hover {
  background: rgba(0,0,0,0.04);
  color: #111;
}
.profile-contact-chevron {
  transition: transform 0.2s;
}
.profile-contact-card {
  margin-top: 8px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
}
.profile-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}
.profile-contact-row svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #6b7280;
}
.profile-contact-value {
  color: #374151;
  text-decoration: none;
  line-height: 1.4;
}
a.profile-contact-value:hover {
  text-decoration: underline;
  color: #6366f1;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.stat-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #111);
}

.stat-label {
  font-size: 12px;
  color: var(--muted, #6b7280);
}

.profile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 4px;
  flex-shrink: 0;
}

.btn-profile-primary {
  padding: 8px 20px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-profile-primary:hover { background: #333; }

.btn-profile-secondary {
  padding: 8px 20px;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--text, #111);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border, #e5e7eb);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-profile-secondary:hover { background: #e5e7eb; }

/* ── Profile edit modal (pem-) ── */
.pem-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  overflow: hidden;
}
.pem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}
.pem-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}
.pem-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.12s;
}
.pem-close:hover { background: #f3f4f6; color: #111; }
.pem-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
  margin-bottom: 20px;
  padding-bottom: 100px;
}
.pem-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 14px;
}
.pem-divider {
  border: none;
  border-top: 1px solid #f3f4f6;
  margin: 24px 0 20px;
}
.pem-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pem-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.pem-color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pem-color-swatch {
  cursor: pointer;
  position: relative;
}
.pem-color-swatch input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pem-color-dot {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.12s, transform 0.12s;
}
.pem-color-swatch input:checked + .pem-color-dot {
  border-color: #111827;
  transform: scale(1.18);
}
.pem-color-swatch:hover .pem-color-dot {
  transform: scale(1.1);
}
.pem-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}
.pem-btn-save {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.pem-btn-save:hover { background: #374151; }
.pem-toast {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.pem-toast:empty {
  display: none;
}
.pem-toast--ok {
  background: #dcfce7;
  color: #166534;
}
.pem-toast--err {
  background: #fee2e2;
  color: #991b1b;
}
.pem-push-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.pem-push-desc {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}
.pem-btn-push {
  align-self: flex-start;
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.pem-btn-push:hover:not(:disabled) { background: #e5e7eb; }
.pem-btn-push:disabled { opacity: 0.6; cursor: not-allowed; }
.pem-btn-push--active {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
.pem-btn-push--active:hover:not(:disabled) { background: #ffe4e6; }
@media (max-width: 540px) {
  .pem-box { max-width: 100%; border-radius: 16px 16px 0 0; }
  .pem-row-3 { grid-template-columns: 1fr 1fr; }
}

/* ── Tab bar ── */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 0;
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #6b7280);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.profile-tab:hover { color: var(--text, #111); }
.profile-tab.active {
  color: var(--text, #111);
  border-bottom-color: #111;
  font-weight: 600;
}

/* ── Posts toolbar (Add post button) ── */
.profile-posts-wrap {
  display: flex;
  flex-direction: column;
}
.profile-posts-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 8px;
}
.profile-add-post-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* ── Posts grid ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding-top: 3px;
}

.profile-grid-card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  display: block;
  background: #f3f4f6;
  text-decoration: none;
}

.profile-grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.profile-grid-card:hover .profile-grid-img { transform: scale(1.04); }

.profile-grid-multi {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  padding: 3px;
  display: flex;
}

.profile-grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 0;
  transition: background 0.2s, opacity 0.2s;
}
.profile-grid-card:hover .profile-grid-overlay {
  background: rgba(0,0,0,0.35);
  opacity: 1;
}

.ov-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.ov-stat.dark {
  color: var(--muted, #6b7280);
}

.profile-grid-text {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 8px;
  background: #f9fafb;
}

.profile-grid-text-icon { color: #d1d5db; }

.profile-grid-text-body {
  font-size: 12px;
  color: var(--muted, #6b7280);
  text-align: center;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.profile-grid-text-meta {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* ── Empty state ── */
.profile-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--muted, #6b7280);
  font-size: 14px;
}

/* ── Family tree ── */
.family-tree {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gen-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gen-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #6b7280);
  margin-top: 8px;
}

.gen-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.gen-connector {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  width: 80px;
}

.tree-node.linked:hover .tree-node-name { text-decoration: underline; }

.tree-node-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

.tree-node-fallback { background: #60a5fa; }

.tree-node-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text, #111);
  text-align: center;
  line-height: 1.3;
  max-width: 76px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tree-node-name.muted { color: var(--muted, #9ca3af); }

.tree-node-rel {
  font-size: 10px;
  color: var(--muted, #9ca3af);
  text-transform: capitalize;
}

.tree-node-add {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px dashed #d1d5db;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tree-node-add:hover { border-color: #9ca3af; background: #f3f4f6; }

.family-tree-add-row {
  display: flex;
  justify-content: center;
  padding: 20px 0 0;
}

/* ── Profile modals (add family member etc.) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0;
}

.modal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.modal-tab {
  flex: 1;
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #6b7280);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.modal-tab.active { color: var(--text, #111); border-bottom-color: #111; font-weight: 600; }

.modal-body { padding: 16px 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
}

.modal-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #f9fafb;
  margin-bottom: 12px;
}

.modal-search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text, #111);
  outline: none;
}

.relation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.relation-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border, #e5e7eb);
  background: #f9fafb;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #6b7280);
  cursor: pointer;
  text-transform: capitalize;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.relation-pill.active,
.relation-pill:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* ── Family search results ── */
.family-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.family-search-empty {
  font-size: 13px;
  color: var(--muted, #9ca3af);
  text-align: center;
  padding: 20px 0;
}

.family-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.1s;
}
.family-search-item:hover { background: #f9fafb; }

.fsr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.fsr-fallback { background: #60a5fa; }

.fsr-info { flex: 1; min-width: 0; }

.fsr-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fsr-username {
  font-size: 12px;
  color: var(--muted, #6b7280);
}

.fsr-add {
  padding: 6px 14px;
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Add member preview ── */
.add-member-preview {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.tree-node-add-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ── Form elements inside modal ── */
.form-group { margin-bottom: 14px; }

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text, #111);
  background: #f9fafb;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: #111; background: #fff; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .profile-cover { height: 150px; }
  .profile-identity { padding: 0 14px 16px; gap: 14px; }
  .profile-avatar { width: 72px; height: 72px; }
  .profile-avatar-wrap { margin-top: -32px; }
  .profile-fullname { font-size: 18px; }
  .profile-stats { gap: 18px; }
  .profile-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .profile-tab { padding: 12px 14px; font-size: 12px; }
  .profile-tabs { overflow-x: auto; }
  .modal-box { border-radius: 12px; }
  .gen-nodes { gap: 8px; }
  .tree-node { width: 68px; }
  .tree-node-avatar { width: 48px; height: 48px; font-size: 15px; }
  .family-tree { padding: 16px; }
}

/* ── Family tree: unlinked node management ── */
.tree-node-ghost {
  background: #e5e7eb;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  border: 2px dashed #d1d5db;
}
.tree-node.unlinked.named {
  position: relative;
}
.tree-node-manage-btn,
.tree-node-claim-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 8px;
  margin-top: 4px;
  transition: background 0.15s;
}
.tree-node-manage-btn {
  background: #f3f4f6;
  color: #374151;
  gap: 4px;
}
.tree-node-manage-btn:hover { background: #e5e7eb; }
.tree-node-claim-btn {
  background: #111;
  color: #fff;
}
.tree-node-claim-btn:hover { background: #374151; }
span.tree-node-name.muted { color: #9ca3af; }

/* ── Manage-unlinked modal extras ── */
.modal-title-rel {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  margin-left: 4px;
}
.modal-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 12px;
  line-height: 1.5;
}
.modal-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 5px;
  vertical-align: middle;
}

/* ── Family claims list ── */
.family-claims-list { display: flex; flex-direction: column; gap: 10px; }
.family-claim-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 10px;
}
.family-claim-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

/* ── Claim toast ── */
.claim-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-size: 13px;
  color: #15803d;
  margin-top: 8px;
}
.claim-feedback {
  font-size: 13px;
  color: #15803d;
  font-weight: 600;
}
.claim-feedback.muted { color: #6b7280; }

/* ── Invite URL wrap ── */
.invite-url-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.invite-url-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12px;
  color: #374151;
  background: #f9fafb;
  cursor: pointer;
}

/* ── Invite landing page ── */
.invite-landing {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.invite-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.invite-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: #f3f4f6;
  border-radius: 50%;
  margin: 0 auto 20px;
}
.invite-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 10px;
}
.invite-body {
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
  margin: 0 0 20px;
}
.invite-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 14px;
}
.invite-accept-btn { width: 100%; }
.invite-auth-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-accepted {
  padding: 16px;
  background: #f0fdf4;
  border-radius: 10px;
  color: #15803d;
  font-size: 14px;
}
.invite-accepted a { color: #111; font-weight: 600; }

/* ── Notification: claim inline actions ── */
.notif-claim { cursor: default; }
.notif-claim-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.notif-claim-btn {
  font-size: 12px;
  padding: 5px 12px;
}

/* ── Trix rich-text editor ─────────────────────────────── */
.trix-wrapper {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
trix-editor {
  min-height: 180px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text, #111);
  border: none;
  outline: none;
}
trix-toolbar {
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 6px 10px;
}
/* Neutralise Trix's own border so our wrapper handles it */
trix-editor.trix-content {
  border: none !important;
  box-shadow: none !important;
}

/* ── Trix content rendering (both editor + public display) ── */
.trix-content h1 { font-size: 1.4em; font-weight: 700; margin: 0.75em 0 0.4em; }
.trix-content h2 { font-size: 1.2em; font-weight: 600; margin: 0.7em 0 0.35em; }
.trix-content p  { margin: 0 0 0.75em; }
.trix-content ul, .trix-content ol { padding-left: 1.4em; margin: 0 0 0.75em; }
.trix-content li { margin-bottom: 0.2em; }
.trix-content strong { font-weight: 700; }
.trix-content em { font-style: italic; }
.trix-content a  { color: #E8930A; text-decoration: underline; }
.trix-content blockquote {
  border-left: 3px solid #e5e7eb;
  margin: 0 0 0.75em;
  padding: 4px 12px;
  color: #6b7280;
}
.trix-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}
.trix-content figure.attachment {
  margin: 8px 0;
}
.trix-content figure.attachment figcaption {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  margin-top: 4px;
}
/* Upload progress bar inside editor */
figure.attachment .attachment__progress {
  height: 3px;
  background: #E8930A;
}

/* ══════════════════════════════════════
   PUBLIC EVENT PAGE
══════════════════════════════════════ */

/* Outer wrapper — full-width, light grey background like the app shell */
.public-page {
  min-height: 100vh;
  background: var(--bg, #f4f4f6);
  font-family: var(--font-body, system-ui, sans-serif);
}

/* ── Top nav ─────────────────────────────────────────────── */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  font-weight: 400;
  color: #111827;
  letter-spacing: -0.01em;
}

/* ── Hero ─────────────────────────────────────────────────── */
.public-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 380px;
  overflow: hidden;
  background: #1e1b4b;
}

.public-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gradient overlay so text is readable over any photo */
.public-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%);
}

/* Solid gradient when there's no image */
.public-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #3730a3 0%, #7c3aed 60%, #a855f7 100%);
}

.public-hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 28px 28px;
}

.public-event-type {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
}

.public-event-title {
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 10px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

.public-event-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  margin: 0;
}

/* ── Info body (matches .content layout) ─────────────────── */
.public-info {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 28px 8px;
}

.public-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  color: #374151;
}

.public-info-row svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.public-info-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  line-height: 1.4;
}

.public-info-sub {
  font-size: 12.5px;
  color: var(--muted, #6b7280);
  margin-top: 2px;
}

/* ── Description ─────────────────────────────────────────── */
.public-description {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 28px;
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
}

/* ── Sign-in CTA ──────────────────────────────────────────── */
.public-cta {
  max-width: 640px;
  margin: 12px auto 48px;
  padding: 0 28px;
}

.public-cta-card {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.public-cta-avatars {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.public-cta-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  margin-left: -10px;
  flex-shrink: 0;
  filter: blur(2.5px);
  opacity: 0.85;
}

.public-cta-avatar:first-child {
  margin-left: 0;
}

.public-cta-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: #111827;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.public-cta-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted, #6b7280);
  margin: 0 0 22px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .public-hero { aspect-ratio: 4/3; max-height: 300px; }
  .public-hero-text { padding: 16px 18px 20px; }
  .public-event-title { font-size: 22px; }
  .public-info { padding: 16px 16px 4px; }
  .public-description { padding: 12px 16px; }
  .public-cta { padding: 0 16px; margin-bottom: 32px; }
  .public-cta-card { padding: 22px 18px; border-radius: 16px; }
  .public-cta-title { font-size: 19px; }
  .public-nav { padding: 0 16px; }
}

/* ── Global search dropdown ─────────────────────────────── */
.nav-search {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
}

.search-section-label {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.search-result-item:hover {
  background: #f9fafb;
}

.search-result-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.search-result-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6b7280;
}

.search-result-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.search-result-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-sub {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-no-results {
  padding: 20px 14px;
  text-align: center;
  font-size: 14px;
  color: #9ca3af;
}

.search-loading-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 0;
}

.search-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #e5e7eb;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: search-spin 0.65s linear infinite;
}

@keyframes search-spin {
  to { transform: rotate(360deg); }
}

/* ── Admin pagination ──────────────────────────────────── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 4px;
  flex-wrap: wrap;
}

.admin-pagination-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-perpage-label {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
}

.admin-perpage-select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  font-size: 13px;
  color: #374151;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.admin-perpage-select:focus {
  border-color: #9ca3af;
}

.admin-pagination-total {
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
}

/* ── Bulk user upload ── */
.admin-bulk-wrap {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.admin-bulk-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  gap: 10px;
}
.admin-bulk-toggle:hover { background: #f9fafb; }

.admin-bulk-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-bulk-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.admin-bulk-chevron--open { transform: rotate(180deg); }

.admin-bulk-body {
  padding: 0 18px 20px;
  border-top: 1px solid var(--border);
}

.admin-bulk-code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 5px;
  color: #374151;
}

.admin-bulk-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6366f1;
  text-decoration: none;
  margin-bottom: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e0e0ff;
  background: #f5f3ff;
}
.admin-bulk-download:hover { background: #ede9fe; }

.admin-bulk-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-bulk-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #6b7280;
  background: #f9fafb;
  min-width: 200px;
  flex: 1;
  transition: border-color 0.15s, background 0.15s;
}
.admin-bulk-file-label:hover { border-color: #6366f1; background: #f5f3ff; color: #6366f1; }

.admin-bulk-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-bulk-submit {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-bulk-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.admin-bulk-spinner.htmx-request { display: inline-block; }

.admin-bulk-results {
  margin-top: 18px;
}

.admin-bulk-stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-bulk-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #6b7280;
}
.admin-bulk-stat--success { background: #dcfce7; color: #15803d; }
.admin-bulk-stat--fail    { background: #fee2e2; color: #b91c1c; }

.admin-bulk-list {
  margin-bottom: 14px;
}

.admin-bulk-list-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 6px;
}

.admin-bulk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 3px;
}
.admin-bulk-row--ok  { background: #f0fdf4; color: #15803d; }
.admin-bulk-row--err { background: #fef2f2; color: #991b1b; }

.admin-bulk-row-num  { font-weight: 700; min-width: 46px; }
.admin-bulk-email    { color: inherit; opacity: 0.75; font-size: 12px; flex-shrink: 0; }
.admin-bulk-reason   { color: inherit; font-size: 12px; }

.admin-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  cursor: pointer;
}

.admin-page-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.admin-page-btn.admin-page-current {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.admin-page-btn.admin-page-disabled {
  color: #d1d5db;
  cursor: default;
  pointer-events: none;
}

/* ── Event expand button ───────────────────────────────────── */
.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #9ca3af;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.expand-btn:hover { color: #374151; background: #f3f4f6; }
.expand-btn.open  { color: #374151; transform: rotate(90deg); }

/* ── Sub-event children panel ─────────────────────────────── */
.admin-tr-children-row td {
  padding: 0;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.admin-children-wrap {
  padding: 10px 16px 10px 40px;
  border-left: 3px solid #e5e7eb;
  margin-left: 8px;
}

.admin-children-empty {
  color: #9ca3af;
  font-size: 13px;
  margin: 6px 0;
}

.admin-children-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}

.admin-children-table td {
  padding: 8px 12px;
  vertical-align: middle;
  color: var(--text);
}

.admin-tr-child {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}
.admin-tr-child:last-child { border-bottom: none; }
.admin-tr-child:hover { background: #f0f4f8; }
.admin-tr-child.inactive { opacity: 0.5; }

.admin-child-name {
  font-weight: 500;
  color: #374151;
}

.admin-children-footer {
  padding-top: 6px;
}

.btn-admin-sm {
  font-size: 12px;
  padding: 4px 10px;
}


/* ══════════════════════════════════════
   REGISTRATION STATUS BADGES
══════════════════════════════════════ */

.reg-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.reg-badge-attending    { background: #d1fae5; color: #065f46; }
.reg-badge-paid         { background: #dbeafe; color: #1e40af; }
.reg-badge-pending      { background: #fef3c7; color: #92400e; }
.reg-badge-waitlisted   { background: #f3f4f6; color: #374151; }
.reg-badge-cancelled    { background: #fee2e2; color: #991b1b; }
.reg-badge-not-attending { background: #f3f4f6; color: #6b7280; }

/* ══════════════════════════════════════
   ADMIN REGISTRATION THREAD MODAL
══════════════════════════════════════ */

.admin-modal-wide { max-width: 620px; }

.admin-reg-answers-section {
  border-bottom: 1px solid var(--border);
}

.admin-reg-answers-header {
  padding: 10px 24px 8px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.admin-reg-answers-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.admin-reg-answers-form {
  padding: 14px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-reg-answers-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.admin-modal-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.reg-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 12px 0;
}

.reg-thread-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

.reg-note {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.reg-note-admin {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
}

.reg-note-user {
  background: #f9fafb;
  border-left: 3px solid #d1d5db;
}

.reg-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.reg-note-author {
  font-weight: 600;
  color: #1f2937;
}

.reg-note-date {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.reg-note-body {
  color: #374151;
  line-height: 1.5;
}

.reg-note-form { padding: 16px 24px 20px; }

.reg-note-fields {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  align-items: start;
}

.reg-note-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

/* ══════════════════════════════════════
   EVENT PAGE REGISTRATION PANEL
══════════════════════════════════════ */

.event-reg-panel {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.event-reg-cta {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-reg-cta-text {
  font-size: 14px;
  color: var(--muted);
}

.event-reg-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.event-reg-answers {
  border-bottom: 1px solid var(--border);
}

.event-reg-answers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.event-reg-answers-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.event-reg-answer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 16px;
  border-top: 1px solid var(--border);
}

.event-reg-answer-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.event-reg-answer-value {
  font-size: 13px;
  color: var(--text);
  text-align: right;
}

.event-reg-answer-empty {
  color: var(--muted);
}

.event-reg-edit-form {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.event-reg-edit-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.btn-link {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.btn-link:hover { text-decoration: underline; }

.event-reg-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.event-reg-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  max-height: 260px;
  overflow-y: auto;
}

.event-reg-reply {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}

.event-reg-reply .form-input {
  flex: 1;
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
}

.btn-reg-reply {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-reg-reply:hover { background: #1d4ed8; }

/* ── @mention autocomplete dropdown ───────────────────────────────────────── */

.mention-wrap {
  position: relative;
}

.mention-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.mention-item:first-child { border-radius: 10px 10px 0 0; }
.mention-item:last-child  { border-radius: 0 0 10px 10px; }
.mention-item:only-child  { border-radius: 10px; }

.mention-item:hover,
.mention-item-active {
  background: #f3f4f6;
}

.mention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.mention-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mention-name {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Contenteditable inputs ────────────────────────────────────────────────── */

/* Caption (multi-line, replaces <textarea>) */
.upload-caption[contenteditable] {
  display: block;
  min-height: 72px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  outline: none;
}
.upload-caption[contenteditable]:focus { border-color: #6366f1; }
.upload-caption[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* Single-line comment / reply inputs */
.comment-input[contenteditable] {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  cursor: text;
  outline: none;
  padding: 4px 0;
}
.comment-input[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* ── Mention chip pill ──────────────────────────────────────────────────────── */

.mention-chip {
  display: inline;
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 4px;
  padding: 1px 3px;
  font-weight: 600;
  font-size: inherit;
  line-height: inherit;
  cursor: default;
  /* Selecting the chip selects it whole; one Backspace removes it */
  user-select: all;
}

/* Rendered mention links in post bodies / comments */
a.mention {
  color: #5b21b6;
  font-weight: 600;
  text-decoration: none;
}
a.mention:hover { text-decoration: underline; }

/* @everyone rendered mention — indigo to match the chip colour */
.mention-everyone {
  color: #4f46e5;
  font-weight: 700;
}

/* ── Family tree: not-registered / invite badge ──────────── */
.tree-node-invite-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  background: #ffedd5;
  color: #c2410c;
  text-transform: uppercase;
}
.tree-node.not-registered .tree-node-avatar {
  opacity: .7;
}
.tree-node.not-registered .tree-node-name {
  color: #9ca3af;
}

/* ── Admin family tree (aft-) ────────────────────────────── */
.admin-family-tree-section {
  padding: 24px 32px;
}

/* Header */
.aft-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.aft-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}
.aft-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-background-primary, #fff);
  border: 0.5px solid var(--color-border-secondary, #d1d5db);
  border-radius: 8px;
  padding: 8px 12px;
}
.aft-search-icon {
  color: var(--color-text-tertiary, #9ca3af);
  flex-shrink: 0;
}
.aft-search-input {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-text-primary, #111827);
  outline: none;
  flex: 1;
  min-width: 0;
}
.aft-search-input::placeholder {
  color: var(--color-text-tertiary, #9ca3af);
}

/* Anchor bar */
.aft-anchor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-background-secondary, #f9fafb);
  border: 0.5px solid var(--color-border-tertiary, #e5e7eb);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.aft-anchor-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.aft-anchor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.aft-anchor-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}
.aft-anchor-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary, #111827);
}
.aft-anchor-sub {
  font-size: 12px;
  color: var(--color-text-tertiary, #9ca3af);
  margin-top: 1px;
}
.aft-nav-btns {
  display: flex;
  gap: 6px;
}
.aft-nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--color-text-secondary, #6b7280);
  background: var(--color-background-primary, #fff);
  border: 0.5px solid var(--color-border-secondary, #d1d5db);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.aft-nav-btn:hover {
  background: var(--color-background-secondary, #f9fafb);
}

/* SVG overlay wrapper */
.aft-tree-wrap {
  position: relative;
}
.aft-tree-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

/* Tree layout */
.aft-tree {
  display: flex;
  flex-direction: column;
  gap: 72px;
  position: relative;
}
.aft-generation {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aft-gen-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary, #9ca3af);
}
.aft-gen-nodes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Person card */
.aft-card {
  width: 148px;
  background: var(--color-background-primary, #fff);
  border: 0.5px solid var(--color-border-tertiary, #e5e7eb);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.15s;
}
.aft-card:hover {
  border-color: var(--color-border-secondary, #d1d5db);
}
.aft-card--you {
  border: 1.5px solid #7c3aed;
}
.aft-card--pending {
  opacity: 0.72;
}

/* Card header row (contains the gear button) */
.aft-card-header {
  display: flex;
  justify-content: flex-end;
  padding: 6px 6px 0;
  min-height: 24px;
}

/* Gear / settings button */
.aft-gear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--color-text-tertiary, #9ca3af);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.aft-gear-btn:hover {
  background: var(--color-background-secondary, #f3f4f6);
  color: var(--color-text-primary, #111827);
}
.aft-unlink-btn {
  color: #dc2626;
  margin-left: 2px;
}
.aft-unlink-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* Card body (clickable — loads that person's tree) */
.aft-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 10px;
  color: inherit;
  cursor: pointer;
}
.aft-card-body:hover {
  background: var(--color-background-secondary, #f9fafb);
}

/* Avatars */
.aft-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 2px;
  flex-shrink: 0;
}
.aft-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}
.aft-avatar--ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--color-border-secondary, #d1d5db);
  background: var(--color-background-secondary, #f9fafb);
  color: var(--color-text-tertiary, #9ca3af);
}

/* Card text */
.aft-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #111827);
  text-align: center;
  line-height: 1.3;
}
.aft-card-rel {
  font-size: 11px;
  color: var(--color-text-tertiary, #9ca3af);
  text-align: center;
}

/* Badges */
.aft-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
}
.aft-badge--you {
  background: #ede9fe;
  color: #6d28d9;
}
.aft-badge--pending {
  background: #ffedd5;
  color: #c2410c;
}

/* Add strip */
.aft-add-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 8px 8px 10px;
  border-top: 0.5px solid var(--color-border-tertiary, #e5e7eb);
}
.aft-add-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--color-text-secondary, #6b7280);
  background: var(--color-background-secondary, #f9fafb);
  border: 0.5px solid var(--color-border-tertiary, #e5e7eb);
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.aft-add-btn:hover {
  background: var(--color-background-primary, #fff);
  color: var(--color-text-primary, #111827);
  border-color: var(--color-border-secondary, #d1d5db);
}

/* Empty slot */
.aft-empty-slot {
  width: 148px;
  border: 1.5px dashed var(--color-border-tertiary, #e5e7eb);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px 18px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: inherit;
}
.aft-empty-slot:hover {
  border-color: var(--color-border-secondary, #d1d5db);
  background: var(--color-background-secondary, #f9fafb);
}
.aft-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px dashed var(--color-border-secondary, #d1d5db);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary, #9ca3af);
}
.aft-empty-slot:hover .aft-empty-icon {
  border-color: var(--color-border-primary, #9ca3af);
  color: var(--color-text-secondary, #6b7280);
}
.aft-empty-label {
  font-size: 12px;
  color: var(--color-text-tertiary, #9ca3af);
  text-align: center;
}

/* Admin invite section in user modal */
.admin-invite-section {
  border-top: 1px solid #e5e7eb;
  margin-top: 20px;
  padding-top: 20px;
}
.admin-invite-heading {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 6px;
}
.admin-invite-form {
  margin-top: 12px;
}
.admin-invite-errors {
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
}

/* Admin modal tabs */
.admin-modal-tabs {
  margin-top: 16px;
}
.admin-modal-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}
.admin-modal-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.admin-modal-tab.active,
.admin-modal-tab[aria-selected="true"] {
  color: #6d28d9;
  border-bottom-color: #6d28d9;
}

/* ── Post FAB (floating action button) ─────────────────────── */
.post-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #7c3aed;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
  z-index: 900;
}
.post-fab:hover {
  background: #6d28d9;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.55);
  transform: scale(1.06);
}
.post-fab:active {
  transform: scale(0.96);
}
@media (max-width: 640px) {
  .post-fab {
    bottom: 20px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
}

/* ── iOS input zoom fix ──────────────────────────────────────────────────────
   iOS Safari zooms the viewport whenever a focused <input>, <select>, or
   <textarea> has a computed font-size below 16px. Setting exactly 16px on
   touch devices prevents that automatic zoom. We intentionally do NOT use
   `user-scalable=no` or `maximum-scale=1` in the viewport meta tag because
   those disable pinch-to-zoom entirely, which breaks accessibility.

   `pointer: coarse` matches iOS, Android, and any other touch-primary device.
   It does NOT match laptops with touchscreens in trackpad mode (pointer: fine).
   The visual appearance is unchanged — layout/padding still controls perceived
   size; only the font rendering metric that iOS inspects before deciding
   whether to zoom is affected. ─────────────────────────────────────────── */
@media (pointer: coarse) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  input[type="datetime-local"],
  input[type="date"],
  select,
  textarea,
  /* contenteditable divs (caption, comments) trigger the same iOS zoom */
  .upload-caption,
  .comment-input,
  .admin-post-ce {
    font-size: 16px;
  }
}

/* Admin toast notification */
.admin-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  animation: fadeInUp .2s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ══════════════════════════════════════
   iOS ADD-TO-HOME-SCREEN NUDGE
   Fixed card above Safari's bottom toolbar; JS-shown on iOS only.
══════════════════════════════════════ */

.ios-nudge {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.16), 0 1px 4px rgba(0,0,0,0.08);
  padding: 14px 14px 14px 16px;
}
.ios-nudge-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ios-nudge-body { flex: 1; min-width: 0; }
.ios-nudge-title {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin-bottom: 3px;
}
.ios-nudge-desc {
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.ios-nudge-share {
  display: inline-block;
  vertical-align: middle;
  color: #007aff;
  flex-shrink: 0;
}
.ios-nudge-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #aaa;
  display: flex;
  align-items: center;
  border-radius: 50%;
}
.ios-nudge-close:hover { color: #555; background: #f0f0f0; }

/* ══════════════════════════════════════
   PUSH NOTIFICATION NUDGE BANNER
   Fixed to bottom of screen; appears only in PWA standalone mode
   via the pushNudge() Alpine component in app.js.
══════════════════════════════════════ */

.push-nudge {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 12px 16px;
  /* Respect iOS status bar */
  padding-top: max(12px, env(safe-area-inset-top, 12px));
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.push-nudge-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.push-nudge-icon {
  flex-shrink: 0;
  color: #b45309;
  margin-top: 2px;
  line-height: 0;
}

.push-nudge-body {
  flex: 1;
  min-width: 0;
}

.push-nudge-title {
  font-size: 14px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 2px;
}

.push-nudge-desc {
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.45;
  margin-bottom: 10px;
}

.push-nudge-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.push-nudge-btn {
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: background 0.12s, opacity 0.12s;
}
.push-nudge-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.push-nudge-btn--primary {
  background: #d97706;
  color: #fff;
}
.push-nudge-btn--primary:hover:not(:disabled) { background: #b45309; }

.push-nudge-btn--ghost {
  background: transparent;
  color: #92400e;
}
.push-nudge-btn--ghost:hover:not(:disabled) { background: #fde68a; }

.push-nudge-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #92400e;
  padding: 2px;
  opacity: 0.65;
  line-height: 0;
  transition: opacity 0.12s;
}
.push-nudge-close:hover { opacity: 1; }

/* Alpine slide-down entrance / slide-up exit */
.push-nudge-in  { transition: transform 0.35s cubic-bezier(0.34, 1.15, 0.64, 1), opacity 0.3s ease; }
.push-nudge-out { transition: transform 0.22s ease, opacity 0.18s ease; }
.push-nudge-hidden  { transform: translateY(-100%); opacity: 0; }
.push-nudge-visible { transform: translateY(0);     opacity: 1; }

/* ══════════════════════════════════════
   EVENTS BOTTOM SHEET
   Opened by the Events tab in the mobile bottom nav.
   Mimics the notification drawer but slides up from the bottom.
══════════════════════════════════════ */

.events-sheet-overlay {
  /* display: flex — Alpine x-show toggles via inline style="display:none" when closed.
     Removing that inline style reveals this flex base, same pattern as .notif-overlay. */
  display: flex;
  align-items: flex-end;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.4);
}

.events-sheet {
  background: var(--surface-2, #fff);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Leave room for the bottom nav bar */
  padding-bottom: max(80px, calc(env(safe-area-inset-bottom, 0px) + 76px));
}

.events-sheet-body {
  /* wrapper so htmx can swap the whole inner content */
}

.events-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong, #d1d5db);
  border-radius: 2px;
  margin: 12px auto 16px;
}

.events-sheet-heading {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 16px 8px;
  margin: 0;
}

.events-sheet-loading {
  font-size: 14px;
  color: var(--text-muted, #9ca3af);
  padding: 12px 16px 24px;
  margin: 0;
}

.events-sheet-empty {
  font-size: 14px;
  color: var(--text-muted, #9ca3af);
  padding: 8px 16px 24px;
  margin: 0;
}

.events-sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-primary, #111);
  border-top: 0.5px solid var(--border, #f0f0f0);
  transition: background 0.1s;
}
.events-sheet-row:first-of-type { border-top: none; }
.events-sheet-row:active { background: var(--surface-1, #f9f9f9); }

.events-sheet-dot {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-accent, #e8f0fe);
  color: var(--text-accent, #1a56db);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.events-sheet-sub { padding-left: 28px; }

.events-sheet-sub-dot {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-success, #e6f9f0);
  color: var(--text-success, #0f766e);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.events-sheet-sub-month { font-size: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.events-sheet-sub-day   { font-size: 13px; font-weight: 700; }

.events-sheet-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.events-sheet-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.events-sheet-meta {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
}

/* ══════════════════════════════════════
   BOTTOM NAVIGATION BAR (mobile only)
   Floating pill card with center FAB.
   Hidden on desktop — the top nav handles navigation there.
══════════════════════════════════════ */

/* Hidden on desktop — only appears at mobile breakpoint */
.bottom-nav { display: none; }

@media (max-width: 768px) {
  /* Push page content up so it isn't hidden behind the nav */
  body { padding-bottom: 90px; }

  /* Hide the fixed-position post-fab — the bottom nav FAB replaces it */
  .post-fab { display: none; }

  .bottom-nav {
    overflow:visible;
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    /* Respect iOS home indicator */
    bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    height: 64px;
    background: var(--surface-2, #fff);
    border: 0.5px solid var(--border, #e5e7eb);
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 0 4px 8px;
    z-index: 500;
  }

  /* Each nav item: icon + optional label */
  .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    padding: 10px 4px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    text-decoration: none;
    min-width: 0;
    font-family: inherit;
    transition: color 0.12s;
  }
  .bn-item.bn-active { color: #7c3aed; }
  .bn-item:active { opacity: 0.7; }

  .bn-icon { flex-shrink: 0; }

  /* Label: always rendered but zero-height except on active tab */
  .bn-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    overflow: hidden;
    transition: max-height 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
  }
  .bn-active .bn-label {
    max-height: 14px;
    opacity: 1;
  }

  /* Notification icon wrapper (for badge positioning) */
  .bn-icon-wrap {
    position: relative;
    display: inline-flex;
    line-height: 0;
  }

  /* Unread badge */
  .bn-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* Center FAB slot — lifts the button above the card */
  .bn-fab-slot {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 8px;
    /* Pull up so the circle breaks above the card top edge */
    margin-top: -22px;
    margin-bottom: 15px;
  }

  .bn-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #7c3aed;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
    transition: background 0.12s, transform 0.12s;
    flex-shrink: 0;
  }
  .bn-fab:hover  { background: #6d28d9; }
  .bn-fab:active { transform: scale(0.93); }
}

/* ── Registration modal (user-facing) ─────────────────────────────────────── */

.reg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.reg-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}

.reg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.reg-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.reg-modal-step {
  padding: 16px 24px 0;
}

.reg-modal-step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reg-mode-btns {
  display: flex;
  gap: 8px;
}

.reg-mode-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.reg-mode-btn-active {
  border-color: var(--blue);
  background: #eff6ff;
  color: #1d4ed8;
}

.reg-people-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
}

.reg-person-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.reg-person-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.reg-person-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.reg-person-remove {
  font-size: 12px;
  color: #dc2626;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
}
.reg-person-remove:hover { background: #fee2e2; }

.reg-person-fields {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reg-field-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reg-field-label-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.reg-field-req {
  color: #dc2626;
  margin-left: 2px;
}

.reg-add-person {
  padding: 0 24px 16px;
  position: relative;
}

.reg-search-results {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.reg-search-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.reg-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
}
.reg-search-result:last-child { border-bottom: none; }
.reg-search-result:hover { background: #f9fafb; }

.reg-search-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.reg-search-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.reg-search-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.reg-search-username {
  font-size: 11px;
  color: var(--muted);
}

.reg-modal-error {
  margin: 0 24px 12px;
  padding: 10px 14px;
  background: #fee2e2;
  border-radius: 8px;
  font-size: 13px;
  color: #991b1b;
}

.reg-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Admin reg field editor ───────────────────────────────────────────────── */

.reg-field-add-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 0;
  flex-wrap: wrap;
}

.reg-field-add-form .form-input {
  flex: 1;
  min-width: 180px;
}

.reg-field-required-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.reg-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fafafa;
}

.reg-field-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.reg-field-required-badge {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 7px;
  border-radius: 10px;
}

/* ── Admin reg table group indicators ────────────────────────────────────── */

.reg-user-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.reg-group-chip {
  font-size: 11px;
  font-weight: 600;
  background: #ede9fe;
  color: #5b21b6;
  padding: 2px 8px;
  border-radius: 10px;
}

.reg-member-arrow {
  color: var(--muted);
  font-size: 14px;
}

.reg-by-label {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.reg-answer-cell {
  font-size: 13px;
  color: var(--text);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reg-row-member td:first-child {
  padding-left: 24px;
}
