:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --text: #1f2937;
  --sub: #6b7280;

  /* 🔹 New brand colours */
  --primary: #551fbd;
  /* main */
  --secondary: #551fbd;
  /* sub */

  /* Helpers */
  --primary-soft: #f3efff;
  --secondary-soft: #e6fbff;

  --accent: #551fbd;
  /* use sub as accent */
  --danger: #dc2626;
  --border: #e5e7eb;
  --nav-h: 72px;
  --gap-top: 20px;
}

/* 🦴 Skeleton Loader Styles
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: 8px;
}

.skeleton-district {
  height: 42px;
  margin-bottom: 12px;
  border-radius: 10px;
  width: 100%;
}

.skeleton-card {
  height: 210px;
  margin: 18px 12px;
  border-radius: 12px;
}

.skeleton-comment {
  height: 74px;
  margin-bottom: 8px;
  border-radius: 12px;
}

.skeleton-ad {
  height: 300px;
  margin-top: 10px;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
} */

/* Hide real content initially */
/* .content-hidden {
  opacity: 0;
  visibility: hidden;
}

.content-reveal {
  opacity: 1;
  visibility: visible;
}


.content-reveal {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
} */

* {
  box-sizing: border-box;
}


html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: url('assets/background.jpg');
  background-size: cover;
  background-repeat: repeat;
  background-position: center;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

/* Navbar wrapper (we control this) */
#topNav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
}

main.container {
  margin-top: calc(var(--nav-h) + var(--gap-top));
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 16px;
  height: calc(98vh - var(--nav-h) - var(--gap-top) + 40px);
  align-items: stretch;
}

.card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: none;
}

.pad {
  padding: 10px 14px 14px;
}

.left,
.feed,
.recent {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.left,
.recent {
  overflow: auto;
}

.feed {
  overflow: hidden;
}

.feed-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-top: 6px;
}

.left,
.recent,
.feed-body {
  scrollbar-width: none;
}

.left::-webkit-scrollbar,
.recent::-webkit-scrollbar,
.feed-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* RIGHT COLUMN: split into 2 equal panels */
.recent {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  /* IMPORTANT so children can scroll */
  overflow: hidden;
  /* stop parent scroll */
}

/* each section takes half height */
.recent .recent-box,
.recent .ads-box {
  flex: 1 1 50%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fff;
  padding: 10px 10px 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

/* space between the 2 boxes */
.recent .ads-box {
  margin-top: 12px;
}

/* headers inside each box */
.recent .box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f6;
  margin-bottom: 8px;
}

/* body scroll area inside each box */
.recent .box-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

/* Sponsored header as solid primary bar */
.recent .ads-box .box-head {
  background: var(--primary);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px 12px 0 0;
  border-bottom: none;
  margin-bottom: 0;
}

.recent .box-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Sponsored badge */
.ad-badge {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #e1d9ff;
}

/* ad card inside bottom list */
.ads-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

/* Bigger image + centered inside ad card */
.ad-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* center content horizontally */
  padding: 12px;
}

.recent .ads-box .ad-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* Sponsored text white */
.recent .ads-box .ad-badge {
  background: transparent;
  color: #fff;
  border: none;
}

/* tighten meta area */
.ad-card .ad-meta {
  width: 100%;
  max-width: 320px;
  padding: 10px 0 0;
}


.ad-card .ad-title {
  font-weight: 800;
  font-size: 13px;
  margin: 0 0 8px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-card .ad-actions {
  display: flex;
  gap: 10px;
}

.ad-card .ad-btn {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, .10);
}

.ad-card .ad-btn-wa {
  background: #a7f3d0;
  color: #064e3b;
}

.ad-card .ad-btn-view {
  background: var(--primary);
  color: #fff;
  border: none;
}

.icon-sf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.icon-sf svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon-sf-sm {
  width: 16px;
  height: 16px;
}

