/* I Love You From... - mobile-first app shell styles.
   No external CSS framework dependency: kept compact and self-contained
   so the PWA works fully offline once the shell is cached. */

/* Back-office palette (2026 refresh). Variable NAMES are kept as-is
   (--ilyf-red etc.) even though the values are no longer literally red -
   dozens of templates reference these by name, and repointing the value
   is much lower-risk than a global rename. This repoints the public site
   onto the same near-black + blue "back office" family already used for
   the admin panel (see the .admin-body block below), swapping the old
   warm red/cream brand for a cooler, calmer palette. --ilyf-red is now
   the blue accent (buttons, links, active states); --ilyf-ink-surface is
   a new token for the flat dark surfaces (topbar, hero) that used to be
   solid --ilyf-red - those are two different roles that happened to
   share one variable under the old red branding. --ilyf-danger used to
   be an exact duplicate of --ilyf-red; they're still distinct so
   destructive actions (delete, restrict, errors) read differently from
   the accent colour used for primary actions. */
:root {
  --ilyf-red: #ad0404; /*#4f7df0*/
  --ilyf-red-dark: #2f5bc4;
  --ilyf-ink-surface: #14151a;
  --ilyf-pink-bg: #f3f4f8;
  --ilyf-ink: #14151a;
  --ilyf-muted: #70737e;
  --ilyf-border: #e0e2e8;
  --ilyf-white: #ffffff;
  --ilyf-success: #1f9254;
  --ilyf-warning: #b5790a;
  --ilyf-danger: #e0473e;
  --ilyf-gold: #b5790a;
  --ilyf-mustard: #e1ad01;
  --ilyf-olive: #6b7f27;
  --ilyf-bg-subtle: #eef0f4;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --nav-height: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ilyf-pink-bg);
  color: var(--ilyf-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

a { color: inherit; text-decoration: none; }
/* height:auto is the important part here, not just max-width. The HTML
   width/height attributes (used deliberately in several places to
   reserve space and avoid layout shift before an image loads) map to a
   presentational height:<px> hint, which - with no author height rule
   to beat it - wins the cascade over the UA stylesheet and pins the
   image at that literal pixel height regardless of how much max-width
   has shrunk its rendered width. That stretches/squishes any image
   whose HTML attributes don't match its final on-screen width 1:1
   (e.g. QR codes on narrow viewports, and message-gallery photos in
   the masonry grid - see .masonry-gallery .grid-item img below, which
   needs the same override since it also sets its own width). */
img { max-width: 100%; height: auto; display: block; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ilyf-ink-surface);
  color: #fff;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(20,21,26,0.10);
}

.app-topbar .heart { font-size: 20px; }
.heart-logo { display: inline-block; vertical-align: -4px; flex-shrink: 0; }
.place-thumb .heart-logo { vertical-align: 0; }
.app-topbar h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-topbar a.back { color: #fff; font-size: 20px; padding: 4px 6px; margin-inline-start: -6px; }

/* Desktop-only nav links in the topbar (Home/Map/account) - hidden by
   default; the mobile bottom tab bar (.bottom-nav, includes/footer.php)
   covers the same destinations on small screens. Shown from 900px up
   alongside the rest of the desktop layout below. */
.topbar-nav-links { display: none; }

/* Reusable utility for directional glyphs (back arrows, list chevrons):
   in RTL layouts these conventionally point the other way, so mirror the
   character itself rather than shipping separate left/right icon sets. */
[dir="rtl"] .rtl-mirror { display: inline-block; transform: scaleX(-1); }

.lang-switcher { margin-inline-start: auto; }
.lang-switcher select {
  width: auto;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.lang-switcher select option { color: var(--ilyf-ink); }

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

/* Light, borderless hero - deliberately blends into the page background
   (same colour as .container's page bg) rather than reading as a
   distinct card, matching the calmer back-office-derived look: a plain
   centred heading + subheading, not a coloured banner. */
.hero-card {
  background: transparent;
  color: var(--ilyf-ink);
  padding: 8px 8px 18px;
  margin-bottom: 4px;
  text-align: center;
}
.hero-card h2 { margin: 0 0 6px; font-size: 20px; color: var(--ilyf-ink); }
.hero-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ilyf-muted); }

/* Centred, capped-width search box directly under the hero heading on
   the homepage - a distinct look from the generic .search-bar (used
   full-width elsewhere: category.php's search modal, submit.php,
   admin), so this doesn't affect those. */
.hero-search { max-width: 420px; margin: 0 auto 18px; }

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-bar input[type=search],
.search-bar input[type=text] {
  flex: 1;
}

.card {
  background: var(--ilyf-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--ilyf-border);
  padding: 16px;
  margin-bottom: 12px;
}

.place-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.place-card .place-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--ilyf-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
/* Rotating tint variants for a place with no photo yet (place_tint_class()
   in includes/functions.php) - purely decorative variety across a list/
   grid of places, same idea as the admin theme's tinted status badges. */
.place-card .place-thumb.tint-blue { background: #e6f1fb; }
.place-card .place-thumb.tint-green { background: #e5f6ec; }
.place-card .place-thumb.tint-amber { background: #fdf3df; }
.place-card .place-thumb picture { display: block; width: 100%; height: 100%; }
.place-card .place-thumb img { width: 100%; height: 100%; object-fit: cover; }
.place-card .place-info { flex: 1; min-width: 0; }
.place-card .place-info h3 { margin: 0 0 2px; font-size: 16px; }
.place-card .place-info p { margin: 0; font-size: 13px; color: var(--ilyf-muted); }
.place-card .chevron { color: var(--ilyf-muted); font-size: 18px; }
.place-card .place-message-count { margin-top: 3px !important; font-size: 12px !important; font-weight: 600; color: var(--ilyf-gold) !important; }

.message-card { padding: 16px; }
.message-card .msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.message-card .msg-author { font-weight: 600; font-size: 14px; }
.message-card .msg-time { font-size: 12px; color: var(--ilyf-muted); }
.message-card .msg-text { font-size: 15px; line-height: 1.5; margin: 0 0 10px; white-space: pre-wrap; word-wrap: break-word; }
.message-card mark { background: var(--ilyf-mustard); color: var(--ilyf-ink); padding: 0 2px; border-radius: var(--radius-sm); }
.message-card .msg-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.message-card .msg-images.count-1 { grid-template-columns: 1fr; }
.message-card .msg-images.count-2 { grid-template-columns: repeat(2, 1fr); }
.message-card .msg-images img,
.message-card .msg-images picture,
.message-card .msg-images .more-overlay {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--ilyf-bg-subtle);
}
.message-card .msg-images picture { display: block; overflow: hidden; }
.message-card .msg-images .more-overlay {
  position: relative;
}
.message-card .msg-images .more-overlay img,
.message-card .msg-images .more-overlay picture { position: absolute; inset: 0; }
.message-card .msg-images .more-overlay span {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600;
  border-radius: var(--radius-sm);
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
}
.badge-pending { background: #fbeecb; color: var(--ilyf-warning); }
.badge-approved { background: #e6ecd6; color: var(--ilyf-success); }
.badge-rejected { background: #f3e0d5; color: var(--ilyf-danger); }
.badge-super { background: #ede4fb; color: #6b3fc4; }
.badge-moderator { background: #e3f1fc; color: #1467b0; }
.badge-suspended { background: #eee; color: #777; }
.badge-restricted { background: var(--ilyf-danger); color: #fff; }
.badge-featured { background: var(--ilyf-mustard); color: var(--ilyf-ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform .05s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ilyf-red); color: #fff; }
.btn-secondary { background: #fff; color: var(--ilyf-red); border: 1.5px solid var(--ilyf-red); }
.btn-ghost { background: transparent; color: var(--ilyf-ink); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; }
.btn-danger { background: var(--ilyf-danger); color: #fff; }
.btn-success { background: var(--ilyf-success); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { width: auto; flex: 1; }

/* Compact icon-only action row (e.g. category.php: leave a message,
   follow, gallery, donate) - each action is a single glyph with the
   accessible/hover label carried entirely by title+aria-label rather
   than visible text, for a tidier row than four full-width buttons. */
.icon-btn-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.icon-btn-row form { display: contents; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border: 1.5px solid var(--ilyf-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ilyf-red);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform .05s ease, background .15s ease;
}
.btn-icon:active { transform: scale(0.94); }
.btn-icon-primary { background: var(--ilyf-red); border-color: var(--ilyf-red); color: #fff; }

/* Generic centered modal (search/date filter on category.php; reusable
   for any future form-in-a-modal). Toggled via the "show" class, same
   convention as .lightbox-overlay - see assets/js/modal.js. */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,21,26,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(20,21,26,0.25);
}
.modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--ilyf-bg-subtle);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ilyf-ink);
}

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=tel],
textarea, select {
  width: 100%;
  border: 1.5px solid var(--ilyf-border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ilyf-ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ilyf-red);
}
textarea { resize: vertical; min-height: 110px; }
.hint { font-size: 12px; color: var(--ilyf-muted); margin-top: 4px; }
.form-error { color: var(--ilyf-danger); font-size: 12.5px; margin-top: 4px; }

.file-drop {
  border: 2px dashed var(--ilyf-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--ilyf-muted);
  font-size: 14px;
  cursor: pointer;
  background: #fff;
}

/* Visually hides the real <input type="file"> behind a styled .file-drop
   label, WITHOUT display:none. A display:none (or visibility:hidden)
   form control can't receive focus, and a required field that can't be
   focused makes the browser abort the whole form submit with a console
   error ("An invalid form control ... is not focusable") instead of
   showing any validation message - silently blocking submission whenever
   no photo was chosen yet. Clipping to 1px keeps the input focusable (and
   part of the accessibility tree) while staying invisible. */
.file-input-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Same visually-hidden technique, used for anti-spam honeypot fields.
   Deliberately NOT a fixed "left:-9999px" offset - that only hides the
   field in left-to-right layouts and would sit visibly on screen (or at
   least on the wrong side) once dir="rtl" is in play for Arabic. Clipping
   works the same regardless of text direction. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Logical inset so a photo's remove/delete button sits at the
   trailing corner regardless of text direction (top-right in LTR
   languages, automatically top-left under dir="rtl"). */
.photo-remove-btn {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
}
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.image-preview-grid .preview-thumb {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ilyf-bg-subtle);
}
.image-preview-grid .preview-thumb picture,
.image-preview-grid .preview-thumb > a {
  display: block;
  width: 100%;
  height: 100%;
}
.image-preview-grid .preview-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* A .preview-thumb that's also a lightbox trigger is a <button>, not a
   <div> (needs to be a real, keyboard-focusable control) - reset the
   default button chrome so it looks identical to the plain div version. */
.image-preview-grid .preview-thumb.lightbox-trigger {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* Full-screen photo viewer modal - see assets/js/lightbox.js. */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20,12,9,0.92);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox-overlay.show { display: flex; }
.lightbox-image {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close {
  top: calc(var(--safe-top) + 12px);
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  font-size: 22px;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  font-size: 24px;
}
.lightbox-prev { inset-inline-start: 12px; }
.lightbox-next { inset-inline-end: 12px; }
.lightbox-counter {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 14px);
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.flash-stack { position: fixed; top: calc(var(--safe-top) + 8px); left: 0; right: 0; z-index: 50; padding: 0 12px; }
.flash {
  max-width: 560px;
  margin: 0 auto 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(20,21,26,0.14);
}
.flash-success { background: #e6ecd6; color: #3f6526; }
.flash-error { background: #f3e0d5; color: #8a2a12; }
.flash-info { background: #e3f1fc; color: #12588f; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--ilyf-muted); }
.empty-state .heart-icon { font-size: 40px; margin-bottom: 10px; }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: #fff;
  border-top: 1px solid var(--ilyf-border);
  display: flex;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 10px rgba(20,21,26,0.08);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 8px;
  font-size: 11px;
  color: var(--ilyf-muted);
}
.bottom-nav a .icon { font-size: 20px; line-height: 1; }
.bottom-nav a.active { color: var(--ilyf-red); font-weight: 700; }

.install-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--ilyf-red);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.install-banner.show { display: flex; }
.install-banner button { flex-shrink: 0; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 18px 0; }
.pagination-disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-ellipsis { padding: 0 2px; color: var(--ilyf-muted); font-weight: 700; }

.qr-box { text-align: center; }
.qr-box img { margin: 0 auto 12px; border: 8px solid #fff; border-radius: var(--radius-sm); box-shadow: 0 2px 10px rgba(20,21,26,0.10); }
.qr-link { font-size: 12px; word-break: break-all; color: var(--ilyf-muted); background: var(--ilyf-bg-subtle); padding: 8px 10px; border-radius: var(--radius-sm); }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--ilyf-border); vertical-align: top; }
table.admin-table th { color: var(--ilyf-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
table.admin-table tbody tr:hover { background: var(--ilyf-bg-subtle); }

/* Wraps every admin list table so it scrolls horizontally on a narrow
   phone screen instead of squeezing columns unreadably - the table
   itself stays a real <table> at every width. */
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 12px; }

/* Compact action buttons/forms inside a table cell (as opposed to the
   full-width .btn-row used in the old card layout) - lets Edit/Toggle/
   Delete etc. sit side by side instead of stacking full-width. */
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.table-actions form { display: inline-flex; }
.table-actions .btn { width: auto; }

/* Icon-only action buttons inside admin table rows - compact square
   buttons that carry their label via title/aria-label rather than
   visible text, so an Actions column stays narrow even with several
   actions. Reuses the existing color classes (btn-secondary/btn-danger/
   btn-success/btn-ghost/btn-primary) for meaning; this modifier only
   overrides size/shape/padding. Icons come from the self-hosted
   Bootstrap Icons font (assets/vendor/bootstrap-icons). */
.btn.btn-icon-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 15px;
  border-radius: var(--radius-sm);
  gap: 0;
  flex-shrink: 0;
}

.table-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; display: block; }
.admin-table td picture { display: block; width: 48px; height: 48px; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; border: 1px solid var(--ilyf-border); white-space: nowrap; }
.tabs a.active { background: var(--ilyf-red); color: #fff; border-color: var(--ilyf-red); }

.masonry-gallery {
  margin: 0 -4px;
}
.masonry-gallery .grid-sizer,
.masonry-gallery .grid-item {
  width: 50%;
}
.masonry-gallery .grid-item {
  padding: 4px;
}
.masonry-gallery .grid-item a {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ilyf-bg-subtle);
}
.masonry-gallery .grid-item picture {
  display: block;
}
.masonry-gallery .grid-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity .2s ease;
}
@media (min-width: 480px) {
  .masonry-gallery .grid-sizer,
  .masonry-gallery .grid-item {
    width: 33.333%;
  }
}
@media (min-width: 700px) {
  .masonry-gallery .grid-sizer,
  .masonry-gallery .grid-item {
    width: 25%;
  }
}
@media (min-width: 900px) {
  .masonry-gallery .grid-sizer,
  .masonry-gallery .grid-item {
    width: 20%;
  }
}

@media (min-width: 640px) {
  .container { padding: 24px; }
}

/* Real desktop layout for the public site - place-listing pages
   (index.php/map.php/following.php, via the $wideContainer flag in
   includes/header.php) get more breathing room, the topbar grows nav
   links + an account CTA in place of the mobile bottom tab bar, and the
   place-card grid below switches from a stacked list to a responsive
   grid (see .place-list/.place-card rules above). */
@media (min-width: 900px) {
  .container.container-wide { max-width: 1100px; padding: 32px 40px; }

  .place-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
  }
  .place-list .place-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin-bottom: 0;
  }
  .place-list .place-card .place-thumb {
    width: 100%;
    height: 84px;
    border-radius: 0;
    font-size: 30px;
  }
  .place-list .place-card .place-info { padding: 12px 14px 16px; }
  .place-list .place-card .chevron { display: none; }
  .place-list .place-card .place-message-count {
    display: inline-block;
    margin-top: 8px !important;
    background: #eaf0fe;
    color: #0c447c !important;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
  }

  .topbar-nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 14px;
    margin-inline-start: 24px;
  }
  .topbar-nav-links a { color: rgba(255,255,255,0.82); text-decoration: none; white-space: nowrap; }
  .topbar-nav-links a:hover { color: #fff; }
  .topbar-nav-links a.active { color: #fff; font-weight: 700; }
  .topbar-nav-links a.topbar-nav-cta {
    background: var(--ilyf-red);
    color: #fff;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
  }
  .topbar-nav-links a.topbar-nav-cta:hover { color: #fff; opacity: 0.92; }
  /* An emoji glyph ignores the text `color` used for the other links'
     active/hover state, so "active" here is a background pill instead. */
  .topbar-nav-links a.topbar-search-icon { font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 999px; }
  .topbar-nav-links a.topbar-search-icon.active,
  .topbar-nav-links a.topbar-search-icon:hover { background: rgba(255,255,255,0.15); }

  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* -----------------------------------------------------------------
   Admin/moderator "back office" theme (2026 redesign) - a distinct
   near-black + blue palette on a light neutral background, deliberately
   separate from the public site's warm red/cream brand above (the admin
   panel isn't a public-facing brand surface). Everything in this section
   is scoped under .admin-body so none of it touches public pages, which
   keep using the --ilyf-* variables untouched.

   Layout: mobile keeps a horizontal scrolling icon strip at the top
   (nav-group labels/brand/user-footer hidden to save space). From 900px
   up, the nav becomes a persistent left sidebar with grouped sections,
   badge counts, and a user footer; the content area gets a search +
   export/filter/team topbar above it.
   ----------------------------------------------------------------- */
.admin-body {
  --admin-bg: #f3f4f8;
  --admin-surface: #ffffff;
  --admin-ink: #14151a;
  --admin-ink-soft: #4b4d57;
  --admin-muted: #90939f;
  --admin-border: #eaebf1;
  --admin-accent: #4f7df0;
  --admin-accent-soft: #eaf0fe;
  --admin-success: #1f9254;
  --admin-success-bg: #e5f6ec;
  --admin-danger: #e0473e;
  --admin-danger-bg: #fdecec;
  --admin-warning: #b5790a;
  --admin-warning-bg: #fdf3df;
  --admin-radius-lg: 20px;
  --admin-radius-md: 14px;
  --admin-radius-sm: 10px;
  --admin-shadow: 0 1px 2px rgba(20,21,26,0.04), 0 8px 24px rgba(20,21,26,0.05);
  background: var(--admin-bg);
  color: var(--admin-ink);
  padding-bottom: 0;
}

/* Buttons, inputs, badges, tabs, flashes, cards/tables - repainted in
   the admin palette. Same shapes/classes as the public site (so every
   admin page that already uses .btn/.card/.badge-*/.tabs "just works"
   here), just recoloured within .admin-body's higher specificity. */
.admin-body a { color: var(--admin-accent); }
.admin-body .btn { border-radius: var(--admin-radius-sm); font-weight: 600; }
.admin-body .btn-primary { background: var(--admin-ink); color: #fff; }
.admin-body .btn-secondary { background: #fff; color: var(--admin-ink); border: 1.5px solid var(--admin-border); }
.admin-body .btn-danger { background: var(--admin-danger); color: #fff; }
.admin-body .btn-success { background: var(--admin-success); color: #fff; }
.admin-body .btn-ghost { color: var(--admin-ink-soft); }
.admin-body .btn.btn-icon-sm { border-radius: 9px; }

.admin-body input[type=text], .admin-body input[type=email], .admin-body input[type=password],
.admin-body input[type=search], .admin-body input[type=date], .admin-body input[type=tel],
.admin-body input[type=number], .admin-body textarea, .admin-body select {
  border-color: var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: #fff;
  color: var(--admin-ink);
}
.admin-body input:focus, .admin-body textarea:focus, .admin-body select:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-soft);
}
.admin-body label { color: var(--admin-ink-soft); }
.admin-body .hint { color: var(--admin-muted); }

.admin-body .card,
.admin-body .admin-table-wrap {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-lg);
  box-shadow: var(--admin-shadow);
}
.admin-body .card { padding: 18px; }
.admin-body .admin-table-wrap { padding: 8px 10px; }
.admin-body table.admin-table th { color: var(--admin-muted); border-bottom-color: var(--admin-border); }
.admin-body table.admin-table td { border-bottom-color: var(--admin-border); }
.admin-body table.admin-table tbody tr:hover { background: #f8f9fc; }
.admin-body table.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-body .badge-pending { background: var(--admin-warning-bg); color: var(--admin-warning); }
.admin-body .badge-approved { background: var(--admin-success-bg); color: var(--admin-success); }
.admin-body .badge-rejected { background: var(--admin-danger-bg); color: var(--admin-danger); }
.admin-body .badge-super { background: #ece7fd; color: #6a3fd6; }
.admin-body .badge-moderator { background: var(--admin-accent-soft); color: var(--admin-accent); }
.admin-body .badge-suspended { background: #eef0f4; color: var(--admin-muted); }
.admin-body .badge-restricted { background: var(--admin-danger); color: #fff; }
.admin-body .badge-featured { background: #fdf0d0; color: #a3730c; }

.admin-body .tabs a { background: #fff; border-color: var(--admin-border); color: var(--admin-ink-soft); }
.admin-body .tabs a.active { background: var(--admin-ink); color: #fff; border-color: var(--admin-ink); }

.admin-body .flash-success { background: var(--admin-success-bg); color: #146338; }
.admin-body .flash-error { background: var(--admin-danger-bg); color: #a3271f; }
.admin-body .flash-info { background: var(--admin-accent-soft); color: #2557c9; }

/* Shell: sidebar + (topbar / content) column. .admin-main always fills
   whatever width isn't taken by the sidebar - on mobile that's the full
   screen (the sidebar is an off-canvas drawer, out of normal flow), on
   desktop it's "flex:1" so it fills the remainder of .admin-shell next
   to the fixed-width sidebar column. */
.admin-shell { display: block; }
.admin-main { display: block; min-width: 0; width: 100%; }

/* Sidebar - same full grouped panel (brand, labelled groups, user
   footer) at every width. On mobile it's an off-canvas drawer (fixed,
   translated off-screen, toggled by the hamburger button in the topbar
   below) rather than the persistent column desktop gets - see the
   900px block for that. */
.admin-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: 260px;
  max-width: 84vw;
  padding: 18px 14px;
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}
.admin-sidebar.open { transform: translateX(0); }

.admin-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20,21,26,0.45);
}
.admin-nav-backdrop.show { display: block; }

.admin-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--admin-radius-sm);
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-ink);
  font-size: 18px;
  cursor: pointer;
}

.admin-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.admin-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; background: var(--admin-ink); color: #fff; font-size: 15px; flex-shrink: 0;
}
.admin-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.admin-brand-text strong { font-size: 14.5px; }
.admin-brand-text small { font-size: 11.5px; color: var(--admin-muted); }

.admin-nav-scroll { display: block; flex: 1; overflow-y: auto; }
.admin-nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.admin-nav-label { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--admin-muted); padding: 0 10px 6px; }
.admin-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--admin-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--admin-ink-soft);
  background: transparent;
  white-space: nowrap;
}
.admin-nav-link.active { background: var(--admin-ink); color: #fff; }
.admin-nav-link.admin-nav-signout { color: var(--admin-danger); }
.admin-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--admin-danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.admin-nav-link.active .admin-nav-count { background: rgba(255,255,255,0.25); }

.admin-nav-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid var(--admin-border);
}
.admin-nav-user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.admin-nav-user-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-nav-user-text small { font-size: 11.5px; color: var(--admin-muted); }

/* Topbar v2: hamburger (mobile only) + search + export/filter/team,
   sits above the page content */
.admin-topbar-v2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
.admin-search {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--admin-muted);
}
.admin-search input {
  border: none;
  padding: 0;
  background: transparent;
  font-size: 14px;
  flex: 1;
}
.admin-search input:focus { outline: none; box-shadow: none; }
.admin-topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.admin-topbar-btn-dark { background: var(--admin-ink); color: #fff; border-color: var(--admin-ink); }
.admin-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--admin-danger); margin-inline-start: 2px; }

.admin-filter-menu { position: relative; }
.admin-filter-menu summary { list-style: none; }
.admin-filter-menu summary::-webkit-details-marker { display: none; }
.admin-filter-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 40;
  min-width: 240px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-md);
  box-shadow: 0 12px 32px rgba(20,21,26,0.14);
  padding: 8px;
}
.admin-filter-dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--admin-radius-sm);
  color: var(--admin-ink);
  font-size: 13.5px;
  font-weight: 500;
}
.admin-filter-dropdown a:hover { background: var(--admin-bg); }
.admin-filter-dropdown .admin-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-muted);
  background: var(--admin-bg);
  border-radius: 999px;
  padding: 1px 8px;
}

.admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--admin-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--admin-surface);
  flex-shrink: 0;
}
.admin-avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.admin-avatar-extra { background: var(--admin-bg); color: var(--admin-ink-soft); }
.admin-avatar-stack { display: inline-flex; align-items: center; }
.admin-avatar-stack .admin-avatar:not(:first-child) { margin-inline-start: -10px; }

