/* TapNeighbor v87 - 2026-11-23 07:45 EST */
/* TapNeighbor — mobile-first, clean, original design.
   Theme: Nutella brown primary + WHITE background. */
[hidden] { display: none !important; }
:root {
  --red: #6B4226;
  --red-dark: #4A2C15;
  --red-light: #E0CDB4;
  --red-pale: #F7F0E6;
  /* Fixed Nutella brown theme (no color picker anymore).
     --on-theme: text/icons sitting ON a themed background (top bar,
     primary buttons) — white on Nutella brown is readable.
     --theme-ink: the theme color used as text on a white background
     (links, "see more"). */
  --on-theme: #fff;
  --theme-ink: #6B4226;
  --ink: #1F2937;
  --muted: #6f6156;
  --line: #E5E7EB;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --danger: #B91C1C;
  --radius: 14px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
h1 { font-size: 28px; margin: 8px 0; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 14px 0 8px; }
.admin-panel h4 { font-size: 14px; margin: 16px 0 6px; }
p { margin: 8px 0; }
a { color: var(--theme-ink); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS zoom */
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
textarea { resize: vertical; }
img { max-width: 100%; height: auto; display: block; }

/* ---- header ---- */
/* v58: the thick blue band is gone — the bar is page-colored (white)
   with dark text/icons, plus a hairline to separate it from
   the feed. Logo, location/weather and the bell all stay. */
/* v59: three groups — brand (left), avatar + search + sort (center,
   same line as the location badge), location badge + bell (right).
   On narrow screens the middle group wraps to its own row so nothing
   overflows; the brand text hides so the badge + bell still fit. */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--bg); color: var(--theme-ink);
  /* H14: notch-safe — the bar never slides under the status bar on
     installed iPhone PWAs (viewport-fit=cover is set in index.html). */
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  border-bottom: 1px solid var(--line);
}
.topbar-mid {
  flex: 1 1 100%; order: 3;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.topbar-mid .search-row { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.topbar-mid .sort-wrap { flex: 0 0 auto; margin: 0; }
.topbar-right {
  flex: 0 0 auto; margin-left: auto;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
/* v75: profile button in the top bar, next to the bell (moved out of
   the sidebar). Compact: small round avatar + name. */
.top-profile { position: relative; flex: 0 0 auto; min-width: 0; }
.top-profile-btn {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 3px 10px 3px 3px; cursor: pointer; color: inherit; font: inherit;
  max-width: 180px;
}
.top-profile-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--red-pale); color: var(--red-dark);
  font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden;
}
.top-profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top-profile-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 160px; padding: 6px;
}
.profile-menu[hidden] { display: none; }
.profile-menu-name { font-weight: 700; font-size: 13px; margin: 0; padding: 8px 10px 4px; }
.profile-menu-item {
  display: block; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer; font: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 6px; color: inherit;
}
.profile-menu-item:hover { background: var(--red-pale); }
.brand-text { white-space: nowrap; }
@media (max-width: 699px) {
  .brand-text { display: none; }
  /* v75: on phones the top-right profile shows only the avatar —
     the name would crowd row 1; the menu still shows it. */
  .top-profile-name { display: none; }
  .top-profile-btn { padding: 3px; }
  /* Mobile topbar is TWO compact rows — one row could not fit the
     logo + avatar + search + sort + location badge + bell on a
     narrow phone, so the location badge overlapped the search box.
     Row 1: logo + location badge (truncates) + bell. Row 2: avatar
     + search + sort, full width. */
  .topbar { flex-wrap: wrap; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; }
  .topbar-mid { flex: 1 1 100%; order: 3; min-width: 0; }
  .topbar-right { order: 2; min-width: 0; }
  .location-badge { min-width: 0; }
}
@media (min-width: 700px) {
  .topbar { flex-wrap: nowrap; }
  .topbar-mid { flex: 1 1 auto; order: 2; justify-content: center; }
  .topbar-mid .search-row { max-width: 360px; }
  .topbar-right { order: 3; }
}
/* ---- feed sort select (Newest / Trending / My neighborhood) ---- */
/* width:auto on purpose: the base "select { width: 100% }" rule made
   this 100% wide inside the desktop flex row, so it overflowed and
   sat on top of the search bar. It sizes to its content now. */
/* v76: the sort control is a custom dropdown, not a native select —
   light brown button with a down arrow; Trending is first. */
.sort-wrap { position: relative; flex: 0 0 auto; }
.feed-sort-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; padding: 7px 12px;
  border: 1px solid var(--red-light); border-radius: 999px;
  background: var(--red-light); color: var(--red-dark); cursor: pointer;
  white-space: nowrap;
}
.sort-arrow { font-size: 10px; line-height: 1; }
.sort-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 160px; padding: 6px;
}
.sort-menu[hidden] { display: none; }
.sort-menu-item {
  display: block; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer; font: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 6px; color: inherit;
}
.sort-menu-item:hover { background: var(--red-pale); }
.sort-menu-item.selected { font-weight: 700; background: var(--red-pale); }
/* ---- age confirmation (COPPA: 13+) on the signup form ---- */
.age-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.4; margin: 10px 0 2px; cursor: pointer; }
.age-check input { margin-top: 2px; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--red); }
/* ---- custom SVG icons (our own set, no emoji) ---- */
.ic { flex: 0 0 auto; vertical-align: -3px; }
.side-item .ic { vertical-align: -4px; }
.bell-btn .ic { vertical-align: -2px; }
/* ---- topbar bell (notifications) ---- */
.bell-btn {
  position: relative; flex: 0 0 auto;
  border: none; background: var(--red-pale); color: var(--theme-ink);
  width: 38px; height: 38px; border-radius: 50%; font-size: 17px; line-height: 1;
  cursor: pointer;
}
.bell-badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
  padding: 0 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