.icon-sf-md {
  width: 18px;
  height: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.panel-title-with-bar::before {
  content: "";
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  /* was green */
}

.left-subtitle {
  font-size: 12px;
  color: var(--sub);
  margin: 4px 0 8px;
}

.district-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.district-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.district-item:hover {
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.badge-count {
  background: var(--primary-soft);
  /* was light green */
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #e1d9ff;
}

.filters .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.filters label {
  font-size: 12px;
  color: #6b7280;
}

.filters input {
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  outline: none;
}

.filters .row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filters .btns {
  display: flex;
  gap: 8px;
}

.filters button {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.filters .apply {
  background: var(--primary);
  color: #fff;
}

.filters .clear {
  background: var(--accent);
  /* now secondary colour */
  color: #1f2937;
}

.filters .back {
  background: #eaeaea;
  color: #111;
}

.feed {
  display: flex;
  flex-direction: column;
}

.feed .feed-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid #eef2f6;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar-create {
  text-decoration: none;
  background: var(--primary);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toolbar-create:hover {
  background: #3e1492;
  /* darker purple instead of green */
}

.feed-card {
  display: block;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  margin: 12px 12px;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .2s, background .2s, border-color .2s, transform .1s;
}

.feed-card:hover {
  background: #fafafa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
  transform: translateY(-1px);
}

.feed-card.is-obituary {
  border-left: 4px solid #e5e7eb;
}

.feed-card.is-remembrance {
  border-left: 4px solid var(--secondary);
  /* was green */
}

.fc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #eef2f6;
}

.fc-head-obituary {
  background: #f9fafb;
}

.fc-head-remembrance {
  background: var(--secondary-soft);
  /* was light green */
  border-bottom-color: #b8f2fb;
}

.fc-type {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-type-pill {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.fc-type-pill-rem {
  background: #e0ecff;
  color: var(--primary);
  /* was green text */
}

.fc-type-pill-obi {
  background: #e5e7eb;
  color: #374151;
}

.fc-time {
  color: #6b7280;
  font-size: 13px;
}

.fc-body {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  padding: 14px 18px 14px 16px;
  background: #fff;
  align-items: center;
}

.fc-img {
  width: 104px;
  height: 104px;
  border-radius: 12px;
  object-fit: cover;
  background: #eee;
}

.fc-name {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 20px;
  color: #1f2937;
}

.fc-line {
  margin: 2px 0;
  color: #4b5563;
  font-size: 15px;
}

.fc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 18px 12px;
  background: #fff;
}

.fc-tributes {
  color: var(--danger);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.fc-btn {
  background: var(--primary);
  /* was green */
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fc-btn:hover {
  background: #3e1492;
}

.recent-sub {
  font-size: 12px;
  color: var(--sub);
  margin: 4px 0 6px;
}

.recent ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.recent li {
  padding: 0;
  border: none;
}

.recent .item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
  transition: box-shadow .2s, background .2s, transform .1s;
}

.recent .item:hover {
  background: #fafafa;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .04);
  transform: translateY(-1px);
}

.recent img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
}

.recent-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.recent .small {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recent-empty {
  font-size: 12px;
  color: #6b7280;
  padding: 8px 2px;
}

.feed-card {
  margin: 18px 12px;
  /* bigger vertical gap between posts */
}

.fc-body {
  padding-bottom: 4px !important;
}

.fc-foot {
  padding-top: 4px !important;
}

.fc-btn.neon {
  animation: neonBlink 1.2s infinite ease-in-out;
}

@keyframes neonBlink {

  0%,
  100% {
    box-shadow: 0 0 6px #8b5cf6,
      0 0 12px #8b5cf6;
  }

  50% {
    box-shadow: 0 0 0px transparent;
  }
}


/* ================== RESPONSIVE ================== */

@media (min-width: 1200px) {
  .left {
    margin-left: 80px !important;
  }

  .recent {
    margin-right: 80px !important;
  }
}

@media (max-width:1024px) {
  main.container {
    grid-template-columns: 220px 1fr 260px;
    height: calc(100vh - var(--nav-h) - var(--gap-top));
  }
}

@media (max-width:768px) {
  main.container {
    grid-template-columns: 260px 1fr;
    height: calc(103vh - var(--nav-h) - var(--gap-top));
  }

  .recent {
    display: none;
  }

  #leftTitle {
    white-space: normal !important;
  }

  #leftTitle::after {
    content: "";
  }

  #leftTitle br {
    display: inline;
  }
}

@media (max-width:480px) {

  html,
  body {
    height: 100%;
    overflow: hidden !important;
    /* ✅ stop page scrolling */
  }

  main.container {
    grid-template-columns: 1fr;
    margin-top: calc(var(--nav-h) + var(--gap-top));
    height: calc(103dvh - var(--nav-h) - var(--gap-top));
    /* ✅ fixed screen height */
    padding: 12px;
    padding-bottom: 12px;
  }

  .left,
  .recent {
    display: none !important;
  }

  /* ✅ feed container fixed, only inside scrolls */
  .feed {
    height: 100%;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .feed-toolbar {
    flex: 0 0 auto;
  }

  .feed-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    /* ✅ ONLY this scrolls */
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    /* ✅ smooth iOS scroll */
    overscroll-behavior: contain;
    /* ✅ stop bounce pulling page */
    padding-top: 6px;
  }

  /* cards a bit tighter */
  .feed-card {
    margin: 10px 10px;
  }

  .fc-head {
    padding: 6px 10px;
  }

  .fc-body {
    grid-template-columns: 70px 1fr;
    gap: 10px;
    padding: 9px 18px 12px;
  }

  .fc-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
  }

  .fc-name {
    font-size: 16px;
    margin-bottom: 2px;
  }

  .fc-line {
    font-size: 13px;
    margin: 1px 0;
  }

  .fc-foot {
    padding: 6px 10px 8px;
  }

  .fc-tributes {
    font-size: 13px;
  }

  .fc-type-pill {
    font-size: 11px;
    padding: 2px 10px;
  }

  .fc-time {
    font-size: 12px;
  }

  /* ====== TOP DATE FILTER – MOBILE STYLE (same look as desktop) ====== */

  .feed-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .feed-toolbar-actions {
    margin-left: auto;
  }

  /* white pill full-width on mobile */
  .date-filter-pop {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--nav-h) + 10px);
    max-width: none;
    border-radius: 999px;
    padding: 6px 8px;
    display: none;
    /* toggled by .open */
    align-items: center;
    gap: 6px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.25);
    z-index: 120;
  }

  .date-filter-pop.open {
    display: flex;
  }

  /* From / To inputs behave like one long pill */
  .date-filter-pop .flatpickr-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 38px;
    font-size: 13px;
  }

  .date-sep {
    font-size: 12px;
    padding: 0 2px;
  }

  .df-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  /* calendar centered under the pill, not overflowing */
  #dateFilterPanel .flatpickr-calendar {
    top: 115% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 340px;
    width: 100%;
  }
}


