:root {
  --teal: #1C7C74;
  --teal-deep: #124F4A;
  --teal-glow: rgba(28, 124, 116, 0.22);
  --amber: #E8A33D;
  --amber-deep: #C97F1E;
  --ink: #241F1B;
  --ink-soft: #5B534A;
  --sand: #F3ECE0;
  --sand-deep: #E4D8C3;
  --white: #FFFDF9;
  --line: rgba(36, 31, 27, 0.12);
  --danger: #C97878;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* ---- Shape scale ----
     One family of corner radii, used everywhere instead of one-off values.
     xs/sm = small controls (inputs, filter chips, icon buttons)
     md    = the default "room" radius: cards, buttons, modals
     lg    = large containers (the departure board, page-level panels)
     pill  = fully-rounded (primary/secondary CTAs, badges, chips) */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --radius: var(--radius-md); /* legacy alias, kept for any rule still referencing it */

  /* ---- Elevation scale ----
     Every shadow on the site is one of these three, chosen by how "raised"
     an element is, not reinvented per component. */
  --shadow-sm: 0 6px 18px rgba(36, 31, 27, 0.08);
  --shadow-md: 0 12px 32px rgba(18, 79, 74, 0.14);
  --shadow-lg: 0 20px 48px rgba(18, 79, 74, 0.18);
  --shadow: var(--shadow-md); /* legacy alias */

  /* ---- Borders & motion ---- */
  --border: 1px solid var(--line);
  --border-teal: 1px solid rgba(28, 124, 116, 0.22);
  --transition-fast: 0.15s ease;
  --transition-slow: 0.25s ease;

  /* ---- Spacing scale for section rhythm ---- */
  --space-xs: 8px;
  --space-sm: 14px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 72px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--sand);
  color: var(--ink);
  line-height: 1.5;
  position: relative;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Shared page layout. */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: inherit; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin: 0 0 12px;
}

/* Sticky site header. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 236, 224, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 68px;
}

/* Nudged slightly left of dead-center — but only on the home view. Every
   other page (Post, Search, area listings, My Listings, and the standalone
   Terms/Privacy pages) shows a back arrow fixed top-left, right next to
   where a left-shifted logo would sit — so the header centers itself there
   instead, controlled by the 'view-home' class app.js toggles on <body>.
   terms.html/privacy.html simply never carry the class, so they're
   centered by default without needing any JS. */
body.view-home .topbar-inner .brand {
  transform: translateX(-28px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  font-family: var(--font-mono);
  font-weight: 600;
  /* kept for compatibility with older mark usage; logo uses .brand-logo now */
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}
.brand-logo svg {
  color: var(--teal);
  width: 34px;
  height: 34px;
  display: block;
}

/* Review overlay (review-veil) */
.review-veil {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.36);
  z-index: 60;
}
.review-veil.open {
  display: flex;
}
.review-modal {
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  max-width: 520px;
  width: calc(100% - 48px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.18);
}
.review-list { margin: 12px 0 16px; }
.review-row { display:flex; gap:12px; margin:8px 0; align-items: baseline; }
.review-row dt {
  width: 100px;
  flex: 0 0 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.review-row dd {
  margin: 0;
  color: var(--amber-deep);
  font-weight: 600;
  font-size: 14px;
}

/* Description gets its own full-width paragraph below its label, instead
   of being squeezed into the same narrow-label/inline-value row as the
   short fields above it. */
.review-row--stack { flex-direction: column; gap: 4px; }
.review-row--stack dt { width: auto; flex: none; }
.review-row--stack dd {
  color: var(--ink);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

/* Review/delete modal actions use the shared .btn-sm modifier (see the
   button family above) so they stay the same pill shape as every other
   button on the site, just sized for a modal instead of the hero. */
.review-actions { display:flex; gap:12px; justify-content:flex-end; margin-top:16px; }

/* Area overlay */
.area-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.42);
  z-index: 70;
  padding: 24px;
}
.area-overlay[aria-hidden="false"] { display:flex; }
.area-overlay-card {
  background: var(--white);
  width: min(1100px, 96%);
  max-height: 86vh;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display:flex; flex-direction:column;
}
.area-overlay-card { position: relative; }
.area-overlay-head { display:flex; justify-content:center; align-items:center; padding:16px 20px; border-bottom: var(--border); }
.overlay-title { display:flex; align-items:center; gap:12px; justify-content:center; width:100%; }
.overlay-area-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.overlay-title .btn { padding:10px 14px; }
.brand-like { pointer-events:none; }
.overlay-search-input { padding:10px 12px; border-radius: var(--radius-sm); border: var(--border); width:320px; }
.close-btn { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius: var(--radius-sm); }
.close-btn svg { display:block; }
.visually-hidden { position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }
.area-overlay-controls { display:flex; gap:12px; padding:12px 20px; align-items:center; }
.type-filters { display:flex; gap:8px; flex-wrap: wrap; }
/* .type-filter is now a .btn-chip in markup-intent; kept as a selector
   alias so existing JS toggling `.active` still works unchanged. */