.admin-content { width: 100%; max-width: none; padding: 0 16px 24px; }
.admin-panel { max-width: 720px; }
.admin-stat-row { display: flex; flex-wrap: wrap; gap: 16px; }
.admin-dashboard-charts { display: block; }

/* Dashboard KPI cards - icon badge + big number + up/down delta pill */
.admin-kpi-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
.admin-kpi-card { padding: 18px; }
.admin-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--admin-radius-sm);
  background: var(--admin-bg);
  color: var(--admin-ink);
  font-size: 15px;
  margin-bottom: 12px;
}
.admin-kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--admin-muted); margin-bottom: 6px; }
.admin-kpi-value { font-size: 26px; font-weight: 700; line-height: 1.1; margin-bottom: 6px; }
.admin-kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.admin-kpi-delta-up { background: var(--admin-success-bg); color: var(--admin-success); }
.admin-kpi-delta-down { background: var(--admin-danger-bg); color: var(--admin-danger); }
.admin-kpi-delta-flat { background: var(--admin-bg); color: var(--admin-muted); }

@media (min-width: 900px) {
  .admin-shell {
    display: flex;
    align-items: flex-start;
    width: 100%;
  }

  /* Sidebar switches from an off-canvas drawer to a persistent column -
     back in normal flow (not fixed/translated), so .admin-main's flex:1
     below naturally fills exactly what's left beside it. */
  .admin-sidebar {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    transform: none;
    z-index: auto;
    flex-shrink: 0;
    width: 240px;
    max-width: none;
    height: 100vh;
  }

  .admin-hamburger, .admin-nav-backdrop { display: none !important; }

  /* .admin-main (not .admin-content) is the direct flex child of
     .admin-shell, so flex:1 belongs here - it's what makes the content
     column actually fill 100% of the remaining width next to the fixed-
     width sidebar, rather than shrinking to its content's size. */
  .admin-main { flex: 1; min-width: 0; }
  .admin-content { padding: 6px 36px 36px; }

  .admin-dashboard-charts {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 16px;
    align-items: start;
  }
  .admin-dashboard-charts > div { min-width: 0; }

  .admin-kpi-row { grid-template-columns: repeat(4, 1fr); }

  table.admin-table { font-size: 14px; }
}