/* upgraded card look */
.card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid #ffffff40;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

.flag-sl {
  width: 22px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  margin-right: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.feed-toolbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Category filter popup */
.category-filter-pop {
  position: absolute;
  top: 110%;
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  z-index: 20;
  min-width: 180px;
}

.category-filter-pop.open {
  display: flex;
}

.category-filter-pop label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s ease;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  user-select: none;
}

.category-filter-pop label:hover {
  background: #f3efff;
}

.category-filter-pop input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: var(--primary);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  background: #f3efff;
  border-color: #d6ccff;
}

/* (you can delete the input[type="date"] rule; you use type="text" now) */


.date-sep {
  font-size: 12px;
  color: #6b7280;
}

.df-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
}

.df-apply {
  background: var(--primary);
  color: #fff;
}

.df-clear {
  background: #f3f4f6;
  color: #6b7280;
}

.df-btn:focus,
.icon-btn:focus {
  outline: 2px solid #c4b5fd;
  outline-offset: 2px;
}

/* ===== Flatpickr input look (date box style) ===== */
input.flatpickr-input {
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 8px 36px 8px 12px;
  /* extra right space for calendar icon */
  font-size: 14px;
  height: 40px;
  box-sizing: border-box;
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input.flatpickr-input:hover {
  border-color: #c4b5fd;
  background: #ffffff;
}

input.flatpickr-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(85, 31, 189, 0.16);
}

