
/* ── Design tokens — CommHub brand palette ─────────────────── */
:root {
  --ink:      #1a1a1a;
  --slate:    #5c5c5c;
  --muted:    #9aa0a6;
  --line:     #e0e0e0;
  --surface:  #f7f7f5;
  --card:     #ffffff;
  --accent:   #238555;
  --accent-h: #1b6842;
  --accent-s: #e6f3ec;
  --mark:     #b5446a;
  --mark-h:   #933554;
  --cta:      #238555;
  --cta-h:    #1b6842;
  --gold:     #f5c400;
  --gold-s:   #fef9e0;
  --success:  #238555;
  --danger:   #d32f2f;
  --warn:     #f5c400;
  --font:     "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sidebar-w: 15rem;
  --header-h: 3.5rem;
  --content-max: 87.5rem;
  --page-pad: 1rem;
  --gap: 0.5rem;
  --gap-lg: 1rem;
  --grid-gap: 1.25rem;
  --card-pad: 1rem;
  --tile-h: 6.875rem;
  --photo-h: 10rem;
  --feed-photo-h: 11.25rem;
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.18vw, 0.9375rem);
  --text:    clamp(0.9375rem, 0.9rem + 0.22vw, 1.0625rem);
  --text-md: clamp(1rem, 0.95rem + 0.28vw, 1.1875rem);
  --text-lg: clamp(1.25rem, 1.15rem + 0.35vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.3rem + 0.6vw, 2rem);

  /* ── Listing card design system ──────────────────────────────
     Every zone of a listing tile (grid + swipe) is a fixed size so
     that variable content (title/description/location/badges length)
     never changes a card's dimensions - only what's visible inside
     each zone changes. See .list-card / .swipe-deck-layer below. */
  --card-title-h: calc(1.25em * 2);
  --card-desc-h: calc(1.4em * 3);
  --card-tags-h: 1.75rem;
  --card-meta-h: 1.125rem;
  --card-location-h: 3.25rem;
  --card-image-ratio: 16 / 10;
  /* Caps how wide a single tile can grow inside its grid cell — a grid
     row with only one (or few) items would otherwise stretch that card
     to fill the whole row via the grid's 1fr track. */
  --card-max-w: 26rem;

  /* Swipe-mode card: a single centered, width-capped tile (never a
     full-viewport-wide rectangle) with a true 1:1 image on top and a
     compact, fixed-height info + footer zone below it. */
  --swipe-card-w: min(88vw, 21rem);
  --swipe-extra-h: 15.75rem;
}

/* ── Base reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  font-size: clamp(16px, 13px + 0.3vw, 18px);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  height: 100%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

#root {
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
}

img, video { max-width: 100%; height: auto; }
/* Do not globally size SVGs — that collapses menu icons on iOS Safari. */

button, input, select, textarea {
  font-family: inherit;
}

/* ── App shell — mobile-first; sidebar is a drawer until 768px ── */
.app-shell {
  width: 100%;
  max-width: none;
  height: 100svh;
  height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  touch-action: pan-y;
}

.app-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: env(safe-area-inset-top) var(--page-pad) 0;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gap);
  flex-shrink: 0;
  z-index: 50;
}

.notif-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 40px;
}
.notif-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notif-mark-all {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notif-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}
.notif-card.is-unread {
  background: var(--accent-s, #e8f5ee);
}
.notif-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.notif-card.is-unread .notif-text {
  font-weight: 700;
}
.notif-preview {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--slate);
  line-height: 1.4;
}
.notif-time {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--muted, var(--slate));
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mark);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--card);
  animation: notif-badge-pulse 1.6s ease-in-out infinite;
}

@keyframes notif-badge-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px var(--card), 0 0 0 0 rgba(181, 68, 106, 0.45);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--card), 0 0 0 6px rgba(181, 68, 106, 0);
  }
}

.app-header-plain {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* Header right-side actions (notifications bell) — mirrors React AppChrome */
.app-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.app-header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
}

.app-header-icon:hover {
  background: var(--muted, rgba(0, 0, 0, 0.05));
}

/* Info/Help FAQ expandable cards */
.faq-card summary::-webkit-details-marker { display: none; }
.faq-card summary::marker { content: ""; }
.faq-card[open] .faq-chevron { transform: rotate(180deg); }
.faq-card summary:hover { background: var(--surface); }

/* Wi-Fi / Data-safe toggle — mirrors React WifiToggle */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #1f2937;
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  letter-spacing: 0.01em;
}

html.is-offline .offline-banner {
  display: block;
}

.offline-prompt {
  position: fixed;
  inset: 0;
  /* Above the mobile nav drawer (.app-sidebar/.app-drawer, z-index 999)
     and its backdrop (998) - both can be open when this needs to show. */
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 20, 0.45);
}
.offline-prompt[hidden] {
  display: none !important;
}
.offline-prompt-card {
  width: min(100%, 360px);
  background: var(--card, #fff);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line, #e5e5e0);
}
.offline-prompt-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}
.offline-prompt-text {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--slate);
}
.offline-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.offline-prompt-actions .btn-ghost,
.offline-prompt-actions .btn-primary {
  flex: 1;
  min-width: 120px;
}

.wifi-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wifi-toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate);
}

.wifi-switch {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  border: none;
  padding: 2px;
  cursor: pointer;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transition: background 0.2s, justify-content 0s;
}

.wifi-toggle.is-off .wifi-switch {
  background: #ccc;
  justify-content: flex-start;
}

.wifi-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  display: block;
}

/* Data-safe mode hides photos, mirroring showPhotos = dataMode === 'wifi' */
html.data-safe img.data-photo {
  display: none;
}

.app-header-brand {
  font-weight: 700;
  font-size: var(--text);
  color: var(--accent);
  letter-spacing: -0.02em;
  text-align: center;
  overflow: hidden;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: var(--accent);
  max-width: 100%;
}

.brand-lockup svg {
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--mark);
}