@media (max-width: 479px) {
  .admin-avatar-stack { display: none; }
}

/* ---------------------------------------------------------------------
   Static content pages (About, Guide, FAQ, Terms, Privacy) - readable
   long-form text: generous line-height, clear heading hierarchy, no
   card chrome needed since these aren't data cards.
--------------------------------------------------------------------- */
.content-page { max-width: 640px; margin: 0 auto; line-height: 1.65; }
.content-page h2 { font-size: 20px; margin: 28px 0 10px; }
.content-page h2:first-child { margin-top: 0; }
.content-page h3 { font-size: 16px; margin: 20px 0 8px; }
.content-page p { margin: 0 0 14px; }
.content-page ul, .content-page ol { margin: 0 0 14px; padding-inline-start: 22px; }
.content-page li { margin-bottom: 6px; }
.content-page .updated-note { color: var(--ilyf-muted); font-size: 13px; margin-bottom: 22px; }
.content-page a { color: var(--ilyf-red); font-weight: 600; }

.faq-item {
  background: var(--ilyf-white);
  border: 1px solid var(--ilyf-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  padding: 4px 16px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  float: inline-end;
  color: var(--ilyf-red);
  font-weight: 700;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { padding-bottom: 14px; color: var(--ilyf-ink); }

/* Dark footer band - text-link row to the static content pages plus the
   copyright line, part of includes/footer.php on every public page.
   Sits above the fixed mobile bottom-nav (which covers it visually on
   phones); fully visible as a real footer once the bottom-nav is
   hidden on desktop. */
.content-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  padding: 22px 16px;
  text-align: center;
  background: var(--ilyf-ink-surface);
}
.content-links a { color: #c7c9d3; font-size: 13px; text-decoration: none; }
.content-links a:hover { color: #fff; text-decoration: underline; }

/* Mandatory checkbox rows (e.g. "I agree to the Terms" on register.php) -
   checkbox + wrapped label text side by side, logical spacing so it
   mirrors correctly under RTL locales. */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
}
.checkbox-row label {
  margin: 0;
  font-weight: normal;
  font-size: 14px;
  line-height: 1.4;
}
.checkbox-row a { color: var(--ilyf-red); font-weight: 600; }