/* hide native date picker icon so only flatpickr shows */
input.flatpickr-input::-webkit-calendar-picker-indicator {
  opacity: 0;
}

/* ===== Flatpickr calendar panel styling ===== */
.flatpickr-calendar {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  font-family: inherit;
}

/* top month bar */
.flatpickr-months .flatpickr-month {
  background: #ffffff;
  color: var(--text);
  height: 44px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  font-weight: 600;
  color: var(--primary);
}

/* weekday row */
.flatpickr-weekdaycontainer,
.flatpickr-weekday {
  color: #6b7280;
  font-weight: 500;
}

/* navigation arrows */
.flatpickr-next-month,
.flatpickr-prev-month {
  fill: var(--primary);
  color: var(--primary);
}

/* normal day cells */
.flatpickr-day {
  border-radius: 999px;
  /* round like circle */
}

/* hover state */
.flatpickr-day:hover {
  background: #f3e8ff;
  border-color: #f3e8ff;
}

/* today outline */
.flatpickr-day.today {
  border-color: var(--primary);
  color: var(--primary);
}

/* selected day / range start-end (solid purple circle) */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* middle of range – soft purple background */
.flatpickr-day.inRange {
  background: #f3e8ff;
  border-color: #f3e8ff;
  color: #111827;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.back-top {
  display: none;
  /* 👈 hidden normally */
  background: #eaeaea;
  color: #111;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.back-top:hover {
  background: #d4d4d4;
}


/* DESKTOP sizing for popup + calendar */
@media (min-width: 481px) {
  .date-filter-pop {
    max-width: 420px;
    /* nice compact pill */
  }

  .date-filter-pop .flatpickr-input {
    width: 150px;
  }

  #dateFilterPanel .flatpickr-calendar {
    top: 110% !important;
    /* just under the pill */
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* popup – DESKTOP / TABLET ONLY */
@media (min-width: 481px) {
  .date-filter-pop {
    position: absolute;
    top: 110%;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    display: none;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    z-index: 20;
  }

  .date-filter-pop.open {
    display: flex;
  }
}

/* ✅ Applies only to calendars we tag from JS */
@media (max-width: 768px) {

  .flatpickr-calendar.df-mobile-cal {
    border-radius: 18px !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18) !important;
    overflow: hidden !important;
    width: min(360px, 92vw) !important;
    max-width: 92vw !important;
    background: #fff !important;
  }

  /* header centered like screenshot #2 */
  .flatpickr-calendar.df-mobile-cal .flatpickr-months {
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 14px 44px 10px !important;
    background: #fff !important;
  }

  .flatpickr-calendar.df-mobile-cal .flatpickr-current-month {
    position: static !important;
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
    font-size: 20px !important;
    color: #551fbd !important;
  }

  /* arrows left/right */
  .flatpickr-calendar.df-mobile-cal .flatpickr-prev-month,
  .flatpickr-calendar.df-mobile-cal .flatpickr-next-month {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 8px !important;
  }

  .flatpickr-calendar.df-mobile-cal .flatpickr-prev-month {
    left: 10px !important;
  }

  .flatpickr-calendar.df-mobile-cal .flatpickr-next-month {
    right: 10px !important;
  }

  .flatpickr-calendar.df-mobile-cal .flatpickr-prev-month svg,
  .flatpickr-calendar.df-mobile-cal .flatpickr-next-month svg {
    fill: #551fbd !important;
    width: 18px !important;
    height: 18px !important;
  }

  /* ✅ Fix weekday + date alignment (grid) */
  .flatpickr-calendar.df-mobile-cal .flatpickr-weekdaycontainer {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    width: 100% !important;
  }

  .flatpickr-calendar.df-mobile-cal .flatpickr-weekday {
    display: flex !important;
    justify-content: center !important;
  }

  .flatpickr-calendar.df-mobile-cal .dayContainer,
  .flatpickr-calendar.df-mobile-cal .flatpickr-dayContainer {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }

  /* selected day = purple outline */
  .flatpickr-calendar.df-mobile-cal .flatpickr-day.selected,
  .flatpickr-calendar.df-mobile-cal .flatpickr-day.startRange,
  .flatpickr-calendar.df-mobile-cal .flatpickr-day.endRange {
    background: transparent !important;
    border: 2px solid #551fbd !important;
    color: #551fbd !important;
    border-radius: 999px !important;
  }

  /* hide year up/down */
  .flatpickr-calendar.df-mobile-cal .numInputWrapper span.arrowUp,
  .flatpickr-calendar.df-mobile-cal .numInputWrapper span.arrowDown {
    display: none !important;
  }
}