.brand-wordmark {
  font-weight: 700;
  font-size: inherit;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup-lg {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.brand-lockup-lg svg {
  width: 32px;
  height: 32px;
}

.brand-lockup-lg .brand-wordmark {
  font-size: 1.1rem;
}

@media (max-width: 380px) {
  .app-header-brand .brand-wordmark {
    font-size: 0.92rem;
  }
}

.app-main {
  flex: 1;
  min-height: 0;
  padding: var(--gap-lg) var(--page-pad) calc(1.5rem + env(safe-area-inset-bottom));
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 22.5rem);
  max-width: 22.5rem;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border-right: 1px solid var(--line);
  z-index: 999;
  transform: translateX(-105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s ease-out, visibility 0.25s;
}

.app-shell.is-nav-open .app-sidebar {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.app-nav-backdrop {
  /* Hidden until the drawer is open — otherwise it darkens the whole page. */
  display: none;
  position: fixed;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  cursor: pointer;
  animation: fadeIn 0.2s ease-out;
}

.app-shell.is-nav-open .app-nav-backdrop {
  display: block;
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 22.5rem);
  max-width: 22.5rem;
  background: var(--card);
  z-index: 999;
  animation: slideIn 0.25s ease-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle svg {
  width: 24px;
  height: 24px;
  max-width: none;
  display: block;
}

.app-shell.is-locked .app-main {
  overflow: hidden;
}

.auth-stage {
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-pad);
  box-sizing: border-box;
  position: relative;
}

.auth-stage-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('../img/landing-ocean-view.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-stage-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 32, 24, 0.28) 0%,
    rgba(0, 0, 0, 0.22) 45%,
    rgba(15, 32, 24, 0.38) 100%
  );
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26.25rem;
  margin: 0 auto;
  min-height: 0;
  max-height: min(92svh, 56rem);
  overflow-y: auto;
  padding: var(--card-pad) 1.5rem 1.5rem;
  box-sizing: border-box;
  background: var(--card);
  border-radius: 1rem;
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.18);
}

.auth-shell-landing {
  max-width: 32rem;
}

.landing-title {
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.landing-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--gap-lg);
}

.landing-choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.125rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #f5f5f5;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}

.landing-choice:hover {
  border-color: var(--accent);
}

.landing-choice.is-selected {
  border-color: var(--accent);
  background: var(--accent-s);
  color: var(--accent-h);
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.app-nav-link:hover {
  background: var(--accent-s);
}

.app-nav-link.is-active {
  background: var(--accent-s);
  color: var(--accent);
  font-weight: 700;
}

.app-nav-link.is-logout {
  color: var(--danger);
  margin-top: 0.5rem;
}

.app-nav-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  position: relative;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: inherit;
  max-width: none;
  overflow: visible;
}
.app-nav-icon svg {
  width: 1.25rem !important;
  height: 1.25rem !important;
  max-width: none !important;
  max-height: none !important;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}
.app-header-icon svg,
.page-back-link svg,
.engagement-btn svg,
.save-btn svg,
.announce-search-icon svg,
.location-bar-pin svg {
  max-width: none !important;
  max-height: none !important;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}
.nav-unread-badge,
.group-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mark, #b5446a);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}
.nav-unread-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  box-shadow: 0 0 0 2px var(--card, #fff);
}
.group-unread-badge {
  margin-left: 8px;
  vertical-align: middle;
}
.group-unread-text {
  color: var(--mark, #b5446a);
  font-weight: 700;
}

.app-sidebar-profile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem 1rem;
  text-decoration: none;
  color: inherit;
}

/* Circle stays fixed size on the left; name/role block takes the rest. */
.app-sidebar-profile .app-avatar,
.app-sidebar-profile .app-avatar-img {
  flex-shrink: 0;
}
.app-sidebar-profile .app-sidebar-identity {
  flex: 1;
  min-width: 0;
}

.app-sidebar-name {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.3;
}

.app-sidebar-meta {
  margin: 2px 0 0;
  font-family: var(--font);
  font-size: var(--text-xs);
  color: var(--accent);
}

.app-sidebar-body {
  padding: 0.25rem 0.75rem;
  flex: 1;
}

.app-sidebar-foot {
  padding: 0.5rem 0.75rem 1.25rem;
}

.info-tile-logo {
  max-width: 88%;
  max-height: 58%;
  width: auto;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.feed-post {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: 100%;
  background: var(--card);
  border-radius: 0.875rem;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  cursor: pointer;
  color: inherit;
  box-sizing: border-box;
  /* position: relative set with .list-card above */
}

.feed-post-title {
  margin: 0 0 0.375rem;
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  min-height: calc(1.3em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-post-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.5;
  height: calc(1.5em * 3);
}

.feed-post-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-post-text.is-expanded {
  height: auto;
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.feed-post-see-more-slot {
  min-height: 1.35em;
  margin-top: 4px;
}

.feed-post-see-more {
  align-self: flex-start;
  margin: 4px 0 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.feed-post-footer {
  margin-top: auto;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.browse-tile {
  min-height: var(--tile-h);
  height: var(--tile-h);
  width: 100%;
}

.info-tile-logo {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 86%;
  max-height: 52%;
  width: auto;
  height: auto;
  object-fit: contain;
  z-index: 1;
}

.info-guide-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 18px;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), var(--card-max-w)));
  gap: var(--grid-gap);
  align-items: stretch;
  justify-content: start;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.75rem), var(--card-max-w)));
  gap: var(--grid-gap);
  align-items: stretch;
  justify-content: start;
}

.span-all {
  grid-column: 1 / -1;
}

.see-more-text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--ink);
}

.see-more-text.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.list-card:not(.is-fill) .see-more-text.is-clamped,
.feed-post .see-more-text.is-clamped {
  height: var(--card-desc-h);
}

/* Reserve the description zone's height even when a listing has no
   description at all, so an empty one never sits shorter than its
   neighbours (_see_more_text.html always renders this wrapper now). */
.list-card:not(.is-fill) .see-more-block,
.feed-post .see-more-block {
  min-height: var(--card-desc-h);
}

.see-more-text.is-expanded {
  display: block;
  height: auto;
  overflow: visible;
}