/* ---- right-rail ad slots (small, clearly marked, Facebook-style card) ---- */
.ad-card { padding: 12px 14px; }
.ad-card .ad-body { display: flex; flex-direction: column; gap: 6px; }
.ad-img { width: 100%; border-radius: 10px; display: block; }
.ad-headline { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.35; margin: 0; }
.ad-text { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }
.ad-cta { display: inline-block; align-self: flex-start; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; text-decoration: none; }
.ad-cta:active { opacity: .85; }
/* ---- admin ad editor (list of ads, each with its own dates) ---- */
.ad-slot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.ad-slot:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.ad-slot-title { font-size: 15px; margin: 0 0 8px; }
.ad-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin: 8px 0; display: block; }
.ad-dates { display: flex; gap: 8px; }
.ad-dates label { flex: 1; min-width: 0; }
.ad-dates input { font-size: 14px; }
.ad-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ad-delete { border: none; background: none; color: var(--danger); font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 0; }
/* ---- admin layout: left sub-menu + center content (v53) ---- */
.admin-layout { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.admin-submenu { display: flex; flex-direction: column; gap: 6px; }
.admin-submenu-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 14px; font-weight: 600; color: var(--ink); }
.admin-submenu-btn:active { background: var(--red-pale); }
.admin-submenu-btn.active { background: var(--red); color: var(--on-theme); border-color: var(--red); }
.admin-content { flex: 1; min-width: 0; }
.admin-content .admin-panel { margin-bottom: 0; }
@media (min-width: 700px) {
  .admin-layout { flex-direction: row; align-items: flex-start; }
  .admin-submenu { flex: 0 0 190px; position: sticky; top: 76px; }
}
/* On desktop the admin sections live in the left sidebar under Admin
   (v54), so the in-view sub-menu is hidden and the content is full width. */
