/* ══════════════════════════════════════
   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;
}

/* 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: url('/static/img/hero-bg.jpg') center/cover 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: center;
  padding: 16px 24px;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  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;
}

.nav-pills { display: flex; 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;
  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; }

.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); }

.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);
}



.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-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 image */
.post-image {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 340px;
  overflow: hidden;
  position: relative;
  background: #f3f4f6;
  display: block;
}
.post-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
  transition: transform 0.5s ease;
}
.post:hover .post-image img { transform: scale(1.025); }

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

.post-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video inside post */
.post-media-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  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-right */
.post-carousel-counter {
  position: absolute;
  top: 10px;
  right: 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;
}

/* 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; }

/* 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 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f3f4f6;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 3px 10px 3px 7px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font-family: inherit;
}
.reaction-chip:hover { background: #e9f0fe; border-color: #bfdbfe; }
.reaction-chip.mine { background: #eff6ff; border-color: #93c5fd; }
.reaction-chip .e { font-size: 16px; line-height: 1; }
.reaction-chip .n { font-weight: 600; color: #374151; font-size: 12.5px; }

.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; }

.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;
}

.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-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
}

.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; }

.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; }

/* ══════════════════════════════════════
   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;
}

/* 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 */
.pdp-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.pdp-hashtag {
  font-size: 13px;
  color: var(--blue, #2563eb);
  font-weight: 500;
}

/* 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;
}

/* ══════════════════════════════════════
   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; }
  .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: 240px; }
  .hero-fade { height: 100px; }

  .content { padding: 0 16px 0; margin-top: -60px; }
  .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; }

  .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);
}

/* ── 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;
}

/* ── 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;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-content { padding: 16px; }
  .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; }
}

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

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

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

.profile-cover {
  position: relative;
  height: 220px;
  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-stats {
  display: flex;
  gap: 28px;
}

.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;
}
.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;
}
@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;
}

.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-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 0;
  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-top: 4px; }

.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-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); }
}