.see-more-slot {
  min-height: 1.35em;
  margin-top: 2px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.feed-post-see-more {
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.feed-post-see-more:disabled {
  opacity: 0.65;
  cursor: wait;
}
.see-more-error {
  font-size: 12px;
  color: var(--slate);
}

.location-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #f0f0ec;
  border-radius: 12px;
  width: 100%;
  height: var(--card-location-h);
  box-sizing: border-box;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.location-bar:hover {
  filter: brightness(0.98);
  color: inherit;
}
.location-bar.is-empty {
  cursor: default;
  color: var(--muted);
}
.location-bar-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-bar.is-empty .location-bar-label {
  color: var(--muted);
  font-weight: 500;
}
.location-bar-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.map-pin {
  color: var(--accent);
}

.list-card,
.feed-post {
  position: relative;
  /* A grid row with only one (or few) items would otherwise stretch this
     card to fill the whole 1fr track - cap it and pin it to the start of
     its cell so the tile stays the same size no matter how many siblings
     share the row. */
  max-width: var(--card-max-w);
  width: 100%;
  justify-self: start;
}

.list-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: 100%;
  padding: var(--card-pad);
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--line);
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

/* Stretch the detail link so tapping anywhere on the card opens it.
   Interactive controls (likes, save, maps) sit above it. */
.list-card a.list-card-hit::after,
.feed-post a.list-card-hit::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.list-card .list-card-footer,
.list-card .location-bar,
.list-card .engagement-btn,
.list-card .save-btn,
.list-card .engagement-form,
.list-card .save-form,
.feed-post .list-card-footer,
.feed-post .location-bar,
.feed-post .engagement-btn,
.feed-post .save-btn,
.feed-post .engagement-form,
.feed-post .save-form {
  position: relative;
  z-index: 2;
}

.list-card.is-fill {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  border: none;
  overscroll-behavior: none;
  touch-action: none;
}

.swipe-deck-card .list-card.is-fill {
  /* Keep swipe cards from stealing the horizontal gesture via inner scroll. */
  overflow: hidden;
}

.swipe-deck-card a,
.swipe-deck-card button {
  touch-action: manipulation;
}

.list-card-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  height: var(--card-title-h);
  min-height: var(--card-title-h);
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-content: flex-start;
  height: var(--card-tags-h);
  overflow: hidden;
  flex-shrink: 0;
}

/* Shared badge/chip primitive - one visual system for "For sale",
   "Job", category, price, hours, etc. instead of one-off inline
   styles per card type. Fixed line-height + ellipsis so an
   unusually long category/price string can never grow a card. */
.card-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.card-badge-accent { background: var(--accent); color: #fff; }
.card-badge-neutral { background: #f3f4f6; color: var(--ink); font-weight: 500; }
.card-badge-danger { background: #fee2e2; color: #991b1b; }
.card-badge-gold { background: var(--gold-s, #fef3c7); color: #7a6200; }
.card-badge-muted { background: #e5e7eb; color: #4b5563; }

.card-photo,
.list-card-photo,
.feed-post-photo,
.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--card-image-ratio);
  overflow: hidden;
  border-radius: 12px;
  background: #386138;
  flex-shrink: 0;
}

.card-photo img,
.list-card-photo img,
.feed-post-photo img,
.photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.14);
  transform-origin: center center;
  display: block;
}

.list-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fab-slot {
  position: fixed;
  bottom: max(1.5rem, calc(1rem + env(safe-area-inset-bottom)));
  right: var(--page-pad);
  z-index: 40;
}

.fab-btn {
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  font-family: inherit;
  padding: 0;
}
.fab-btn:hover { color: #fff; filter: brightness(1.05); }

.compose-fab-slot {
  /* Inherits position:fixed + bottom/right from .fab-slot — do NOT set
     position:relative here or it drops out of the fixed corner. */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 40;
}
.compose-fab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.28);
  border: none;
  padding: 0;
  z-index: 39;
  cursor: pointer;
}
.compose-fab-backdrop[hidden] {
  display: none !important;
}
.compose-fab-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 168px;
  position: relative;
  z-index: 41;
}
.compose-fab-menu[hidden] {
  display: none !important;
}
.compose-fab.is-open .compose-fab-menu {
  display: flex;
}
.compose-fab-option {
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.compose-fab-option:hover {
  color: var(--ink);
  filter: brightness(0.98);
}
.compose-fab.is-open .fab-plus {
  transform: rotate(45deg);
}
.fab-plus {
  transition: transform 0.2s ease;
}

.view-mode-toggle {
  display: inline-flex;
  background: #fff;
  border-radius: 20px;
  padding: 3px;
  border: 1px solid #e5e5e0;
  flex-shrink: 0;
}
.view-mode-btn {
  border: none;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--slate);
}
.view-mode-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Author display rules (e.g. .list-grid) override UA [hidden] — force mode swap */
[data-view][hidden] {
  display: none !important;
}

.swipe-deck-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.swipe-hint {
  margin: 0;
  font-size: 12px;
  color: var(--slate);
  text-align: center;
  flex-shrink: 0;
}

/* Swipe-mode card: ONE controlled, centered tile — never a full-width
   horizontal rectangle. Width is capped by --swipe-card-w; height is
   derived from that same width (the image is a true 1:1 square sized
   off the card's own width) plus a fixed-size info+footer zone below
   it (--swipe-extra-h), so every card in the deck — regardless of the
   listing's content — resolves to the exact same box. */