.type-filter { padding: 8px 14px; border-radius: var(--radius-pill); border: var(--border); background: var(--white); color: var(--ink-soft); font-family: var(--font-body); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast); }
.type-filter:hover { border-color: var(--teal); color: var(--teal-deep); }
.type-filter.active { background: var(--teal); color: var(--white); border-color: var(--teal-deep); box-shadow: var(--shadow-sm); }
.search-field { margin-left:auto; }
.search-field input { padding:10px 12px; border-radius: var(--radius-sm); border: var(--border); width:240px; }
.area-overlay-card .back-float { position: absolute; top: 12px; left: 12px; z-index: 80; width:34px; height:34px; }
.area-overlay-card .back-float svg { width: 14px; height: 14px; display:block; }
.area-overlay-body { display:flex; gap:16px; padding:16px; overflow:auto; }
.area-overlay-body { -webkit-overflow-scrolling: touch; }
.overlay-area-grid { width:320px; max-height:calc(86vh - 160px); overflow:auto; display:grid; grid-template-columns:1fr; gap:10px; padding-right:6px; }
.overlay-area-grid button.area-card { text-align:left; padding:12px; border-radius: var(--radius-sm); background:var(--white); border: var(--border); cursor:pointer; box-shadow: var(--shadow-sm); }
.overlay-area-grid button.area-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

@media (max-width: 640px) {
  .overlay-area-grid {
    width: min(280px, 44vw);
    max-height: calc(40vh);
  }
  .overlay-search-input {
    width: 100%;
    max-width: none;
  }

  /* Stack the back arrow above the header/search input on small screens */
  .area-overlay-head {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    /* make room for the absolute back button */
    padding: 80px 16px 12px 16px;
  }
  .area-overlay-card .back-float {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    margin: 0;
    align-self: auto;
    box-shadow: var(--shadow-sm);
    z-index: 90;
  }
  .overlay-search-input { margin-top: 8px; position: relative; z-index: 1; }
  .overlay-title {
    justify-content: center;
  }
}
.overlay-results { flex:1; max-height:calc(86vh - 160px); overflow:auto; padding-right:8px; }

/* Listing card: a self-contained floating panel — even border and shadow
   on every side, no accent spine, so it reads as its own section rather
   than being anchored to the page. */
.listing-card {
  background:var(--white);
  border-radius:var(--radius-md);
  padding:14px;
  margin-bottom:16px;
  box-shadow:0 10px 36px rgba(28,124,116,0.08);
  border:1px solid rgba(28,124,116,0.08);
  position: relative;
}
.listing-date { display:block; color:var(--teal); font-family:var(--font-mono); margin-bottom:6px; }
.listing-type { font-weight:400; color:var(--amber); display:block; margin-bottom:8px; }

/* A thin hairline (not the old drop-shadow "ridge") separates the free-text
   description from the structured fields below it. */
.listing-desc { color:var(--ink); margin-bottom:12px; padding-bottom:12px; border-bottom: 1px solid var(--line); }

/* ---- Footer: area/block on the left, rent right-aligned opposite them,
   WhatsApp number on its own line beneath. ---- */
.listing-footer { margin-top: 10px; }
.listing-footer-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
/* Area + block: normal (ink) text colour, distinguished from the
   description paragraph by weight rather than an accent colour. */
.listing-footer .listing-area,
.listing-footer .listing-block {
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
}
.listing-sep { color: var(--ink-soft); font-weight: 400; margin: 0 2px; }

/* Rent: right-aligned, no longer bold — a quiet amber accent instead of a
   heavy price tag. */
.listing-rent {
  color: var(--amber-deep);
  font-weight: 400;
  font-family: var(--font-mono);
  white-space: nowrap;
  margin-left: auto;
}

/* WhatsApp number: always underlined, on its own line below area/block/rent. */
.listing-phone {
  display: block;
  margin-top: 6px;
  color: var(--amber-deep);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}