@media (max-width: 768px) {

  .flatpickr-calendar.df-mobile-cal,
  .flatpickr-calendar.df-mobile-cal .flatpickr-innerContainer,
  .flatpickr-calendar.df-mobile-cal .flatpickr-rContainer,
  .flatpickr-calendar.df-mobile-cal .flatpickr-days,
  .flatpickr-calendar.df-mobile-cal .dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }

  /* ✅ make each day cell fit the 7-column grid properly */
  .flatpickr-calendar.df-mobile-cal .flatpickr-day {
    max-width: none !important;
    width: 100% !important;
  }
}

/* 🔒 Hide date filter button by default (desktop & laptop) */
#dateFilterToggle {
  display: none;
}

/* 🔒 Hide category filter button on desktop */
#categoryFilterToggle.mobile-only {
  display: none;
}

.feed-type-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.type-nav-btn {
  padding: 6px 16px;
  border: none;
  background: #f3f4f6;
  color: var(--text);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}

.type-nav-btn:hover {
  background: #e5e7eb;
}

.type-nav-btn.active {
  background: var(--primary);
  color: #fff;
}

@media (max-width: 910px) {
  .feed-type-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .feed-type-nav .type-nav-btn[data-type="remembrance"] {
    flex-basis: 100%;
    margin-top: 4px;
  }
}

.desktop-only {
  display: flex;
}

/* 📱 Show ONLY on mobile */
@media (max-width: 768px) {
  #dateFilterToggle {
    display: inline-flex;
  }

  #categoryFilterToggle.mobile-only {
    display: inline-flex;
  }

  .desktop-only {
    display: none;
  }
}

body.maint-locked {
  overflow: hidden !important;
}

html.maint-locked,
body.maint-locked {
  height: 100%;
  overflow: hidden !important;
  position: fixed;
  /* ✅ stops page moving */
  width: 100%;
}

/* blur + block everything except popup */
body.maint-locked>*:not(#maintenancePopup) {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.maint-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .60);
}

.maint-card {
  width: min(980px, 94vw);
  /* bigger */
  max-height: 86vh;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
  text-align: center;
}

.maint-img {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}

.maint-title {
  margin-top: 10px;
  font-weight: 800;
  font-size: 18px;
  color: #111827;
}

/* =========================
   DEFAULT SHADOW (always)
   ========================= */
.district-item,
.feed-card,
.recent .item {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  will-change: transform;
}

/* =========================
   HOVER: ZOOM + STRONGER SHADOW (desktop only)
   ========================= */
@media (hover: hover) and (pointer: fine) {

  .district-item:hover,
  .feed-card:hover,
  .recent .item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  }
}

/* Optional: make post cards pop slightly more than list items */
@media (hover: hover) and (pointer: fine) {
  .feed-card:hover {
    transform: scale(1.025);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  }
}