.swipe-deck {
  position: relative;
  width: var(--swipe-card-w);
  height: calc(var(--swipe-card-w) + var(--swipe-extra-h));
  max-height: 82vh;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
}
.swipe-deck-layer {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.swipe-deck-layer.is-front {
  will-change: transform;
}
.swipe-deck-layer .list-card.is-fill {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  box-sizing: border-box;
  overscroll-behavior: none;
  touch-action: none;
}
.swipe-deck-layer .list-card.is-fill .list-card-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* Elements that only make sense in the full grid card (event date/time
   grid, owner avatar row) are dropped in the compact swipe preview —
   the full detail is one tap away. */
.swipe-deck-layer .list-card.is-fill .card-swipe-hide {
  display: none !important;
}
.swipe-deck-layer .list-card.is-fill .list-card-title {
  height: calc(1.25em * 2);
  min-height: 0;
  -webkit-line-clamp: 2;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.swipe-deck-layer .list-card.is-fill .list-card-tags {
  height: 1.625rem;
  flex-shrink: 0;
}
.swipe-deck-layer .list-card.is-fill .posted-at {
  height: 1rem;
  line-height: 1rem;
  flex-shrink: 0;
}
.swipe-deck-layer .list-card.is-fill .see-more-block {
  flex-shrink: 0;
}
.swipe-deck-layer .list-card.is-fill .see-more-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 0.82rem;
  height: calc(1.4em * 2);
}
.swipe-deck-layer .list-card.is-fill .card-photo {
  /* True 1:1 square, sized off the card's own (already fixed) width —
     never stretched wide, never determined by the source image. */
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: none;
  min-height: 0;
  border-radius: 12px;
}
.swipe-deck-layer .list-card.is-fill .location-bar {
  flex-shrink: 0;
  height: 2.75rem;
  padding: 0 10px;
}
.swipe-deck-layer .list-card.is-fill .location-bar-pin {
  width: 26px;
  height: 26px;
}
.swipe-deck-layer .list-card.is-fill .list-card-footer {
  flex-shrink: 0;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.swipe-deck-layer .list-card.is-fill .engagement-row {
  flex-wrap: nowrap;
  gap: 4px;
}
.swipe-deck-layer .list-card.is-fill .engagement-btn {
  padding: 4px 6px;
}
.swipe-controls {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
}
.swipe-controls[hidden] {
  display: none !important;
}
.swipe-stamp {
  position: absolute;
  top: 18px;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  background: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}
.swipe-stamp-keep {
  left: 16px;
  border: 3px solid var(--accent);
  color: var(--accent);
  transform: rotate(-12deg);
}
.swipe-stamp-skip {
  right: 16px;
  border: 3px solid #c2410c;
  color: #c2410c;
  transform: rotate(12deg);
}
.swipe-ctrl {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.swipe-ctrl-skip {
  border: 1.5px solid #fecaca;
  color: #c2410c;
}
.swipe-ctrl-view {
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.swipe-empty {
  text-align: center;
  padding: 48px 20px;
  background: #fff;
  border-radius: 16px;
}
.swipe-empty p {
  margin: 0 0 12px;
  color: var(--slate);
  font-size: 15px;
}

[data-swipe-item][hidden] {
  display: none !important;
}
[data-swipe-item].list-card {
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  box-sizing: border-box;
}

@media (min-width: 768px) {
  :root {
    --page-pad: 2rem;
    --gap: 1rem;
    --gap-lg: 1.5rem;
    --card-pad: 1.125rem;
    --swipe-card-w: min(60vw, 23rem);
    --tile-h: 8rem;
    --header-h: 3.75rem;
  }

  .auth-shell {
    max-width: 32rem;
    padding: 2rem 1.75rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --card-pad: 1.35rem;
    --swipe-card-w: 24rem;
    --tile-h: 9rem;
    --photo-h: 12rem;
    --feed-photo-h: 13.5rem;
  }

  .app-shell:has(.app-sidebar) {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-rows: 100%;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .app-sidebar {
    position: static;
    width: var(--sidebar-w);
    max-width: none;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
    transition: none;
  }

  .app-nav-backdrop,
  .app-drawer,
  .menu-toggle {
    display: none !important;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .app-header-brand {
    text-align: left;
  }

  .app-shell.is-nav-open .app-sidebar {
    transform: none;
  }

  .app-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .app-main > *:not(.fab-slot):not(.compose-fab-slot) {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
  }

  .browse-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  }

  .list-grid,
  .feed-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), var(--card-max-w)));
  }

  .list-card,
  .feed-post {
    min-height: 0;
  }

  .fab-slot {
    right: var(--page-pad);
  }
}

@media (min-width: 1200px) {
  :root {
    --page-pad: 3.5rem;
    --gap: 1.5rem;
    --gap-lg: 2rem;
    --card-pad: 1.5rem;
    --tile-h: 10rem;
    --photo-h: 13.5rem;
    --feed-photo-h: 15rem;
    --sidebar-w: 16.5rem;
    --header-h: 4rem;
  }

  .auth-shell {
    max-width: 36rem;
    padding: 2.5rem 2.25rem;
  }

  .app-nav-link {
    padding: 0.75rem 0.9rem;
  }
}

/* ── Utility classes ───────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-sizing: border-box;
  max-width: 100%;
}

.page-title {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-lead {
  margin: 0.375rem 0 0;
  font-family: var(--font);
  font-size: var(--text-sm);
  color: var(--slate);
  line-height: 1.5;
}

.page-with-back {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.required-mark {
  display: inline-block;
  color: var(--danger);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  margin-left: 6px;
  vertical-align: -2px;
}

.field-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
  font-size: var(--text);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

.field-input[type="date"],
.field-input[type="time"],
.field-input[type="datetime-local"] {
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.when-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.when-fields > div {
  min-width: 0;
}

.when-fields--banner .when-tile {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}

@media (min-width: 640px) {
  .when-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .audit-filters,
  .when-fields.audit-filters {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

.app-main {
  overflow-x: hidden;
}

.app-main .card {
  overflow-x: hidden;
}

@media (max-width: 480px) {
  .app-header {
    gap: 4px;
  }

  .tour-coach {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .tour-coach-copy > p {
    font-size: 12px;
  }
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 133, 85, 0.12);
}

.field-input.error { border-color: var(--danger); }

/* Native password bullets are oversized on many mobile browsers */
.field-input[type="password"] {
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
}

/* ── Shared location picker (Leaflet map) ──────────────────────── */
.location-picker {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.location-picker-search {
  display: flex;
  gap: 8px;
}
.location-picker-search .field-input {
  flex: 1;
}
/* Combined-class selector so this wins over the later, equal-specificity
   .btn-ghost rule (display:block/width:100%/padding), which was
   collapsing this into a squashed, icon-less box. */
.btn-ghost.location-picker-locate {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f0f0ec;
}
.btn-ghost.location-picker-locate:hover {
  background: var(--accent-s);
}

.location-picker-pin {
  background: transparent;
  border: none;
}
.location-picker-map {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: var(--surface);
}
.location-picker-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--slate);
}
/* Leaflet draws its own controls; keep them from fighting the app's z-index stack */
.location-picker-map.leaflet-container {
  z-index: 0;
}

@media (max-width: 640px) {
  .field-input[type="password"] {
    font-size: 0.8125rem;
    letter-spacing: 0.22em;
    line-height: 1.35;
  }
}

/* Figma Write comment (17:81) — white pill on the page surface */
.comment-input {
  display: block;
  width: 100%;
  height: 2.6rem;
  background: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 0.75rem 0.875rem;
  /* 16px floor: iOS Safari zooms the viewport into inputs with smaller fonts */
  font-size: max(1rem, var(--text-sm));
  line-height: 1.2;
  color: var(--ink);
  font-family: inherit;
  outline: none;
}

.comment-input::placeholder {
  color: var(--slate);
  font-weight: 400;
}

.comment-input:focus {
  box-shadow: 0 0 0 2px rgba(35, 133, 85, 0.18);
}

.comment-input:disabled {
  opacity: 0.6;
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--cta);
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 1rem;
  font-size: var(--text);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
}