.listing-phone:hover,
.listing-phone:focus {
  color: var(--amber);
}

.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-sub {
  font-style: italic;
  font-size: 11px;
  color: var(--ink-soft);
  margin-left: 48px;
}
/* ==== Button family ====
   Every clickable control on the site is either a .btn (full CTA), a
   .btn-sm (the same shape, scaled down for tight spaces like modals),
   or a .btn-chip (pill-shaped filter/tag toggle). All three share the
   same radius (pill), the same hover lift, and the same focus ring —
   that's the "inherited trait." Color/emphasis is the only thing that
   changes between primary and secondary variants. */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 26px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.btn:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 3px; }
.btn-icon { font-size: 16px; line-height: 1; }

.btn-primary {
  background: var(--amber);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--amber-deep); transform: translateY(-1px); }

.btn-secondary {
  background: var(--white);
  color: var(--teal-deep);
  border: 1.5px solid var(--teal);
}
.btn-secondary:hover { background: var(--teal); color: var(--white); transform: translateY(-1px); }

.btn-block { width: 100%; justify-content: center; margin-top: 6px; }

/* Compact variant: same family, same radius/hover language, sized for
   modals and inline actions instead of hero CTAs. */
.btn-sm {
  padding: 10px 20px;
  font-size: 14px;
  box-shadow: none;
}
.btn-sm.btn-primary:hover,
.btn-sm.btn-secondary:hover { box-shadow: none; }

/* Chip: pill-shaped toggle/tag button, used for type filters and other
   small actionable labels (report, edit, delete on My Listings). */
.btn-chip {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: var(--border);
  background: var(--white);
  color: var(--ink-soft);
  padding: 6px 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.btn-chip:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 2px; }
.btn-chip--teal { border-color: rgba(28, 124, 116, 0.4); color: var(--teal-deep); }
.btn-chip--teal:hover { background: var(--teal); color: var(--white); border-color: var(--teal-deep); }
.btn-chip--danger { border-color: rgba(201, 120, 120, 0.5); color: var(--danger); }
.btn-chip--danger:hover { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-chip--active { background: var(--teal); color: var(--white); border-color: var(--teal-deep); box-shadow: var(--shadow-sm); }

/* Icon-only square button (back arrow, close), shared corner radius with
   the rest of the "small controls" family (--radius-sm). */
.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-icon-only:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-icon-only:active { transform: translateY(0) scale(0.96); }
.btn-icon-only svg { display: block; }

/* Introductory page section. */
.hero { padding: 64px 0 88px; position: relative; z-index: 2; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: start;
}

h1 {
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.06;
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions--top { margin-bottom: 26px; }

.hero-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

/* Listing summary board. */
.board-frame {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 4px;
  box-shadow: var(--shadow-md);
  transform: rotate(0.4deg);
}

.board-head {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--amber);
}

.board-clock { color: var(--sand); }

.board {
  background: #16110E;
  border-radius: var(--radius-md);
  padding: 6px 0;
  margin: 0 4px 4px;
}

#boardRows {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  /* fades the last row so the cut-off reads as "more below", not a bug */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
}

.board-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1fr;
  gap: 8px;
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sand);
  border-bottom: 1px solid rgba(243, 236, 224, 0.06);
}

.board-row--head {
  color: var(--ink-soft);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(243, 236, 224, 0.14);
}

.board-row .flicker { display: inline-block; }

.status-open { color: #7FD4A8; }
.status-few { color: var(--amber); }
.status-full { color: var(--danger); }

.board-foot {
  padding: 10px 18px 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(243, 236, 224, 0.45);
}

@keyframes flickerChar {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.15; }
  98% { opacity: 0.7; }
}
.flicker span { animation: flickerChar 5.5s infinite; animation-delay: calc(var(--d) * 60ms); }

/* Autocomplete dropdown for search */
#searchAutocomplete {
  position: absolute;
  left: 24px;
  right: 24px;
  max-width: 640px;
  margin: 4px auto 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 36px rgba(18,79,74,0.08);
  z-index: 60;
  overflow: hidden;
}
.search-autocomplete .autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(36,31,27,0.04);
}
.search-autocomplete .autocomplete-item:last-child { border-bottom: none; }
.search-autocomplete .autocomplete-item:hover { background: rgba(28,124,116,0.04); }