@media (max-width: 768px) {
  .date-filter-pop {
    top: calc(var(--nav-h) + 22px) !important;
    /* move away from header */
    background: #ffffff !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
    box-shadow:
      0 20px 45px rgba(15, 23, 42, 0.35) !important;
    z-index: 1500 !important;
  }
}

/* ===== RIGHT PANEL (Recent Tributes) – compact mode ===== */
.recent ul {
  gap: 8px;
  /* was 10px */
}

.recent .item {
  padding: 8px 10px;
  /* was 10px 12px */
  gap: 10px;
  /* was 12px */
  border-radius: 10px;
  /* slightly tighter */
}

.recent img {
  width: 46px;
  /* was 60px */
  height: 46px;
  /* was 60px */
  border-radius: 8px;
  /* was 10px */
}

.recent-name {
  font-size: 13px;
  /* was 15px */
  font-weight: 700;
  margin-bottom: 1px;
  /* reduce spacing */
  line-height: 1.15;
}

.recent .small {
  font-size: 12px;
  /* was 13px */
  gap: 4px;
  line-height: 1.15;
}

/* optional: stop long names from taking 2 lines */
.recent-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent.card.pad {
  padding: 8px 10px 10px !important;
  /* overrides .pad */
}

.recent .panel-title {
  font-size: 16px;
  /* was 18px */
}

.recent-sub {
  font-size: 11px;
  /* was 12px */
  margin: 2px 0 6px;
}

/* ===== Recent Tributes - Sponsored Ad card (same look) ===== */
.recent .ad-item {
  display: block;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.recent .ad-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.recent .ad-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #e1d9ff;
}

.recent .ad-title {
  font-size: 12px;
  color: #6b7280;
  font-weight: 700;
  margin-left: auto;
  padding-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.recent .ad-imgwrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
}

.recent .ad-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: #eee;
}

.recent .ad-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.recent .ad-btn {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, .10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.recent .ad-btn-wa {
  background: #a7f3d0;
  color: #064e3b;
}

.recent .ad-btn-view {
  background: var(--primary);
  color: #fff;
  border: none;
}

.recent .ad-btn:hover {
  filter: brightness(.97);
}

/* Carousel wrapper */
.ad-carousel {
  overflow: hidden;
  width: 100%;
}

.ad-track {
  display: flex;
  width: 100%;
  transform: translateX(0%);
}

/* each slide takes full width */
.ad-slide {
  flex: 0 0 100%;
  width: 100%;
}

/* dots */
.ad-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 8px;
}

.ad-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d1d5db;
}

.ad-dot.active {
  background: var(--primary);
}

/* arrows */
.ad-arrows {
  display: flex;
  gap: 6px;
}

.ad-arrows button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  color: var(--primary);
  font-weight: 900;
}

.ad-arrows button:hover {
  background: #f3efff;
}

/* image wrapper so overlay can sit on top */
.recent .ads-box .ad-imgwrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
}

/* keep your big image */
.recent .ads-box .ad-imgwrap img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

/* floating hover button (hidden by default) */
/* floating hover button - bottom center */
.recent .ads-box .ad-float-wa {
  position: absolute;
  left: 50%;
  bottom: 90px;
  /* adjust up/down */
  transform: translate(-50%, 6px);
  /* centered + slight hidden slide */

  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;

  background: #22c55e;
  color: #fff;

  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);

  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}

/* show on hover */
.recent .ads-box .ad-imgwrap:hover .ad-float-wa {
  opacity: 1;
  transform: translate(-50%, 0);
  /* keeps center */
  pointer-events: auto;
}

/* keep your buttons under image */
.recent .ads-box .ad-actions.under {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Sponsored section: no scroll */
.ads-box #sponsoredBox {
  overflow: hidden !important;
}

/* + Your Ad button on sponsored bar */
.recent .ads-box .your-ad-btn {
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  border: none;
}

.recent .ads-box .your-ad-btn:hover {
  background: #f3f4f6;
}