.btn-primary:hover:not(:disabled) { background: var(--cta-h); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-danger {
  display: block;
  width: 100%;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 1rem;
  font-size: var(--text);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
}

.btn-danger:hover:not(:disabled) { background: #b71c1c; }
.btn-danger:active:not(:disabled) { transform: scale(0.98); }
.btn-danger:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: none;
  border-radius: 28px;
  padding: 0.875rem;
  font-size: var(--text);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.btn-ghost:hover { background: var(--accent-s); }

.tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent-s);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.tag-green {
  background: var(--accent-s);
  color: var(--accent);
}

.tag-amber {
  background: #fef3c7;
  color: #92400e;
}

.tag-red {
  background: #fee2e2;
  color: #991b1b;
}

.tag-grey {
  background: #f3f4f6;
  color: var(--slate);
}

.field-error {
  font-size: var(--text-sm);
  color: var(--danger);
  margin-top: 4px;
}

.field-helper {
  font-size: var(--text-sm);
  color: var(--slate);
  margin-top: 4px;
}

.posted-at {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--slate);
  font-weight: 500;
  height: var(--card-meta-h);
  line-height: var(--card-meta-h);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  margin-bottom: var(--gap-lg);
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  margin-bottom: 1rem;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
}

.alert-success {
  background: var(--accent-s);
  border: 1px solid #9fd4b5;
  color: var(--accent-h);
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  margin-bottom: 1rem;
}

/* ── Scrollbar thin ────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* Submit-loading spinner (commhub-ui.js initSubmitLoading) */
.btn-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: -0.15em;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Post-success overlay (_post_success_overlay.html) ─────────── */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(26, 26, 26, 0.55);
  animation: successFadeIn 160ms ease;
}
.success-overlay.is-hiding {
  opacity: 0;
  transition: opacity 200ms ease;
}
.success-overlay-card {
  width: min(22rem, 100%);
  background: var(--card);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.success-overlay-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent-s);
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.success-overlay-title {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.success-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
[inert] {
  pointer-events: none;
  user-select: none;
}
@keyframes successFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.posted-confirm {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 40px;
  text-align: center;
  animation: fadeIn 0.2s ease-out;
}

.posted-confirm-check {
  width: 88px;
  height: 88px;
  margin-bottom: 20px;
}

.posted-confirm-check circle {
  fill: none;
  stroke: #238555;
  stroke-width: 3;
  stroke-dasharray: 201;
  stroke-dashoffset: 201;
  animation: postedConfirmRing 0.55s ease-out forwards;
}

.posted-confirm-check path {
  fill: none;
  stroke: #238555;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: postedConfirmTick 0.35s 0.35s ease-out forwards;
}

@keyframes postedConfirmRing {
  to { stroke-dashoffset: 0; }
}

@keyframes postedConfirmTick {
  to { stroke-dashoffset: 0; }
}

.posted-confirm-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.posted-confirm-body {
  margin: 8px 0 0;
  max-width: 280px;
  font-size: 0.95rem;
  color: var(--slate);
  line-height: 1.45;
}

.posted-confirm-actions {
  width: min(100%, 280px);
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-crop-file {
  display: none;
}

.photo-crop-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--slate);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.photo-crop-pick.has-photo {
  border-style: solid;
  border-color: var(--line);
  background: #111;
}

.photo-crop-pick.is-round {
  max-width: 10rem;
  margin-inline: auto;
  border-radius: 50%;
}

.photo-crop-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-crop-edit-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.photo-crop-text-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}

.photo-crop-text-btn.is-remove {
  color: var(--danger);
}

.photo-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-pad);
  background: rgba(0, 0, 0, 0.55);
}

.photo-crop-sheet {
  width: min(32rem, 100%);
  max-height: 96svh;
  overflow: auto;
  padding: 1.25rem;
  background: var(--card);
  border-radius: 1rem;
}

.photo-crop-title {
  margin: 0 0 0.35rem;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--ink);
}

.photo-crop-hint {
  margin: 0 0 1rem;
  font-size: var(--text-sm);
  color: var(--slate);
}

.photo-crop-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #111;
  border-radius: 12px;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.photo-crop-stage:active {
  cursor: grabbing;
}

.photo-crop-stage.is-round {
  border-radius: 50%;
}

.photo-crop-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  pointer-events: none;
}

.photo-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.photo-crop-zoom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.photo-crop-zoom input {
  flex: 1;
}

.photo-crop-actions {
  display: flex;
  gap: 0.75rem;
}

.photo-crop-actions .btn-primary,
.photo-crop-actions .btn-ghost {
  width: auto;
  flex: 1;
  padding: 0.75rem;
}

.hover-caption {
  position: fixed;
  z-index: 400;
  transform: translate(-50%, calc(-100% - 8px));
  background: #1a1a1a;
  color: #fff;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: min(240px, calc(100vw - 24px));
  text-align: center;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.hover-caption.is-below {
  transform: translate(-50%, 8px);
}

.hover-caption::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1a1a;
}

.hover-caption.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1a1a1a;
}

.card-photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 28px 12px 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .card-photo:hover .card-photo-caption,
  .card-photo:focus-within .card-photo-caption {
    opacity: 1;
    transform: translateY(0);
  }
}

.browse-tile-caption {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.18s ease, max-height 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .browse-tile:hover .browse-tile-caption,
  .browse-tile:focus-visible .browse-tile-caption {
    opacity: 0.95;
    max-height: 2.6em;
  }
}

/* ── Guided tour: pink pointer, green actions, no freeze ── */
.tour-pointer {
  position: fixed;
  z-index: 1200;
  pointer-events: none;
  border: 3px solid var(--mark);
  border-radius: 14px;
  box-shadow: 0 0 0 6px rgba(181, 68, 106, 0.28);
  animation: tour-pointer-pulse 1.35s ease-in-out infinite;
  box-sizing: border-box;
  transition: top 0.12s ease, left 0.12s ease, width 0.12s ease, height 0.12s ease;
}

@keyframes tour-pointer-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(181, 68, 106, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(181, 68, 106, 0.12);
  }
}

/* ── Tour spotlight: dim the page, block everything but the highlight ── */

.tour-shade {
  position: fixed;
  inset: 0;
  z-index: 1190; /* below .tour-pointer (1200) and .tour-coach (1210) */
  pointer-events: none; /* container must never intercept — strips do */
}

.tour-shade-strip {
  position: absolute;
  background: rgba(15, 23, 42, 0.55);
  pointer-events: auto; /* swallow clicks everywhere except the hole */
  /* deliberately no transition: animated strips sweep across the hole and
     transiently block the hotspot's target mid-sweep */
}