/* Highlight matched tokens */
.listing-desc mark { background: #FFF1B8; color: inherit; padding: 0 2px; border-radius: 2px; }

/* Posting and search overview. */
.how { padding: 72px 0; border-top: 1px solid var(--line); }
.how h2 { font-size: 26px; margin-bottom: 32px; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

@media (min-width: 861px) {
  .how-card--search { margin-top: 64px; }
}

.how-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition:
    transform 2s ease-in-out,
    box-shadow 2s ease-in-out,
    border-color 2s ease-in-out;
}
@media (hover: hover) and (pointer: fine) {
  .how-card:hover { transform: translateY(-2px); }
}
.how-card:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 3px; }

.how-card--post.in-view {
  border-color: rgba(232, 163, 61, 0.32);
  box-shadow: 0 14px 30px rgba(232, 163, 61, 0.12);
  transform: scale(1.045);
}
.how-card--search.in-view {
  border-color: rgba(28, 124, 116, 0.28);
  box-shadow: 0 14px 30px rgba(28, 124, 116, 0.1);
  transform: scale(1.045);
}

.how-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  color: var(--teal);
  display: inline-block;
  margin-bottom: 10px;
}
.how-tag.tag-clicked { text-decoration: underline; text-underline-offset: 3px; }
.how-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}
.how-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* Area selector grid. */
.areas { padding: 72px 0 84px; background: var(--sand-deep); }
.areas-head { margin-bottom: 28px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.areas-head h2 { font-size: 26px; margin-bottom: 8px; }
.areas-head p { margin: 0; color: var(--ink-soft); }
.areas-scroll-hint { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }

.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
}

.area-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.area-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.area-card-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; display: block; }
.area-card-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }

/* Community information section. */
.community { padding: 84px 0; background: var(--teal); color: var(--white); text-align: center; position: relative; overflow: hidden; }
/* Large, faint echo of the brand mark's roofline/window shape — the same
   "window that shows you home" motif from the logo, scaled up behind the
   copy that's explicitly making the home/community pitch in words. */
.community-mark-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 480px;
  height: 480px;
  transform: translate(-50%, -50%);
  opacity: 0.07;
  pointer-events: none;
}
.community-inner { max-width: 620px; margin: 0 auto; position: relative; z-index: 1; }
.community-mark {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 14px;
}
.community h2 { font-size: 26px; margin-bottom: 14px; }
.community p { margin: 0; color: rgba(255,253,249,0.82); font-size: 15px; }

/* Site footer. */
.footer { padding: 26px 0; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}
.footer-dot { color: var(--line); }
.footer-contact { color: var(--teal); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.15s ease; }
.footer-contact:hover, .footer-contact:focus { border-bottom-color: var(--teal); }

/* Shows only the active page view. */
.page[hidden] { display: none !important; }

.page-post { background: var(--sand); min-height: 100vh; }

/* Search page shares post page layout */
.page-search { background: var(--sand); min-height: 100vh; }
.page-search-body { max-width: 720px; padding: 24px 24px 90px; }

/* ---- Search page area list ----
   Deliberately NOT the home page's card grid: a single flowing column of
   thin rectangular rows, each haloed by a soft blurred teal glow on its
   edges. The home page keeps its own 10-visible/scroll card grid (see
   .area-grid above) — that behavior stays exclusive to the home page and
   is untouched here. */
.search-area-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.search-area-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  background: var(--white);
  border: var(--border-teal);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  /* thin rectangle, not a square card */
  min-height: 44px;
  box-shadow:
    0 0 0 1px rgba(28, 124, 116, 0.03),
    0 4px 14px -6px rgba(28, 124, 116, 0.14);
  transition: transform var(--transition-fast), box-shadow var(--transition-slow), border-color var(--transition-fast);
}
/* The blurred glow itself: a faint teal wash right at the row's edge —
   kept deliberately subtle so it reads as a soft lit boundary, not a
   spotlight. */
.search-area-row::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 160% at 0% 50%, rgba(28, 124, 116, 0.12), transparent 70%);
  filter: blur(6px);
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.search-area-row:hover,
.search-area-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(28, 124, 116, 0.32);
  box-shadow:
    0 0 0 1px rgba(28, 124, 116, 0.05),
    0 6px 18px -6px rgba(28, 124, 116, 0.2);
}
.search-area-row:hover::before,
.search-area-row:focus-visible::before {
  opacity: 1;
}
.search-area-row .area-card-name { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; }
.search-area-row .area-card-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

@media (max-width: 480px) {
  .search-area-row { padding: 12px 16px; }
}