.recent .ads-box .box-body {
  padding: 0;
}

/* ✅ Sponsored section: fit flush to container (no extra space) */
.recent .ads-box {
  padding: 0 !important;
  overflow: hidden;
  /* keep rounded corners clean */
}

/* remove internal padding creating the gap */
.recent .ads-box .ad-card {
  padding: 0 !important;
}

/* keep image + content perfectly flush */
.recent .ads-box .ad-imgwrap {
  margin-top: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

/* image touches edges */
.recent .ads-box .ad-imgwrap img {
  border-radius: 0 !important;
  height: 260px;
}

/* ✅ Mobile sponsored block hidden by default (desktop/tablet) */
.mobile-ads {
  display: none;
}

/* ✅ Show ABOVE Memorial Feed only on responsive */
@media (max-width: 768px) {
  .mobile-ads {
    display: block;
    margin-bottom: 12px;
  }

  .mobile-ads.ads-box {
    padding: 0 !important;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #ececec;
    background: #fff;
    max-width: 320px;
    /* controls WIDTH */
    height: auto;
    /* prevents forced tall height */
    margin: 0 auto 14px;
    /* centers horizontally */
  }

  /* Purple bar */
  .mobile-ads .box-head {
    background: var(--primary);
    color: #fff;
    padding: 14px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    margin: 0;
    border-bottom: none;
  }

  .mobile-ads .ad-badge {
    background: transparent !important;
    color: #fff !important;
    border: none !important;
    font-weight: 900;
    letter-spacing: .08em;
  }

  /* + Your Ad pill */
  .mobile-ads .your-ad-btn {
    background: #fff;
    color: var(--primary);
    font-weight: 900;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    border: none;
  }

  .mobile-ads .your-ad-btn:hover {
    background: #f3f4f6;
  }

  /* Image flush full width */
  .mobile-ads .box-body {
    padding: 0 !important;
  }

  .mobile-ads .ad-card {
    padding: 0 !important;
  }

  .mobile-ads .ad-imgwrap {
    position: relative;
    width: 100%;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden;
  }

  .mobile-ads .ad-imgwrap img {
    width: 100%;
    /* height: 280px; */
    /* match screenshot feel */
    object-fit: cover;
    display: block;
    border-radius: 0 !important;
  }

  /* ✅ WhatsApp button: visible ONLY on hover */
  .mobile-ads .ad-float-wa {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 10px);
    background: #16a34a;
    color: #fff;
    font-weight: 900;
    padding: 12px 28px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 14px 26px rgba(0, 0, 0, .22);

    opacity: 0;
    pointer-events: none;
    transition: .18s ease;
  }

  .mobile-ads .ad-imgwrap:hover .ad-float-wa {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }

  /* keep it clean inside feed card */
  .feed .mobile-ads {
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
  }

  /* match your flush look */
  .feed .mobile-ads {
    padding: 0 !important;
  }

  .feed .mobile-ads .box-body {
    padding: 0 !important;
  }

  .feed .mobile-ads .ad-card {
    padding: 0 !important;
  }

  .feed .mobile-ads .ad-imgwrap {
    border: 0 !important;
    border-radius: 0 !important;
  }

  /* .feed .mobile-ads .ad-imgwrap img {
        border-radius: 0 !important;
        height: 220px;
      } */

  .feed .mobile-ads .ad-actions.under {
    padding: 10px;
  }

  .ad-click {
    display: block;
  }

  .ad-click img {
    cursor: pointer;
  }

  .mobile-ads .box-head {
    padding: 6px 12px;
  }

  /* 1:1 square frame */
  .mobile-ads .ad-imgwrap {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
  }

  /* image fills the square */
  .mobile-ads .ad-imgwrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

}

.like-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
}

.like-btn.liked {
  color: #dc2626;
}

.comment-count {
  margin-left: 10px;
  font-weight: 700;
  color: var(--danger);
}