.tour-hotspot {
  position: fixed;
  z-index: 1195; /* above the shade, under the frame and coach card */
  border-radius: 16px;
  cursor: pointer;
  pointer-events: auto;
  transition: top 0.12s ease, left 0.12s ease, width 0.12s ease, height 0.12s ease;
}

.tour-coach {
  position: fixed;
  z-index: 1210;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  max-width: min(28rem, calc(100vw - 24px));
  width: auto;
  margin-inline: auto;
  pointer-events: auto;
  box-sizing: border-box;
}

.tour-coach.is-high {
  bottom: auto;
  top: calc(var(--header-h) + env(safe-area-inset-top) + 10px);
}

.tour-coach-video {
  position: relative;
  width: 100%;
  /* Portrait (9:16) to match vertically-shot step videos - was 16:10
     landscape, which crushed portrait clips into a sliver. */
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
  align-self: start;
}

.tour-coach-video img,
.tour-coach-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: #1a1a1a;
}

.tour-coach-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tour-coach-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.tour-coach-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.tour-coach-head span {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate);
  flex-shrink: 0;
}

.tour-coach-langs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tour-coach-langs button {
  padding: 3px 8px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 10px;
  font-family: inherit;
  background: var(--line);
  color: var(--ink);
}

.tour-coach-langs button.is-on {
  background: var(--accent);
  color: #fff;
}

.tour-coach-copy > p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.tour-coach-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.tour-coach-skip,
.tour-coach-next {
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  font-size: 13px;
}

.tour-coach-skip {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

.tour-coach-next {
  flex: 1;
  border: none;
  background: var(--accent);
  color: #fff;
}

.tour-coach-next:hover {
  background: var(--accent-h);
}

@media (min-width: 640px) {
  .tour-coach {
    left: auto;
    right: 20px;
    width: min(380px, calc(100vw - 40px));
    margin-inline: 0;
  }
}

/* ── Sidebar avatar + identity (mirrors React AppChrome SidebarAvatar) ── */
.app-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--text-sm); line-height: 1; flex-shrink: 0;
  text-transform: uppercase;
}
.app-avatar-img {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; display: block;
}
.app-sidebar-identity { min-width: 0; }
.app-sidebar-profile { text-decoration: none; }
.messages { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.alert { border-radius: 10px; padding: .625rem .875rem; font-size: .9rem; }
.alert-success { background: var(--accent-s); border: 1px solid #9fd4b5; color: var(--accent-h); }
.alert-error, .alert-danger { background: #fdecea; border: 1px solid #f5c6cb; color: var(--danger); }

/* Sidebar divider between primary and secondary nav (matches React inline rule) */
.app-sidebar-divider { height: 1px; background: var(--line); margin: 0 0.5rem 0.75rem; }

/* Leader tag pill (replaces React LeaderTag component) */
.leader-tag {
  display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-s); color: var(--accent-h); font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.03em;
}

/* -- Settings hub links + choice cards (mirror React SettingsLink / ChoiceButton) -- */
.settings-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 40px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.settings-back {
  display: inline-block;
  padding: 4px 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  align-self: flex-start;
}
.profile-settings-card {
  padding: 24px 20px;
  text-align: center;
  position: relative;
}
.profile-edit-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  text-decoration: none;
}
.profile-photo-form {
  margin: 0 auto 12px;
  width: 88px;
}
.profile-photo-btn {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  width: 88px;
  height: 88px;
}
.profile-photo-img {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  object-fit: cover;
  display: block;
}
.profile-photo-fallback {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
}
.profile-photo-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.profile-name {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}
.profile-meta {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: var(--slate);
}
.profile-about {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
}
.profile-pending-banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
}
.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-top: 8px;
}
.profile-cancel-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 12px;
  border-radius: 10px;
}
.settings-logout {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  color: var(--danger);
  text-decoration: none;
}
.settings-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: none;
  color: #991b1b;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}
.activity-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.activity-tab {
  padding: 7px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.activity-tab.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.activity-row {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.activity-row.is-last {
  border-bottom: none;
}
.activity-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.activity-row-title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}
.activity-row-kind {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-s);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.activity-row-meta {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--slate);
}
.activity-empty {
  padding: 20px 16px;
  color: var(--slate);
  font-size: 0.9rem;
  margin: 0;
}

.settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.settings-link strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}
.settings-link-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--slate);
  line-height: 1.35;
}
.settings-link-chevron {
  color: var(--slate);
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.choice-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  text-decoration: none;
}
.choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-card.is-active {
  border-color: var(--accent);
  background: var(--accent-s);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice-card strong {
  font-size: 0.92rem;
  font-weight: 800;
}

/* Engagement row — interactive likes / comments / share */
.engagement-row {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #5c5c5c;
  font-size: 13px;
  font-weight: 500;
}
.engagement-form {
  margin: 0;
  display: inline-flex;
}
.engagement-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.engagement-btn.is-active {
  color: var(--accent);
}
.engagement-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 36px;
  min-height: 36px;
}
.engagement-stat svg,
.engagement-btn svg {
  flex-shrink: 0;
}

.save-form { margin: 0; }
.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.save-btn.is-saved {
  background: var(--accent-s);
  border-color: var(--accent);
  color: var(--accent);
}

/* Detail pages — ported from app.css + React main Job/Event/Advert/Business/Study detail */
.muted {
  color: var(--slate);
  font-size: 0.9rem;
}
.detail-page {
  padding-bottom: 88px;
  width: 100%;
}
.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}
.detail-stack.is-gap {
  gap: 12px;
}
.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
  width: 100%;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  gap: 12px;
  width: 100%;
}
.meta-row-loc {
  align-items: center;
}
.meta-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}
.meta-val-loc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.map-pin,
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}
.map-link {
  color: var(--ink);
  font-weight: 700;
}
.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.detail-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  flex: 1;
  letter-spacing: -0.01em;
}
.detail-title.is-advert {
  font-size: 1.4rem;
  margin: 0;
}
.detail-title-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.detail-desc-block {
  margin: 0 0 16px;
  width: 100%;
}
.detail-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
}
.detail-info-block {
  width: 100%;
  margin: 0 0 8px;
}
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
  width: 100%;
}
.detail-report {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 0 8px 16px;
  flex-shrink: 0;
}
.detail-report.is-center {
  text-align: center;
  padding: 4px 0;
  align-self: center;
}
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  margin: 0 0 24px;
  font-family: inherit;
  box-sizing: border-box;
}
.btn-whatsapp:hover {
  filter: brightness(0.96);
  color: #fff;
}
.detail-poster {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  width: 100%;
}
.detail-poster.is-advert {
  margin-bottom: 20px;
  padding-bottom: 20px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.avatar.is-soft {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-s);
  color: var(--accent);
}
.poster-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.poster-sub {
  margin: 2px 0 0;
  font-size: 0.82rem;
}
.detail-advert-card {
  overflow: hidden;
  width: 100%;
}
.detail-advert-body {
  padding: 20px;
}
.detail-safety-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--slate);
  line-height: 1.5;
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 0;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 140px;
  background: #fff;
  color: var(--accent);
  border-radius: 28px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.social-link:hover {
  background: var(--accent-s);
  color: var(--accent);
}
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--accent-s);
  color: var(--accent);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.pill-free {
  background: var(--accent);
  color: #fff;
}
.study-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  border: none;
  cursor: pointer;
}
.btn-accent:hover {
  background: var(--accent-h);
  color: #fff;
}