/* Search input and results */
.page-search-input { width: 100%; box-sizing: border-box; margin-bottom: 12px; }
.search-head { display:flex; flex-direction:column; gap:8px; margin-bottom: 12px; }
.search-type-filters { display:flex; gap:8px; flex-wrap:wrap; }
.search-results { margin-top: 12px; }
.search-suggestion { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }
.search-suggestion button { background: none; border: none; color: var(--teal-deep); font-weight:700; cursor:pointer; text-decoration:underline; }


.page-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 236, 224, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.page-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 68px;
}
.page-topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; }

/* Floating return control — shares the .btn-icon-only shape language
   (--radius-sm, --shadow-sm/md) but stays its own class since it's
   fixed-positioned rather than inline. */
.back-float {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 40;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.back-float:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.back-float:active { transform: translateY(0) scale(0.96); }

.page-post-body {
  max-width: 480px;
  padding: 32px 24px 90px;
}

/* Gap under the sticky area title so the first listing card floats clear
   of the header line instead of butting up against it. */
.page-listings-body {
  max-width: 720px;
  padding: 20px 24px 90px;
}

#postForm { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#postForm label { font-size: 13px; font-weight: 500; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#postForm input, #postForm select, #postForm textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--sand);
  color: var(--ink);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
#postForm textarea {
  resize: vertical;
  min-height: 64px;
  font-family: var(--font-body);
}
#postForm input:focus, #postForm select:focus, #postForm textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
#postForm select:disabled { color: var(--ink-soft); cursor: not-allowed; }

.phone-row {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.cc-select {
  flex: 0 0 92px;
  min-width: 0;
  padding-left: 8px;
  padding-right: 4px;
}
.phone-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.modal-note { font-size: 12px; color: var(--ink-soft); text-align: center; margin: 4px 0 0; }
.recovery-warning { color: var(--ink); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.recovery-link {
  width: 100%;
  padding: 10px 12px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}
.recovery-link:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.review-actions .btn { text-decoration: none; }

/* ---- Consistency fixes: these classes were used in index.html/app.js
   but had no rules anywhere in this file (relying entirely on the
   browser's unstyled default). ---- */
.field-error {
  display: block;
  min-height: 14px;
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
}
.listings-grid {
  display: flex;
  flex-direction: column;
}
.listings-empty {
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
  padding: 32px 16px;
  margin: 0;
}
.listings-empty-cta {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: var(--teal-deep);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
}

.label-optional { font-weight: 400; color: var(--ink-soft); font-size: 12px; }

/* ---- Area combobox (Post page) ---- */
.area-combobox { position: relative; width: 100%; }
.area-combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(36, 31, 27, 0.14);
  z-index: 40;
  padding: 6px 0;
}
.area-combobox-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
}
.area-combobox-item:hover,
.area-combobox-item:focus {
  background: var(--sand);
  color: var(--teal-deep);
}
.area-combobox-empty { padding: 10px 12px; font-size: 13px; color: var(--ink-soft); }

.block-other-row { margin-top: -2px; }
.block-other-row label { font-size: 13px; font-weight: 500; display: flex; flex-direction: column; gap: 6px; }

/* ---- Consent checkbox, inside the review-before-publish modal ----
   A real gate on publish/save (see app.js), so it reuses the same
   .field-error pattern as the form fields above it. */