/* FOOT layout: Like (left) | Comments (center) | Video (right) */
.fc-foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 8px 14px 12px;
}

/* Like button */
.fc-like-btn {
  height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #6b7280;
  font-weight: 700;
  font-size: 14px;
}


.fc-like-btn:hover {
  background: #f3f4f6;
}

.fc-like-ico {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  /* 🔥 THIS is what actually grows the emoji */
  line-height: 1;
}


.fc-like-ico svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Comment count in center */
.fc-comment-link {
  justify-self: start;
  height: 36px;
  padding: 0 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #6b7280;
  font-weight: 700;
  font-size: 14px;
}

.fc-comment-link:hover {
  background: #f3f4f6;
}

.fc-comment-ico {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.fc-comment-ico svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Liked state */
.fc-like-btn.liked {
  color: var(--primary);
}

/* Reactions block (left side) */
.fc-reactions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.rx-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.rx-btn:hover {
  background: #f3efff;
  border-color: #d6ccff;
  transform: translateY(-1px);
}

.rx-btn.active {
  background: #f3efff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(85, 31, 189, 0.16);
}

.rx-total,
.fc-like-count {
  font-weight: 800;
  color: var(--primary);
  min-width: 12px;
  text-align: left;
}

/* wrap must be relative so the popup can be positioned */
.fc-like-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* hide reaction bar by default */
.fc-reaction-bar {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  /* show above the Like button */
  display: flex;
  gap: 8px;

  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .18);

  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: .18s ease;
  z-index: 30;
}

/* show ONLY on hover/focus */
/* .fc-like-wrap:hover .fc-reaction-bar,
    .fc-like-wrap:focus-within .fc-reaction-bar {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    } */

/* style the emoji buttons inside the bar */
.fc-reaction-bar .rx {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.fc-reaction-bar .rx:hover {
  background: #f3efff;
  border-color: #d6ccff;
  transform: translateY(-1px) scale(1.05);
}

.fc-like-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* reaction bar hidden by default */
.fc-reaction-bar {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);

  display: flex;
  gap: 8px;

  padding: 8px 10px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .18);
  border: 1px solid #e5e7eb;

  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 50;
}

/* visible state (JS will toggle this) */
.fc-like-wrap.show-reactions .fc-reaction-bar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ✅ MOBILE / TOUCH: reaction bar must NEVER be visible unless .show-reactions is set */
@media (hover: none) and (pointer: coarse) {
  .fc-like-wrap .fc-reaction-bar {
    display: none !important;
    opacity: 0 !important;
    transform: translateY(6px) !important;
    pointer-events: none !important;
  }

  .fc-like-wrap.show-reactions .fc-reaction-bar {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }
}

.fc-img {
  aspect-ratio: 1 / 1;
}

.recent img {
  aspect-ratio: 1 / 1;
}

/* Desktop sponsored (right panel) */
.recent .ads-box .ad-imgwrap {
  aspect-ratio: 4 / 5;
  /* try 4/5 first */
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
}

/* image fills the reserved space */
.recent .ads-box .ad-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .mobile-ads .ad-imgwrap {
    aspect-ratio: 1 / 1;
  }
}


/* or 1/1 for mobile ads */
/* ✅ RIGHT COLUMN FIX: prevent chat widget overlap + fix flex wrappers */
:root{
  --chat-safe: 170px; /* adjust 140–220 depending on your chat bubble size */
}

/* make sure right column never gets covered */
.recent{
  padding-bottom: var(--chat-safe);
}

/* your main-content-wrap must behave like a flex child, not a random div */
.recent .main-content-wrap{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* recent comments list should scroll inside its box */
.recent .recent-box .box-body{
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* sponsored should not get cut (you set #sponsoredBox overflow hidden) */
.recent .ads-box .box-body{
  flex: 1;
  min-height: 0;
  overflow: hidden; /* keep carousel clean */
  padding-bottom: calc(var(--chat-safe) / 2); /* gives breathing room */
}