.comment-thread {
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.comment-thread-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}
.comment-compose {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.comment-compose .comment-input {
  flex: 1;
  min-width: 0;
  width: auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.comment-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.comment-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.comment-send.is-ready {
  background: var(--accent);
  cursor: pointer;
}
.comment-send.is-ready:hover {
  filter: brightness(1.05);
}
.comment-send.is-ready:active {
  transform: scale(0.96);
}
.comment-hint {
  margin: 0;
  font-size: 11px;
  color: var(--slate);
  text-align: right;
}
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-node.is-reply {
  margin-left: 14px;
  border-left: 2px solid var(--line);
  padding-left: 10px;
}
.comment-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.comment-line {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink);
  word-break: break-word;
}
.comment-author {
  font-weight: 700;
}
.comment-reply-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.comment-toggle-replies {
  background: none;
  border: none;
  padding: 2px 0 4px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.comment-replies {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.comment-replying {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--slate);
}
.comment-cancel-reply {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 0;
}
.comment-empty,
.comment-login {
  margin: 0;
  color: var(--slate);
  font-size: 0.9rem;
}

/* Data-safe: hide listing/feed photos entirely - the whole frame, not just
   the image inside it - so Wi-Fi-off shows the post with no leftover
   colored placeholder box where the photo would have been. */
html.data-safe .card-photo {
  display: none;
}

/* ── Announcements (list + group detail — React AnnouncementsPage / GroupDetailPage) ── */
.announce-page,
.announce-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 80px;
}
.announce-search {
  position: relative;
}
.announce-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.announce-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.announce-tab {
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.announce-tab.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.announce-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.announce-cats::-webkit-scrollbar { display: none; }
.announce-chip {
  padding: 7px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.announce-chip.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.announce-count-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.announce-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--slate);
}
.announce-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}
.announce-group-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.announce-group-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.announce-group-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.announce-group-row .announce-join-form,
.announce-group-row .announce-join-btn {
  position: relative;
  z-index: 1;
}
.announce-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.announce-avatar.is-lg {
  width: 52px;
  height: 52px;
  font-size: 1.25rem;
}
.announce-avatar.is-photo.has-img,
.announce-avatar.has-img {
  padding: 0;
  background: #dfe8e3;
}
.announce-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.announce-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.group-pfp-form {
  margin: 0;
  flex-shrink: 0;
}
.group-pfp-form .announce-avatar {
  cursor: pointer;
}
.group-pfp-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--card, #fff);
  pointer-events: none;
}
.group-pfp-about-btn {
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.group-pfp-about-btn:hover {
  text-decoration: underline;
}
.group-pfp-about-form {
  margin: 0;
  display: inline;
}
.announce-group-meta { flex: 1; min-width: 0; }
.announce-group-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 0;
}
.announce-about-tag {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-s, #e8f5ee);
  color: var(--accent-h, #1a6b42);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.announce-group-about {
  margin: 5px 0 0;
  font-size: 0.82rem;
  color: var(--slate);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.announce-group-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--slate);
}
.announce-online { color: var(--accent); }
.announce-join-form {
  flex-shrink: 0;
  align-self: center;
}
.announce-join-form { flex-shrink: 0; margin: 0; }
.announce-join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 20px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.announce-join-btn.is-joined {
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
}
/* Exit-group affordance: red text so leaving reads as a destructive action. */
.announce-join-btn.is-joined[data-confirm-label="Exit group"] {
  color: var(--danger);
}
.announce-empty {
  background: var(--card);
  border-radius: 14px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  text-align: center;
}
.announce-empty h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.announce-empty p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--slate);
}
.announce-detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.announce-post-list {
  display: flex;
  flex-direction: column;
}
.announce-feed-post {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.announce-feed-post.is-pinned {
  background: var(--accent-s);
  border-radius: 12px;
  padding: 14px 14px 20px;
  border-bottom: none;
  margin-bottom: 16px;
}
.announce-feed-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}
.announce-feed-message {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
}
.announce-feed-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.announce-about,
.announce-members {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.announce-about-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.announce-about-desc {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.announce-about-desc p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
}
.announce-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.announce-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.announce-member-info {
  flex: 1;
  min-width: 0;
}
.announce-member-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}
.announce-remove-form {
  margin: 0;
  flex-shrink: 0;
}
.announce-remove-btn {
  border: 1.5px solid #fecaca;
  background: #fff5f5;
  color: #991b1b;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.announce-remove-btn:hover {
  background: #fee2e2;
}
.group-report-card {
  margin-top: 12px;
}
.group-report-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.group-report-reason {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}
.group-report-btn {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: #991b1b;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.compose-page {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
  width: 100%;
}
.compose-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.compose-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 14px;
  margin-bottom: 8px;
}
.announce-post-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 8px;
}
.announce-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 100%;
  word-break: break-all;
}
.announce-file-chip span {
  color: var(--accent);
  margin-left: auto;
  flex-shrink: 0;
}
.announce-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.announce-media-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.announce-media-thumb {
  display: block;
  aspect-ratio: 1;
  background: #386138;
  overflow: hidden;
}
.announce-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.announce-media-file {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--slate);
  text-align: center;
}
.announce-media-file p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  word-break: break-word;
  color: var(--ink);
}
.announce-media-meta {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.announce-media-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.announce-download {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: 4px;
}

/* ── WhatsApp-style group chat ── */
.announce-detail.is-chat {
  padding-bottom: 0;
  min-height: calc(100dvh - 140px);
}
.group-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0 -4px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(232, 245, 238, 0.55) 0%, rgba(245, 247, 246, 0.9) 100%);
  border: 1px solid var(--line);
  min-height: min(62vh, 560px);
  max-height: min(70vh, 640px);
}
.group-chat-stream {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.group-chat-empty {
  margin: auto;
  text-align: center;
  padding: 28px 16px;
  color: var(--slate);
  font-size: 0.9rem;
}
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}
.chat-row.is-mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dfe8e3;
  color: var(--slate);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-bubble {
  position: relative;
  padding: 8px 10px 6px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
  max-width: 100%;
  min-width: 72px;
}
.chat-row.is-mine .chat-bubble {
  background: #d9f5e6;
  border-bottom-right-radius: 4px;
}
.chat-row:not(.is-mine) .chat-bubble {
  border-bottom-left-radius: 4px;
}
.chat-row.is-pinned .chat-bubble {
  box-shadow: inset 0 0 0 1.5px rgba(26, 107, 66, 0.35);
}
.chat-admin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(26, 107, 66, 0.12);
  color: var(--accent-h, #1a6b42);
  vertical-align: middle;
}
.chat-row.is-mine .chat-admin-badge {
  background: rgba(15, 81, 50, 0.14);
  color: #0f5132;
}
.chat-author {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-h, #1a6b42);
}
.chat-row.is-mine .chat-author {
  color: #0f5132;
}
.chat-reply-quote {
  display: block;
  margin: 0 0 6px;
  padding: 6px 8px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: inherit;
}
.chat-row.is-mine .chat-reply-quote {
  background: rgba(255, 255, 255, 0.45);
}
.chat-reply-quote-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-h, #1a6b42);
  margin-bottom: 2px;
}
.chat-reply-quote-text {
  display: block;
  font-size: 0.78rem;
  color: var(--slate);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.chat-reply-btn {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}
.chat-reply-btn:hover {
  text-decoration: underline;
}
.chat-pin {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-h, #1a6b42);
}
.chat-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat-media {
  display: block;
  margin-top: 6px;
  border-radius: 10px;
  overflow: hidden;
}
.chat-media img {
  display: block;
  max-width: min(240px, 70vw);
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: cover;
}
.chat-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  max-width: 100%;
  word-break: break-all;
}
.chat-time {
  display: block;
  font-size: 0.65rem;
  color: var(--slate);
  line-height: 1;
}
.group-chat-reply-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--accent-s, #e8f5ee);
  border-left: 3px solid var(--accent);
}
.group-chat-reply-bar[hidden] {
  display: none !important;
}
.group-chat-reply-bar-text {
  flex: 1;
  min-width: 0;
}
.group-chat-reply-bar-label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-h, #1a6b42);
  margin-bottom: 2px;
}
.group-chat-reply-bar-preview {
  display: block;
  font-size: 0.8rem;
  color: var(--slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-chat-reply-cancel {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
  padding: 0 4px;
}
.group-chat-composer {
  flex-shrink: 0;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-top: 1px solid var(--line);
}
.group-chat-composer-main {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.group-chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
  background: #f7faf8;
  color: var(--ink);
}
.group-chat-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.group-chat-attach {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  cursor: pointer;
  flex-shrink: 0;
}
.group-chat-attach:hover {
  background: var(--accent-s, #e8f5ee);
  color: var(--accent);
}
.group-chat-send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.group-chat-send:hover {
  filter: brightness(1.05);
}
.group-chat-file-hint {
  margin: 6px 4px 0;
  font-size: 0.75rem;
  color: var(--slate);
}
.group-chat-join-hint {
  padding: 12px 14px;
  margin: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  text-align: center;
}

/* ── Info centre guide card: close affordance + tile return pulse ──── */
.info-guide-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.info-guide-close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.info-guide-close:hover {
  background: var(--accent-s);
  color: var(--accent);
}

@keyframes tileReturnPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  60% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

.tile-return-pulse {
  animation: tileReturnPulse 0.9s ease-out 2;
}

/* ── Image upload dropzone (create forms) ─────────────────────────── */
.image-dropzone {
  width: 100%;
  aspect-ratio: 1.6 / 1;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--slate);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.image-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-s);
}
.image-dropzone.has-image {
  border-style: solid;
  padding: 0;
}
.image-dropzone-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-dropzone-change {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(15, 23, 20, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 14px;
  pointer-events: none;
}

/* ── Swipe/back guard toast ───────────────────────────────────────── */
.app-guard-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 12px);
  background: rgba(15, 23, 20, 0.92);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 16px;
  border-radius: 14px;
  max-width: min(92vw, 420px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
}
.app-guard-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── In-app confirm dialog (mirrors the offline-prompt pattern) ─────── */
/* Native confirm() is unstyleable and silently suppressed in some webviews
   (PWA/Electron), so destructive actions use this styled dialog instead.
   Structure matches the offline prompt: dimmed warm backdrop, white card
   with a bold title + slate body, pill Cancel/Confirm buttons. */
.app-confirm-backdrop {
  position: fixed;
  inset: 0;
  /* Above the mobile nav drawer (.app-sidebar/.app-drawer, z-index 999)
     and its backdrop (998) - a data-confirm trigger (e.g. logout) can
     live inside that drawer, so this must render above both or it
     opens invisibly behind the still-open drawer. */
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 20, 0.45);
  animation: appConfirmFade 0.15s ease-out;
}

@keyframes appConfirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.app-confirm-card {
  width: min(100%, 360px);
  background: var(--card, #fff);
  border: 1px solid var(--line, #e5e5e0);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 20px 18px;
}

.app-confirm-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}

.app-confirm-message {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--slate);
}

.app-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-confirm-actions .btn-ghost,
.app-confirm-actions .btn-primary {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem;
  cursor: pointer;
}



/* ── Info centre: admin quick-add panel (opened by the floating +) ── */
.info-add-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(1.5rem, calc(1rem + env(safe-area-inset-bottom)));
  width: min(440px, calc(100vw - 2 * var(--page-pad, 1rem)));
  max-height: min(72vh, 640px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  padding: 16px 18px 18px;
  z-index: 50;
}

.info-add-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.info-add-panel-head p {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
}

.info-add-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
  padding: 2px 6px;
}

.info-add-close:hover { color: var(--ink); }

/* Expand (⤢) control beside the panel's × — Windows min/max style */
.info-add-max {
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.info-add-max:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}