.review-consent {
  margin: 4px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.4;
}
.consent-check input[type="checkbox"] {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
  flex-shrink: 0;
  cursor: pointer;
}
.consent-check a {
  color: var(--teal-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-check a:hover { color: var(--teal); }
.review-consent .field-error { display: block; margin-top: 6px; margin-left: 27px; }

/* ---- Listing card icons: report flag, bottom-right ---- */
.listing-card { position: relative; padding-bottom: 34px; }
.listing-card-icons {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.listing-report {
  background: none;
  border: var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-soft);
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.listing-report:hover { border-color: var(--danger); color: var(--danger); }
.listing-report--done { color: var(--teal-deep); border-color: var(--teal); cursor: default; }

/* ---- My Listings page: same page/topbar/back-float pattern as Post & Search ---- */
.page-mylistings { background: var(--sand); min-height: 100vh; }
.page-mylistings-body { max-width: 720px; padding: 24px 24px 90px; }
.page-mylistings-body .listings-grid { margin-top: 4px; }

/* Persistent entry point, fixed top-right — mirrors .back-float (fixed
   top-left) so the two read as one consistent piece of global chrome.
   Shape/colour come from .btn .btn-secondary (same classes as the Search
   and Post buttons); this class only handles the fixed positioning. */
.mylistings-float {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
}
.mylistings-float-icon { display: inline-flex; color: var(--teal-deep); }
.mylistings-float-icon svg { display: block; }
.mylistings-float[hidden] { display: none; }

@media (max-width: 480px) {
  /* Bare icon only: no pill, no border, no background — just the icon
     sitting in the same fixed top-right spot. */
  .mylistings-float,
  .mylistings-float:hover,
  .mylistings-float:active {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--teal-deep);
    transform: none;
  }
  .mylistings-float {
    padding: 8px;
    gap: 0;
  }
  .mylistings-float-label { display: none; }
  .mylistings-float-icon svg { width: 22px; height: 22px; }
}

/* Owner actions (Edit/Delete) replace the public report/pin row on My
   Listings cards — same slot, same pill-button language as .listing-report. */
.mylisting-actions { position: static; margin-top: 10px; justify-content: flex-end; }
.mylisting-edit, .mylisting-delete {
  background: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.mylisting-edit { border: 1px solid var(--teal); color: var(--teal-deep); }
.mylisting-edit:hover { background: var(--teal); color: var(--white); }
.mylisting-delete { border: 1px solid rgba(201, 120, 120, 0.5); color: var(--danger); }
.mylisting-delete:hover { background: var(--danger); color: var(--white); }

.mylisting-status {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
}
.mylisting-status--reported { background: rgba(201, 120, 120, 0.12); color: var(--danger); }

@media (max-width: 860px) {
  /* Stack content into a single column on smaller screens. */
  .hero-inner { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .board-row { grid-template-columns: 1.3fr 0.8fr 0.9fr; font-size: 11.5px; padding: 10px 12px; }
  .board-head { padding: 12px 12px 8px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  #boardRows { max-height: 300px; }
  .area-grid { grid-template-columns: repeat(2, 1fr); max-height: 320px; gap: 10px; }
  .area-card { padding: 14px; }
}

/* Result cards displayed in the search overlay */
.result-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(36,31,27,0.06);
  border: 1px solid rgba(36,31,27,0.04);
}
.result-posted { color: var(--teal); font-size: 12px; font-family: var(--font-mono); margin-bottom: 6px; }
.result-type-label { display: inline-block; background: var(--amber); color: var(--ink); padding: 4px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.result-summary { font-size: 16px; line-height: 1.4; margin: 8px 0 10px; color: var(--ink); }
.result-price { color: var(--teal-deep); font-weight: 700; margin-bottom: 8px; }
.result-meta { display:flex; gap:10px; flex-wrap:wrap; font-size:13px; color:var(--ink-soft); align-items:center; }
.result-meta-item { background: rgba(36,31,27,0.03); padding:6px 8px; border-radius: var(--radius-sm); }
.result-whatsapp { color: var(--amber-deep); font-weight:700; text-decoration:none; }

@media (max-width:640px) {
  .result-summary { font-size: 15px; }
  .result-type-label { font-size: 11px; padding:3px 6px; }
}

/* ---- Legal pages (Terms of Service, Privacy Policy) ----
   Standalone pages (not part of the SPA's hidden-section pattern), but
   built from the same "rooms in one house" language: same topbar/footer,
   same card and typography tokens as everywhere else. */
.page-legal { background: var(--sand); min-height: 100vh; }
.page-legal-body { max-width: 720px; padding: 32px 24px 90px; }

.legal-draft-notice {
  background: rgba(232, 163, 61, 0.12);
  border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 24px;
}
.legal-draft-notice strong { color: var(--amber-deep); }

.legal-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  line-height: 1.7;
}

.legal-content { background: var(--white); border-radius: var(--radius-md); padding: 28px 28px 8px; box-shadow: var(--shadow-sm); border: var(--border); }
.legal-content h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 12px;
}
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content p { margin: 0 0 16px; color: var(--ink); line-height: 1.6; }
.legal-content ul { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.legal-content li { color: var(--ink); line-height: 1.6; }
.legal-content strong { font-weight: 600; }
.legal-content a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.legal-content a:hover { color: var(--teal); }

.legal-nav { display: flex; gap: 16px; margin-top: 24px; font-size: 13.5px; }
.legal-nav a { color: var(--teal-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.legal-nav a:hover { color: var(--teal); }

@media (max-width: 640px) {
  .legal-content { padding: 22px 18px 4px; }
}