/* Sidebar item styles live outside the breakpoints — they only render
   when the sidebar itself is displayed, at 700px and up. */
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; border-radius: 999px;
  padding: 10px 14px; font-size: 15px; font-weight: 600; color: var(--ink);
  text-align: left; cursor: pointer;
}
.side-item:hover { background: var(--red-light); }
.side-item.side-post { background: var(--red); color: var(--on-theme); justify-content: center; margin-bottom: 8px; }
.side-item.side-post:hover { background: #B91C1C; }
/* Admin sub-menu items nested under Admin in the left sidebar (v54). */
.side-admin-submenu { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px; }
.side-item.side-subitem { padding: 8px 14px 8px 44px; font-size: 13px; font-weight: 500; }
.side-item.side-subitem.active { background: var(--red); color: var(--on-theme); }
/* v74: the desktop sidebar (and with it "Invite neighbors") also
   appears on medium desktop windows (700–999px) — a half-screen
   window or a scaled laptop display used to hide the whole sidebar,
   leaving no Invite entry point on desktop at all. Two columns here
   (sidebar + feed); the ads rail still waits for the full 1000px layout. */
@media (min-width: 700px) and (max-width: 999px) {
  .desktop-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    /* v75: the sidebar sits further from the feed (was 16px). */
    gap: 32px; justify-content: center; align-items: start;
    max-width: 960px; margin: 0 auto; padding: 0 16px;
  }
  /* v75: the top bar is centered on the same 960px as the layout,
     so the page's left and right margins stay equal. */
  .topbar { max-width: 960px; margin-left: auto; margin-right: auto; }
  .app-shell { max-width: none; margin: 0; padding: 14px 0 96px; grid-column: 2; }
  .fab { display: none; }
  /* v81: tablet top bar is two rows (like mobile) — one row could
     not fit the brand + avatar + search + sort + location +
     profile + bell, so the search box was squeezed to ~5px and the
     brand text was cut to "TapNeigh". */
  .topbar { flex-wrap: wrap; }
  .topbar-mid { flex: 1 1 100%; order: 3; min-width: 0; }
  .topbar-mid .search-row { max-width: none; }
  .brand-text { display: none; }
  .top-profile-name { display: none; }
  .top-profile-btn { padding: 3px; }
  #desktopSidebar:not([hidden]) { display: flex; flex-direction: column; min-height: calc(100vh - 96px); }
  .desktop-sidebar { grid-column: 1; position: sticky; top: 76px; }
  /* Signed-out landing stays one column here too (the sidebar is
     hidden on auth, so the two-column grid would leave a gap). */
  .desktop-layout:has(#view-auth:not([hidden])) { grid-template-columns: minmax(0, 960px); }
  .desktop-layout:has(#view-auth:not([hidden])) .app-shell { grid-column: 1; }
}
@media (min-width: 1000px) {
  .admin-submenu { display: none; }
}
/* ---- paused (inactive) posts and comments ---- */
.inactive-badge { background: #FEF3C7; color: #92400E; }
.pinned-badge { background: #E0CDB4; color: #4A2C15; }
.reported-badge { background: #FEE2E2; color: #991B1B; }
.comment.inactive .comment-bubble { background: #FEF3C7; }
.inactive-note { font-size: 12px; color: #92400E; margin: 2px 0 0 12px; }
/* ---- waiting for approval (own pending posts and comments) ---- */
.pending-badge { background: #E0CDB4; color: #1E40AF; }
.comment.pending .comment-bubble { background: #F7F0E6; }
.pending-note { font-size: 12px; color: #1E40AF; margin: 2px 0 0 12px; }
/* ---- pause modal: resubmit checkbox ---- */
.deactivate-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.4; margin: 10px 0; cursor: pointer; }
.deactivate-check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--red); }
/* ---- notifications list ---- */
.notif-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { font-weight: 600; }
.notif-row.unread .notif-dot { background: var(--theme-ink); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #D1D5DB; flex: 0 0 auto; margin-top: 6px; }
.notif-body { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.notif-body .muted { font-weight: 400; }
.notif-hide { flex: 0 0 auto; border: none; background: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 2px 4px; }
/* ---- invite link row ---- */
.invite-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.invite-row input { flex: 1; min-width: 0; }
.invite-share a { text-decoration: none; text-align: center; }
/* ---- invite banner on the guest landing (M3, v71) ---- */
.invite-banner { background: #F7F0E6; border: 1px solid #BFDBFE; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.invite-banner p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
/* ---- unverified-email banner on the feed (M1, v71) ---- */
.verify-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #FEF3C7; border: 1px solid #FCD34D; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.verify-banner-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
/* ---- feedback count badge on the sidebar button (M22, v71) ---- */
.side-badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
/* Red-dot notification on admin menu buttons (v72): a section with
   something new shows a small solid red dot at the right end of its
   menu button, in both the sidebar submenu and the admin panel
   submenu. The dot is a ::after on the .admin-dot class (not a child
   element), so label rewrites — e.g. the feedback badge's
   textContent update — cannot remove it. The red is signal red on
   purpose, not the brown --red theme color; the white ring keeps it
   visible on the dark active state too. */
.admin-dot::after {
  content: "";
  margin-left: auto;
  flex: 0 0 auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #DC2626;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}
/* ---- composer photo preview (M11, v71) ---- */
#photoPreview { margin: 8px 0; }
#photoPreview img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; margin-bottom: 8px; }
/* ---- sidebar profile name (truncates if long) ---- */
#sideProfileName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-logo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--red); color: var(--on-theme); font-weight: 800;
}
.location-badge {
  border: 1px solid var(--line); background: var(--red-pale); color: var(--theme-ink);
  border-radius: 999px; padding: 6px 10px; font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px; min-width: 0;
  white-space: nowrap;
  cursor: pointer;
}
/* The city name may truncate on narrow screens, but the weather
   (temperature) never does — it is always fully visible. */
#locationBadgeText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Weather next to the location (Open-Meteo, °F) — a real button: tap it
   for the hourly forecast. Smaller type so the temperature fits on
   narrow phones (iPhone 15 Pro cut it off at 13px). */
.weather-badge {
  flex: 0 0 auto; white-space: nowrap;
  font-weight: 600; font-size: 12px;
  background: none; border: none; padding: 0; margin: 0;
  color: inherit; font-family: inherit; cursor: pointer;
}

.app-shell { max-width: 640px; margin: 0 auto; padding: 14px 14px 92px; }
.view[hidden] { display: none; }

/* ---- cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.hero-card { text-align: center; padding: 22px 16px; }
.hero-logo { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; object-fit: cover; display: block; }
.hero-mark {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 18px;
  background: var(--red); color: var(--on-theme); font-size: 36px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.hero-sub { font-size: 18px; font-weight: 600; }
.hero-note { color: var(--muted); font-size: 14px; }

/* ---- landing background (auth view only) ---- */
body:has(#view-auth:not([hidden])) {
  background-color: #2b1a0e;
  background-image: linear-gradient(rgba(24, 14, 6, 0.55), rgba(24, 14, 6, 0.55)), url("landing-bg.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
/* L18: background-attachment: fixed jumps on iOS scroll — scroll on phones. */
@media (max-width: 700px) {
  body:has(#view-auth:not([hidden])) { background-attachment: scroll; }
}
body:has(#view-auth:not([hidden])) .hero-card { color: #fff; }
body:has(#view-auth:not([hidden])) .hero-card h1 { color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.55); }
body:has(#view-auth:not([hidden])) .hero-sub { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.55); }
body:has(#view-auth:not([hidden])) .hero-note { color: rgba(255,255,255,.88); text-shadow: 0 1px 6px rgba(0,0,0,.55); }
body:has(#view-auth:not([hidden])) .landing-features h2 { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.55); }
body:has(#view-auth:not([hidden])) .app-footer { color: rgba(255,255,255,.75); text-shadow: 0 1px 6px rgba(0,0,0,.55); }
.hero-free {
  display: inline-block;
  background: #D4A017;
  /* L1: dark text on gold (~7:1, WCAG AA) — white on gold was ~2:1. */
  color: #2B1A0E;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 10px 0 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

/* ---- landing footer links (guests): About / Privacy / Terms / Help ---- */
.landing-links { text-align: center; margin: 2px auto 18px; }
.landing-links .link-btn { display: inline-block; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.55); padding: 4px 6px; margin: 0; font-size: 13px; }
.landing-links-sep { color: rgba(255,255,255,.7); }

/* ---- landing features (below the login card) ---- */
.landing-features { max-width: 640px; margin: 0 auto 14px; padding: 4px 6px; text-align: left; }
.landing-features h2 { font-size: 18px; margin: 6px 0 10px; text-align: center; }
.landing-features ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.landing-features li {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px 14px; font-size: 14px; line-height: 1.45;
}
.landing-features li strong { display: block; font-size: 15px; margin-bottom: 2px; }
@media (min-width: 560px) {
  .landing-features ul { grid-template-columns: 1fr 1fr; }
}

/* ---- landing hero: side images + centered login ---- */
.landing-hero { display: grid; gap: 14px; }
/* L19: on phones the login card comes first — the promo panels move
   below it (DOM order is promo, login, promo). */
@media (max-width: 899px) {
  .landing-hero .auth-card { order: -1; }
}
.landing-hero .auth-card { margin-bottom: 0; }
.landing-promo {
  color: #fff;
  background: rgba(24, 14, 6, 0.45);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  padding: 18px 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.landing-promo h2 { color: #fff; font-size: 20px; margin: 0 0 6px; }
.landing-promo p { color: rgba(255,255,255,.92); font-size: 14px; line-height: 1.5; margin: 0; }
.landing-promo .landing-biz { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.22); font-weight: 600; }
@media (min-width: 900px) {
  .app-shell:has(#view-auth:not([hidden])) { max-width: 1440px; }
  .app-shell:has(#view-auth:not([hidden])) .landing-hero { grid-template-columns: 1fr 400px 1fr; gap: 24px; align-items: center; }
  .app-shell:has(#view-auth:not([hidden])) .landing-features { max-width: none; }
}
@media (min-width: 1100px) {
  .app-shell:has(#view-auth:not([hidden])) .landing-features ul { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1000px) {
  /* Auth view: the sidebars are hidden, so collapse the 3-column grid
     to one wide column — otherwise the center track caps the page at
     640px and the shell max-width above has no effect. */
  .desktop-layout:has(#view-auth:not([hidden])) {
    grid-template-columns: minmax(0, 1440px);
    max-width: 1440px;
  }
  .desktop-layout:has(#view-auth:not([hidden])) .app-shell { grid-column: 1; }
}
.muted { color: var(--muted); }
.tiny { font-size: 13px; }

/* ---- auth ---- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px; border: 1px solid var(--line); background: var(--red-pale);
  border-radius: 10px; font-weight: 700; font-size: 15px; color: var(--muted);
}
.tab.active { background: var(--red-light); border-color: var(--theme-ink); color: var(--red-dark); }
.field-label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.form-error { color: var(--danger); font-size: 14px; background: #FDECEA; border: 1px solid #F5C6C0; padding: 10px; border-radius: 10px; }
.form-error[hidden] { display: none; }
.btn {
  border: none; border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 600;
  min-height: 44px; cursor: pointer;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--red); color: var(--on-theme); }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-red { background: var(--red); color: var(--on-theme); }
.btn-red:hover { background: var(--red-dark); }
.btn-secondary { background: var(--red-light); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:disabled { opacity: .55; cursor: not-allowed; }
.btn-danger { background: #FDECEA; color: var(--danger); border: 1px solid #F5C6C0; }
.btn-google { background: #fff; border: 1px solid var(--line); margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-google svg { flex: none; }
/* v79: the Google logo's vertical alignment — was an inline style
   attribute; a class keeps the CSP free of 'unsafe-inline'. */
.google-btn-icon { vertical-align: middle; }
.link-btn { background: none; border: none; color: var(--theme-ink); font-weight: 600; padding: 10px; display: block; margin: 4px auto 0; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* ---- compact buttons (Profile + Settings): small pills, mobile-friendly ---- */
#view-profile .btn, #view-settings .btn, #view-settings-account .btn,
#view-settings-privacy .btn, #view-settings-notifications .btn,
#view-settings-text .btn, #detailModal .btn {
  padding: 8px 14px; font-size: 14px; min-height: 40px; border-radius: 999px;
}
/* Profile buttons size to their text — no stretched full-width rows. */
#view-profile .btn-row { justify-content: flex-start; }
#view-profile .btn-row .btn { flex: 0 0 auto; }
/* ---- v71: compact buttons — no more big long buttons ---- */
/* Small buttons: size to their label, never stretch. */
.btn.btn-small {
  padding: 6px 12px; font-size: 13px; min-height: 32px;
  flex: 0 0 auto; white-space: nowrap;
}
/* Icon-only buttons: fixed square, centred glyph. */
.btn.btn-icon {
  width: 34px; height: 34px; min-height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex: 0 0 auto; border-radius: 50%;
}
/* Admin panels: buttons size to their label, never stretch full-width. */
.admin-panel .btn-row { justify-content: flex-start; }
.admin-panel .btn-row .btn { flex: 0 0 auto; }
/* Admin list rows: action buttons (View / Delete / Approve / Resolve …) compact. */
.admin-report-row .btn, .admin-user-row .btn, .feedback-row .btn,
.news-admin-row .btn, .ad-slot .btn {
  padding: 6px 12px; font-size: 13px; min-height: 32px; flex: 0 0 auto;
}
/* Inline input + icon buttons (banned words). */
.input-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.input-row input { flex: 1; min-width: 0; }
/* Banned-word tags: chips side by side, each with a small ×. */
.word-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.word-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--red-pale); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 4px 3px 10px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.word-tag .tag-x {
  border: none; background: none; color: var(--ink);
  font-size: 15px; line-height: 1; padding: 0 4px; cursor: pointer;
}
.word-tag .tag-x:active { color: var(--danger); }
/* Bio field + save button side by side. */
.bio-row { display: flex; gap: 8px; align-items: flex-start; }
.bio-row textarea { flex: 1; min-width: 0; }
#view-profile .bio-row .btn { flex: 0 0 auto; margin-top: 2px; padding: 6px 12px; font-size: 13px; min-height: 32px; }
/* Circular back button, top-left of a view — like the bell / send
   buttons: a real round button, with the chevron dead-centre (SVG,
   so it cannot drift off-centre the way a text arrow can). */
.btn-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}
.btn-back:active { background: var(--red-pale); }
.btn-back .ic { display: block; }
/* Inline link-style button (used inside muted text). */
.link-btn {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--red); font-size: inherit; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}
/* Leave TapNeighbor card — calm, not a scary red box. */
.leave-card { border: 1px solid #F5C6C0; }
/* Feedback & Help: native accordion topics. */
.help-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.help-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.help-item summary { font-weight: 700; cursor: pointer; list-style: none; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "›"; float: right; color: var(--muted); }
.help-item[open ] summary::after { content: "⌄"; }
.help-item p { margin: 8px 0 0; color: var(--ink); font-size: 14px; line-height: 1.5; }
/* Admin feedback inbox rows. */
.feedback-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.feedback-row .feedback-meta { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.feedback-row .feedback-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.feedback-row.resolved { opacity: .6; }
/* Inline comment edit (own comments): textarea + Save / Cancel. */
.comment-edit textarea { width: 100%; margin-top: 4px; }
.comment-edit .btn-row { margin-top: 6px; }

/* ---- onboarding ---- */
.help-card p { font-size: 14px; }

/* ---- feed: main tabs (Find a Handyman / Community) ---- */
.feed-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.feed-tab {
  flex: 1; padding: 12px 8px; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; font-weight: 800; font-size: 15px; color: var(--muted);
}
.feed-tab.active { background: var(--red); border-color: var(--red); color: var(--on-theme); }
.feed-tab .tab-sub { display: block; font-size: 12px; font-weight: 600; opacity: .85; }

/* ---- feed controls ---- */
/* ---- top search / scope / meta: compact, small fonts ---- */
.search-row { display: flex; gap: 8px; margin-bottom: 6px; }
.search-row input { flex: 1; min-width: 0; font-size: 16px; padding: 7px 10px; }
.search-row .btn { white-space: nowrap; }
/* Feed top: scope + meta only (v59 — the avatar, search and sort moved
   into the topbar). The meta sits at the right. */
.feed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.feed-top .feed-meta { margin-left: auto; white-space: nowrap; }
/* Small round profile avatar at the left of the feed search —
   tap it to open your profile. */
.feed-avatar {
  flex: 0 0 auto; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; overflow: hidden;
  background: var(--red-pale); color: var(--red-dark);
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.feed-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
#feedAvatarInner { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
/* Post visibility: two side-by-side radio pills instead of a
   dropdown. The radio itself is hidden; the label is the pill. */
.visibility-pills { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.vis-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap;
  cursor: pointer; margin: 0;
}
.vis-pill input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.vis-pill:has(input:checked) { border-color: var(--red); background: var(--red-light); color: var(--red-dark); }
/* The native file input is never shown — our own button opens it. */
#postPhoto { display: none; }
/* ---- composer: two small icon buttons floating at the bottom-right
   of the text area (photo + send), nothing else down there ---- */
.post-body-wrap { position: relative; }
.post-body-wrap textarea { padding-bottom: 54px; }
.post-body-actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.composer-icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 17px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); padding: 0;
}
.composer-icon-btn:disabled { opacity: .5; cursor: wait; }
/* v74: the ➤ publish button is back for NEW posts (Save is edit-only).
   Round and filled so it reads as the send action next to the photo button. */
.composer-icon-btn.composer-send { background: var(--red); border-color: var(--red); color: var(--on-theme); font-size: 20px; }
/* v74: likers are small round avatars, not a bare-number circle.
   Up to 3 avatars overlap; "+N" counts the rest. Tapping opens the
   same "Liked by" list. Nothing renders when a post has no avatars. */
.liker-avatars { display: inline-flex; align-items: center; background: none; border: none; cursor: pointer; padding: 2px 4px; }
.liker-avatar, .liker-avatar-img { width: 24px; height: 24px; border-radius: 50%; margin-left: -7px; border: 2px solid #fff; flex: 0 0 auto; }
.liker-avatar:first-child, .liker-avatar-img:first-child { margin-left: 0; }
.liker-avatar { background: var(--red-pale); color: var(--red-dark); font-weight: 700; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }
.liker-avatar-img { object-fit: cover; }
.liker-more { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 5px; }
/* Profile buttons size to their text — no stretched full-width rows. */
#view-user-profile .btn-row { justify-content: flex-start; }
#view-user-profile .btn-row .btn { flex: 0 0 auto; }
/* Gender selects are not full-width — they size to their content. */
#profileGenderSelect, #onboardGender { width: auto; max-width: 220px; }
.scope-toggle { display: flex; background: #E0CDB4; border-radius: 999px; padding: 4px; margin-bottom: 10px; }
.scope-btn { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); }
.scope-btn.active { background: #fff; color: var(--red-dark); box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 13px; font-size: 14px; font-weight: 600;
}
.chip.active { background: var(--red); border-color: var(--red); color: var(--on-theme); }
.chip.red.active { background: var(--red); border-color: var(--red); }
.feed-meta { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }

/* ---- post-type picker in the create modal ---- */
.type-picker { display: flex; gap: 10px; margin: 6px 0 4px; }
.type-btn {
  flex: 1; border: 2px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 8px; text-align: left;
}
.type-btn strong { display: block; font-size: 15px; }
.type-btn span { font-size: 12px; color: var(--muted); }
.type-btn.active { border-color: var(--theme-ink); background: var(--red-light); }
.type-btn.active.community { border-color: var(--theme-ink); background: var(--red-light); }

/* ---- feed cards ---- */
/* v75: a clear gap between cards — they used to sit stuck together
   (the news list had no gap at all). */
.feed-list { display: flex; flex-direction: column; gap: 16px; }
#newsList { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
#newsList:empty { display: none; margin-bottom: 0; }
/* ---- post cards: compact (about a quarter of the old size) ---- */
/* The box is exactly as big as its content (no min-height). Text-only
   posts hug the text. Photos are full-width, edge to edge (they bleed
   through the card padding, like the reference) — a single photo keeps
   its natural ratio; a collage is 1 big on top + 2 below. */
.post-card {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px 10px; cursor: pointer;
}
.post-head { display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.post-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--red-pale); color: var(--red-dark); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.post-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.post-head-text p { margin: 0; }
.post-author { font-weight: 700; font-size: 13px; }
.post-head-text .post-meta { font-size: 11px; }
.post-card h3 { margin: 2px 0 4px; font-size: 15px; line-height: 1.3; }
.post-meta { font-size: 12px; color: var(--muted); }
.post-card .post-body { margin: 2px 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.see-more { color: var(--theme-ink); font-weight: 600; cursor: pointer; }
/* Single photo: full-width, edge to edge, natural ratio. */
.post-img { display: block; width: calc(100% + 20px); max-height: 600px; object-fit: cover; margin: 6px -10px 0; border-radius: 0; }
/* ---- photo collage (2–3 photos), edge to edge ---- */
.post-collage { display: grid; gap: 2px; width: calc(100% + 20px); margin: 6px -10px 0; }
.post-collage img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; display: block; }
.collage-2 { grid-template-columns: 1fr 1fr; }
.collage-2 img { aspect-ratio: 1 / 1; }
/* 3 photos: 1 big on top (full width) + 2 below, like the reference. */
.collage-3 { grid-template-columns: 1fr 1fr; }
.collage-3 img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.collage-3 img:not(:first-child) { aspect-ratio: 1 / 1; }
/* In the post detail the collage stays inside the modal (rounded). */
.collage-large { width: 100%; margin: 8px 0; }
.collage-large img { border-radius: 8px; }
.detail-img { display: block; width: 100%; border-radius: 10px; margin: 8px 0; }
/* ---- "···" menu in the post header (Edit/Delete or Report/Block) ---- */
.post-menu-btn {
  position: absolute; top: 6px; right: 8px; z-index: 4;
  border: none; background: transparent; font-size: 18px; font-weight: 700;
  line-height: 1; padding: 4px 6px; cursor: pointer; color: var(--muted);
  border-radius: 8px;
  /* H16: 44px touch target (Apple minimum) for the "···" menu. */
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.post-menu-btn:hover { background: #f3efe9; color: var(--ink); }
.post-menu {
  position: absolute; top: 36px; right: 8px; z-index: 6;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); min-width: 170px; padding: 4px;
}
.post-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--ink);
  cursor: pointer; border-radius: 8px;
}
.post-menu button:hover { background: #f3efe9; }
.post-menu button.danger { color: var(--danger); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--red-light); color: var(--red-dark);
}
.post-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.action-btn[data-action="share"] { margin-left: auto; }
.action-btn {
  border: 1px solid var(--line); background: #F9FAFB; border-radius: 999px;
  padding: 5px 9px; font-size: 12px; font-weight: 600; color: var(--ink);
  /* H16: 44px touch target (Apple minimum) for post action buttons. */
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.action-btn.liked { background: var(--red); border-color: var(--red); color: var(--on-theme); }
.action-btn.danger { color: var(--danger); }
.action-btn.offer { background: var(--red); border-color: var(--red); color: var(--on-theme); }
.empty-state { text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; }
.empty-emoji { font-size: 40px; margin: 0; }

/* ---- bottom nav ---- */
/* ---- floating action button (create post): bottom-right, floats
   above the feed — posts scroll underneath it. Hidden on desktop
   (≥700px), where the sidebar's "New post" does the job. ---- */
.fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: 56px; height: 56px; border: none; border-radius: 50%;
  background: var(--red); color: var(--on-theme);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(194, 112, 61, .45);
  cursor: pointer;
}
.fab:active { transform: scale(0.96); }
.fab .ic { display: block; }

/* ---- modals (bottom sheets on mobile) ---- */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal[hidden] { display: none; }
/* Confirmation dialogs (Pause post, generic confirm, delete) open above
   other modals — e.g. Pause post from the post detail. With the same
   z-index they would sit behind the detail modal, which comes later in
   the DOM, and only appear after the post is closed. */
#deactivateModal, #confirmModal, #deleteModal, #likersModal { z-index: 70; }
.modal-card {
  background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  /* L21: bottom padding clears the iPhone home indicator (34px). */
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px));
}
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-small { max-width: 420px; }
#confirmText { color: var(--muted); margin: 6px 0 16px; }
.icon-btn { border: none; background: var(--red-light); width: 36px; height: 36px; border-radius: 50%; font-size: 16px; flex: 0 0 auto; }
.comment-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
/* Facebook-style comment: round initial avatar + grey bubble + a
   small action row under it (Reply · time, delete at the far right).
   Compact on purpose — no boxes, no big buttons. */
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment.reply { margin-left: 40px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--red-pale); color: var(--red-dark); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.comment-main { flex: 1; min-width: 0; }
.comment-bubble { background: #F0F2F5; border-radius: 16px; padding: 8px 12px; }
.comment-name { font-weight: 700; font-size: 13px; margin: 0; }
.comment-body { margin: 0; font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.reply-to { font-size: 12px; color: var(--muted); margin: 0 0 2px 12px; }
.comment-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin: 3px 0 0 12px; }
.comment-action { background: none; border: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.comment-action:hover { color: var(--ink); }
.icon-btn-sm { border: none; background: transparent; font-size: 13px; line-height: 1; padding: 2px 4px; cursor: pointer; color: var(--muted);
  /* H16: 44px touch target for the comment delete "×". */
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; }
.icon-btn-sm:hover { color: var(--theme-ink); }
.reply-target { background: var(--red-pale); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 8px 0; }
.link-btn { background: none; border: none; color: var(--red); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 0 0; }

/* ---- profile head: big round avatar ---- */
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.profile-head-text p { margin: 2px 0; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--red-pale); color: var(--red-dark); font-weight: 700; font-size: 32px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- profile photo: small actions on the round photo ---- */
.profile-avatar-wrap { position: relative; width: 96px; height: 96px; flex: 0 0 auto; }
.avatar-action { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 14px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; padding: 0; }
.avatar-change { right: -4px; bottom: -4px; }
.avatar-delete { right: -4px; top: -4px; color: var(--danger); }

/* ---- photo cropper: square stage, drag + zoom ---- */
.crop-stage { width: 280px; height: 280px; max-width: 100%; margin: 12px auto; position: relative; overflow: hidden; border-radius: 12px; background: #111; touch-action: none; }
.crop-stage img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
input[type="range"] { width: 100%; padding: 0; border: none; background: transparent; }

/* ---- comment avatar photo ---- */
.comment-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
/* Who-liked list (v60): one row per liker, name opens their profile. */
.liker-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.liker-row:last-child { border-bottom: none; }
.liker-name { background: none; border: none; color: var(--theme-ink); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 0; text-align: left; }
/* The like count next to the heart is its own button (opens the list). */
.like-count { font-weight: 700; }

/* ---- feed scope + followed neighborhoods ---- */
.followed-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.followed-row:last-child { border-bottom: none; }
.followed-row div { min-width: 0; }

/* ---- email verification badge ---- */
.verified-badge { display: inline-block; background: var(--red); color: var(--on-theme); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.unverified-badge { display: inline-block; background: #fff; color: var(--muted); font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

/* ---- admin panel ---- */
.admin-stats { font-size: 14px; }
/* M24 (v71): the tappable orphan count inside the admin stats stays
   inline with the rest of the stats line. */
.admin-stats .link-btn { display: inline; padding: 0; margin: 0; font-size: 14px; }
/* M32 (v71): one-time "Add to Home Screen" card on the feed. */
.install-card { background: var(--red-pale); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.install-card p { margin: 0 0 8px; font-size: 14px; }
.install-card .btn-row { margin-top: 0; }
.admin-stats strong { font-size: 16px; }
.admin-user-row, .admin-report-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-user-row:last-child, .admin-report-row:last-child { border-bottom: none; }
.admin-user-row > div, .admin-report-row > div { min-width: 0; overflow-wrap: anywhere; }
.admin-user-row > span, .admin-report-row > span { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.role-badge { display: inline-block; background: var(--red-pale); color: var(--red-dark); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; margin-top: 4px; }

/* ---- admin cleanup list: orphaned Cloudinary photos ---- */
.orphan-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.orphan-row img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.orphan-row div { flex: 1; min-width: 0; }
.orphan-row p { margin: 0 0 2px; overflow-wrap: anywhere; }

/* ---- comment input: textarea + round send button ---- */
.comment-input-row { display: flex; gap: 8px; align-items: flex-end; }
.comment-input-row textarea { flex: 1 1 auto; min-width: 0; width: auto; }
.send-btn { width: 44px; height: 44px; flex: 0 0 auto; border: none; border-radius: 50%; background: var(--red); color: var(--on-theme); font-size: 17px; line-height: 1; cursor: pointer; }
.send-btn:disabled { opacity: .5; }
/* v87: emoji picker for the comment box and the post composer. */
.emoji-toggle { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.emoji-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-top: 8px; max-height: 180px; overflow-y: auto; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.emoji-panel[hidden] { display: none; }
.emoji-panel button { background: none; border: none; font-size: 22px; line-height: 1; padding: 6px 2px; cursor: pointer; border-radius: 8px; }
.emoji-panel button:hover, .emoji-panel button:focus-visible { background: var(--red-pale); outline: none; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px); text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.toast[hidden] { display: none; }

/* ---- desktop ---- */
@media (min-width: 700px) {
  .modal { align-items: center; padding: 24px; }
  .modal-card { border-radius: 18px; }
  .app-shell { padding-bottom: 92px; }
  .topbar { max-width: 640px; margin: 0 auto; }
}

/* ---- Desktop 3-column layout (≥1000px): Nextdoor-like, TapNeighbor's own design ---- */
/* Left sidebar + center feed + right rail. The mobile bottom nav is
   replaced by the sidebar on desktop. The asides are hidden (via the
   hidden attribute, set in showView) whenever the app itself is not
   shown (auth / onboarding), so the grid collapses to one column. */
.desktop-sidebar, .desktop-rail { display: none; }
@media (min-width: 1000px) {
  .desktop-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 640px) 300px;
    /* v75: the sidebar sits further from the feed (was 24px). */
    gap: 40px; justify-content: center; align-items: start;
    max-width: 1240px; margin: 0 auto; padding: 0 16px;
  }
  .app-shell { max-width: none; margin: 0; padding: 14px 0 96px; grid-column: 2; }
  /* v75: the top bar is centered on the same 1240px as the layout —
     it used to be left-aligned at max-width, so the logo sat 100px
     left of the sidebar on wide screens and the page margins looked
     uneven. */
  .topbar { max-width: 1240px; margin-left: auto; margin-right: auto; }
  .fab { display: none; }
  #desktopSidebar:not([hidden]) { display: flex; flex-direction: column; min-height: calc(100vh - 96px); }
  #desktopRail:not([hidden]) { display: block; }
  .desktop-sidebar { grid-column: 1; }
  .desktop-rail { grid-column: 3; }
  /* The right rail is FIXED, not sticky: it never moves while the
     feed scrolls. It sits where the third grid column would be. */
  .desktop-sidebar { position: sticky; top: 76px; }
  .desktop-rail {
    position: fixed; top: 76px;
    right: max(16px, calc((100vw - 1240px) / 2 + 16px));
    width: 300px; margin-top: 28px;
    max-height: calc(100vh - 96px); overflow-y: auto;
  }
  #adRailList .rail-card { margin-bottom: 12px; }
  /* Ads start a bit lower than the top of the rail. */
  .desktop-rail { margin-top: 28px; }
  /* Desktop feed top: search (shrunk) + sort sit side by side on
     one row. The search flexes and shrinks (min-width: 0), so the
     sort can never be squeezed on top of it again. */
  .feed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
  .feed-top .search-row { flex: 1 1 200px; min-width: 0; margin-bottom: 0; }
    .feed-top   .feed-top .sort-wrap { margin: 0; flex: 0 0 auto; }
  .feed-top .feed-meta { margin: 0 0 0 auto; white-space: nowrap; flex: 0 0 auto; }
  .rail-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
  }
  .rail-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
  .rail-name { font-size: 18px; font-weight: 700; margin: 0 0 2px; }
  .rail-text { font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
}

/* ---- onboarding wizard: one question per step ---- */
.steps { display: flex; gap: 6px; margin: 2px 0 16px; }
.step-dot {
  flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted);
  padding-top: 10px; position: relative;
}
.step-dot::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: 99px; background: #E5E7EB;
}
.step-dot.active { color: var(--red-dark); }
.step-dot.active::before { background: var(--theme-ink); }
.step-dot.done { color: var(--red-dark); }
.step-dot.done::before { background: var(--theme-ink); }
.name-row { display: flex; gap: 10px; }
.name-row > div { flex: 1; min-width: 0; }

/* No horizontal overflow at 390px: nothing here may exceed the viewport. */

/* ---- settings: card rows with red icon chips (own design) ---- */
.settings-list { display: flex; flex-direction: column; }
.setting-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: #fff; border: none; border-bottom: 1px solid var(--line);
  padding: 13px 2px; text-align: left; cursor: pointer;
}
.setting-row:last-child { border-bottom: none; }
.setting-row:active { background: var(--red-pale); }

/* ---- page footer (copyright, bottom of the page) ---- */
.app-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0 6px; }

/* ---- public profile + bio ---- */
.user-bio { white-space: pre-wrap; margin: 12px 0 4px; }
#profileBioInput { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; resize: vertical; }
.post-head[data-profile-uid], .comment-avatar[data-profile-uid], .comment-avatar-img[data-profile-uid], .comment-name[data-profile-uid] { cursor: pointer; }
.setting-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  background: var(--theme-ink); color: var(--on-theme); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.setting-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.setting-text strong { font-size: 15px; color: var(--ink); }
.setting-chev { color: var(--muted); font-size: 22px; line-height: 1; }
.setting-check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: 15px; cursor: pointer;
}
.setting-check:last-of-type { border-bottom: none; }
.setting-check input { width: 20px; height: 20px; accent-color: var(--red); flex: 0 0 auto; }
.settings-text { font-size: 15px; line-height: 1.6; color: var(--ink); }
.settings-text p { margin: 0 0 12px; }

/* ---- hourly weather graph (top-bar temperature modal) ---- */
/* Horizontally scrollable graph: hours + icons + rain % on top,
   a temperature curve (SVG) below. No 48-hour link. */
.weather-graph { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
/* v79: a subtle right-edge fade hints the strip scrolls — the last
   hour used to look cut off with no clue there was more. */
.weather-graph { -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%); }
.weather-graph-inner { position: relative; min-width: 100%; }
.weather-cols { display: flex; }
.weather-col { flex: 0 0 64px; min-width: 64px; text-align: center; padding-top: 4px; }
.weather-col .wh-hour { font-size: 13px; font-weight: 600; white-space: nowrap; }
.weather-col .wh-icon { font-size: 20px; line-height: 1.4; }
.weather-col .wh-precip { font-size: 12px; color: var(--muted); white-space: nowrap; }
.weather-graph svg { display: block; }
.weather-graph .wg-temp { font-size: 13px; font-weight: 700; fill: var(--ink); }

/* ---- TapNeighbor News (v51) ---- */
.gold-check { display: inline-flex; vertical-align: -2px; }
.gold-check svg { width: 16px; height: 16px; display: block; }
.news-card { border-left: 3px solid #D4A017; }
.news-comments { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.news-comments .comment-list { margin: 4px 0 8px; }
.news-admin-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.news-admin-row .btn-row { margin-top: 10px; align-items: center; }
.news-admin-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--red); }

/* ---- v71 LOW findings (L3-L34) ---- */
/* L7: the brand is now a <button> (Home) — reset button chrome. */
button.brand { background: none; border: none; padding: 0; cursor: pointer; color: inherit; font-family: inherit; }
/* L5: password strength indicator. */
.password-strength.weak { color: #B91C1C; }
.password-strength.medium { color: #92400E; }
.password-strength.strong { color: #166534; }
/* L13: character counters under the composer / comment inputs. */
.char-count { text-align: right; margin: 4px 0 0; }
/* L33: new-version notice banner. */
.version-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; align-items: center; gap: 10px; background: #6B4226; color: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 4px 18px rgba(0,0,0,.25); font-size: 14px; }
.version-banner span { flex: 1; }
.version-banner .btn { flex-shrink: 0; }
.version-banner .icon-btn { color: #fff; flex-shrink: 0; }

/* ---- searchable location combobox (v72) ---- */
/* Each cascade level is a text input + dropdown list. The real value
   still lives in the hidden <select>; the input only filters. */
.combo { position: relative; z-index: 1; }
/* v79: while a dropdown is open its field must paint above the
   following label/field — without this the suggestions list merged
   visually with the County label below it. */
.combo:focus-within { z-index: 60; }
.combo-input { margin: 0; }
.combo-input:disabled { background: #f3efe9; color: #8a7a6a; cursor: not-allowed; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); max-height: 240px; overflow-y: auto; }
.combo-list[hidden] { display: none; }
.combo-option { display: block; width: 100%; text-align: left; background: none; border: none; padding: 11px 12px; font-size: 16px; color: var(--ink); cursor: pointer; }
.combo-option:hover, .combo-option.active { background: var(--red-pale); }
.combo-empty { padding: 11px 12px; font-size: 15px; color: #8a7a6a; }
.combo-more { padding: 8px 12px; font-size: 13px; color: #8a7a6a; border-top: 1px solid var(--line); }

/* v81: the tablet/desktop FAB-hide rules above are overridden by the
   base .fab rule (same specificity, later in the file) — re-assert
   them here so the FAB stays hidden on tablet and desktop. */
@media (min-width: 700px) {
  .fab { display: none; }
}
