/* ============================================================
   TownSquare — hardware-store Americana
   Paper white, denim ink, blaze orange, pine, manila card stock.
   Display: Besley (Clarendon slab) · Body: Public Sans · Utility: IBM Plex Mono
   ============================================================ */

:root {
  --paper: #fbfaf7;
  --card: #ffffff;
  --ink: #22354c;
  --ink-soft: #5a6b80;
  --line: #e3dfd4;
  --blaze: #e8541e;
  --blaze-dark: #c44311;
  --pine: #324a3a;
  --pine-soft: #e7ede6;
  --manila: #f6ecd4;
  --manila-edge: #e2d2ac;
  --sky: #dde8f1;
  --danger: #b3261e;
  --gold: #a87b0f;
  --plum: #6d4a7e;
  --teal: #1f6b63;
  --denim: #2b4c7e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(34, 53, 76, 0.08), 0 4px 14px rgba(34, 53, 76, 0.06);
  --font-display: "Besley", "Georgia", serif;
  --font-body: "Public Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over display rules below. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--blaze);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; display: block; }

/* ---------------- Buttons, fields, chips ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blaze); color: #fff; }
.btn-primary:hover { background: var(--blaze-dark); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.photo-btn { position: relative; overflow: hidden; }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blaze);
}
.field textarea { resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.chip.is-active {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

.form-error {
  background: #fdecea;
  border: 1px solid #f2b8b5;
  color: var(--danger);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ---------------- Avatars ---------------- */

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--pine);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  letter-spacing: 0.02em;
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-xl { width: 84px; height: 84px; font-size: 28px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.who-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  min-width: 0;
}
.who-btn:hover .post-name, .who-btn:hover .ld-seller-name { text-decoration: underline; }
.who-btn .post-who { display: flex; flex-direction: column; min-width: 0; }
.who-btn .post-name, .who-btn .post-meta, .who-btn .ld-seller-name, .who-btn .ld-seller-meta { display: block; }

/* ---------------- Top bar ---------------- */

#topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
}
.brand-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a5c, var(--blaze) 55%, var(--blaze-dark));
  box-shadow: 0 1px 2px rgba(34,53,76,0.4);
  flex: none;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.town-chip {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--pine);
  white-space: nowrap;
}
.town-chip::before { content: "⌖ "; color: var(--blaze); }
.town-chip:hover { border-color: var(--pine); }

.main-nav { display: flex; gap: 2px; margin-left: auto; }
.nav-btn {
  position: relative;
  background: none;
  border: none;
  padding: 8px 13px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 8px;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.is-active { color: var(--ink); }
.nav-btn.is-active::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--blaze);
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blaze);
  margin-left: 5px;
  vertical-align: 2px;
}

/* ---------------- Views / layout ---------------- */

.view { max-width: 1060px; margin: 0 auto; padding: 20px 18px 90px; }

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  margin: 0;
}
.page-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  border-radius: 2px;
  margin-top: 4px;
  background: var(--blaze);
}
#view-classifieds .page-title::after { background: var(--gold); }
#view-groups .page-title::after { background: var(--plum); }
#view-recs .page-title::after { background: var(--teal); }
.page-sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }

/* Each section keeps its own accent on active filter chips */
#view-classifieds .chip.is-active { background: var(--gold); border-color: var(--gold); }
#view-groups .chip.is-active { background: var(--plum); border-color: var(--plum); }
#view-recs .chip.is-active { background: var(--teal); border-color: var(--teal); }

/* Town masthead art above the Board feed */
.board-masthead {
  position: relative;
  height: 96px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
}
.board-masthead img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.masthead-plate {
  position: absolute;
  left: 12px;
  bottom: 10px;
  background: var(--manila);
  border: 1.5px solid var(--manila-edge);
  border-radius: 8px;
  padding: 3px 12px 5px;
  box-shadow: 0 2px 6px rgba(34, 53, 76, 0.22);
}
.masthead-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.masthead-town {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  line-height: 1.15;
  color: var(--ink);
}

/* Colored top edges tell the sidebar cards apart at a glance */
#town-card { border-top: 4px solid var(--pine); }
#your-groups { border-top: 4px solid var(--plum); }
#town-guide { border-top: 4px solid var(--blaze); }
#mini-listings { border-top: 4px solid var(--gold); }

/* ---------------- Welcome / auth ---------------- */

#view-auth { max-width: 520px; padding-top: 44px; }

/* Framed travel-poster hero; the town sign overlaps its bottom edge
   like a real welcome sign standing in front of the scenery. */
.welcome-hero {
  border: 3px solid #24352a;
  background: #f6efdd;
  padding: 3px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(34, 53, 76, 0.18);
}
.welcome-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 9px;
}
.welcome-hero + .town-sign {
  margin: -34px 22px 0;
  position: relative;
}

.town-sign {
  background: var(--pine);
  color: #f6efdd;
  border: 3px solid #24352a;
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px rgba(246, 239, 221, 0.55), 0 6px 18px rgba(34, 53, 76, 0.18);
  text-align: center;
  padding: 26px 20px 20px;
}
.sign-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0.85;
}
.sign-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 9vw, 52px);
  line-height: 1.05;
  margin: 6px 0 10px;
}
.sign-rule {
  width: 70px;
  height: 3px;
  background: var(--blaze);
  margin: 0 auto 10px;
  border-radius: 2px;
}
.sign-tagline { font-size: 16px; font-weight: 600; }
.sign-pop {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 10px;
  opacity: 0.8;
}

.welcome-copy { margin: 20px 4px 18px; color: var(--ink); font-size: 15.5px; }

.join-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.join-mode-note {
  font-size: 13px;
  color: var(--pine);
  background: var(--pine-soft);
  border-radius: 8px;
  padding: 8px 11px;
  margin-bottom: 14px;
}
.join-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 10px;
}
.join-tab {
  border: none;
  background: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 4px 8px;
  border-radius: 6px;
}
.join-tab.is-active { color: var(--blaze); }

/* ---------------- Feed ---------------- */

.feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.composer { padding: 14px; }
.composer-top { display: flex; gap: 10px; }
.composer-top textarea {
  flex: 1;
  border: none;
  resize: none;
  background: none;
  padding: 8px 2px;
}
.composer-top textarea:focus { outline: none; }
.composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.composer-bar select {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pine);
  background: #fff;
}
.composer-bar .btn-primary { margin-left: auto; }

.photo-preview {
  margin-top: 10px;
  border-radius: 8px;
  max-height: 260px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.post-card { padding: 14px 16px; margin-bottom: 14px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-who { min-width: 0; }
.post-name { font-weight: 700; font-size: 14.5px; }
.post-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}
.post-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  flex: none;
}
.tag-update { background: var(--pine-soft); color: var(--pine); }
.tag-event { background: var(--sky); color: #2b4c7e; }
.tag-alert { background: #fde3d7; color: var(--blaze-dark); }
.tag-lostfound { background: #f3e9c8; color: #7a5a12; }
.tag-question { background: #ece7f5; color: #55407e; }

.post-text { margin: 10px 0 4px; white-space: pre-wrap; overflow-wrap: break-word; }
.post-photo { margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); max-height: 420px; object-fit: cover; }

.post-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.post-action {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 5px 9px;
  border-radius: 6px;
}
.post-action:hover { background: var(--pine-soft); color: var(--ink); }
.post-action.is-liked { color: var(--blaze); }
.post-action-del { margin-left: auto; }
.post-action-del:hover { color: var(--danger); background: #fdecea; }

.comments { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.comment { display: flex; gap: 8px; margin-bottom: 8px; }
.comment .avatar { width: 26px; height: 26px; font-size: 10px; }
.comment-bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13.5px;
  min-width: 0;
  overflow-wrap: break-word;
}
.comment-name { font-weight: 700; margin-right: 6px; }
.comment-form { display: flex; gap: 8px; margin-top: 4px; }
.comment-form input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13.5px;
  min-width: 0;
}
.comment-form input:focus { outline: none; border-color: var(--blaze); }

.empty-note {
  text-align: center;
  color: var(--ink-soft);
  padding: 34px 16px;
  font-size: 14.5px;
}
.empty-note strong { color: var(--ink); }

/* ---------------- Sidebar ---------------- */

.side-col { position: sticky; top: 76px; display: grid; gap: 14px; }
.side-card { padding: 14px 16px; }
.side-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
}
.side-town-name {
  font-family: var(--font-mono);
  color: var(--pine);
  font-weight: 600;
  font-size: 14px;
}
.side-stat { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
  width: 100%;
  background: none;
  border-left: none; border-right: none; border-bottom: none;
  text-align: left;
}
.mini-item:first-of-type { border-top: none; }
.mini-item .price { font-family: var(--font-mono); font-weight: 600; color: var(--blaze-dark); white-space: nowrap; }
.mini-item .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 0 4px;
}
.side-note a { color: var(--pine); }

/* Around-town guide card */
.guide-item {
  padding: 7px 0;
  border-top: 1px dashed var(--line);
}
.guide-item:first-of-type { border-top: none; }
.guide-name { font-weight: 700; font-size: 13.5px; }
.guide-when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blaze-dark);
  margin-top: 1px;
}
.guide-where { font-size: 12.5px; color: var(--ink-soft); }
.guide-head {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pine);
  margin: 12px 0 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.guide-place { font-size: 12.5px; color: var(--ink-soft); padding: 3px 0; }
.guide-place strong { color: var(--ink); font-weight: 600; }
.guide-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.guide-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--pine);
  text-decoration: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.guide-link:hover { border-color: var(--pine); }

/* ---------------- Classifieds: the bulletin board ---------------- */

.classifieds-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
  margin-top: 6px;
}

/* Manila index cards, tacked up with a pushpin */
.listing-card {
  position: relative;
  background: var(--manila);
  border: 1px solid var(--manila-edge);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(34, 53, 76, 0.14);
  padding: 12px 12px 10px;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.listing-card:nth-child(odd) { transform: rotate(-0.5deg); }
.listing-card:nth-child(even) { transform: rotate(0.45deg); }
.listing-card:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 53, 76, 0.2);
}
.listing-card::before {
  /* pushpin */
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  margin-left: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9468, var(--blaze) 55%, var(--blaze-dark));
  box-shadow: 0 2px 3px rgba(34, 53, 76, 0.35);
}
.listing-photo {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--manila-edge);
  background: #fff;
  margin-bottom: 9px;
}
.listing-title {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
  overflow-wrap: break-word;
}
.listing-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--blaze-dark);
  margin-top: 3px;
}
.listing-meta {
  font-size: 12.5px;
  color: #6d5f3f;
  margin-top: 3px;
}
.listing-town {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8a7a52;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed var(--manila-edge);
}
.sold-stamp {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 0.14em;
  color: var(--danger);
  border: 3px solid var(--danger);
  border-radius: 6px;
  padding: 2px 14px;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

/* Listing detail (inside modal) */
.ld-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.ld-price { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--blaze-dark); margin: 10px 0 2px; }
.ld-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.ld-spec {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink-soft);
}
.ld-desc { white-space: pre-wrap; overflow-wrap: break-word; margin: 10px 0; }
.ld-seller {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.ld-seller-name { font-weight: 700; font-size: 14px; }
.ld-seller-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); }
.ld-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------------- Groups ---------------- */

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 6px;
}
.group-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.group-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 53, 76, 0.18);
}
.group-cover {
  display: block;
  height: 56px;
  position: relative;
  overflow: hidden;
}
.group-cover-letter {
  position: absolute;
  right: 10px;
  bottom: -18px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 64px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.28);
}
.group-body { display: block; padding: 12px 14px 13px; }
.group-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.25;
}
.group-meta { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.group-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #f0e9f5;
  color: var(--plum);
  border-radius: 999px;
  padding: 2px 8px;
}
.group-members {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 7px;
}
.group-joined { color: var(--teal); font-weight: 600; }
.group-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}

.group-layout { max-width: 640px; }
.group-page-head { overflow: hidden; margin-bottom: 16px; }
.group-banner {
  height: 88px;
  position: relative;
  overflow: hidden;
}
.group-banner .group-cover-letter { font-size: 120px; bottom: -38px; right: 18px; }
.group-page-body { padding: 14px 18px 16px; }
.group-page-body > .btn { margin-bottom: 8px; }
.group-page-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  margin: 2px 0 4px;
}
.group-desc { margin: 10px 0 4px; font-size: 14.5px; }
#group-feed .post-card:first-child { margin-top: 14px; }
#group-composer { margin-top: 14px; }
#group-join-note { margin-top: 14px; }

/* ---------------- Who to Call ---------------- */

.stars { letter-spacing: 1px; white-space: nowrap; }
.stars .star { color: #d8d2c2; font-size: 15px; }
.stars .star.on { color: var(--blaze); }

.rec-card { padding: 14px 16px; margin-bottom: 14px; }
.rec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.rec-biz { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.rec-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.rec-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--pine-soft);
  color: var(--pine);
  border-radius: 999px;
  padding: 2px 8px;
}
.rec-phone { font-family: var(--font-mono); color: var(--blaze-dark); font-weight: 600; text-decoration: none; }
.rec-phone:hover { text-decoration: underline; }
.rec-score { text-align: right; flex: none; }
.rec-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.vouch {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
}
.vouch .who-btn { flex: none; align-self: flex-start; }
.vouch-body { min-width: 0; flex: 1; }
.vouch-text { font-size: 14px; margin-top: 3px; overflow-wrap: break-word; }
.vouch-del { padding-left: 0; margin-top: 2px; }

/* Local directory (real businesses, no ratings yet) */
.dir-head {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  margin: 22px 0 10px;
}
.dir-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
}
.dir-empty-line {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 4px 0 12px;
}
.dir-card { padding: 4px 16px; }
.dir-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px dashed var(--line);
}
.dir-row:first-child { border-top: none; }
.dir-info { min-width: 0; }
.dir-name { font-weight: 700; font-size: 14.5px; }
.dir-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 400;
}

.star-picker { display: flex; gap: 2px; padding-top: 4px; }
.star-btn {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  padding: 2px;
  color: #d8d2c2;
  transition: color 0.1s, transform 0.1s;
}
.star-btn.is-on { color: var(--blaze); }
.star-btn:hover { transform: scale(1.15); }

/* ---------------- Profile ---------------- */

.profile-head {
  display: flex;
  gap: 18px;
  padding: 20px;
  align-items: flex-start;
}
.profile-head > .avatar-xl { flex: none; }
.profile-info { min-width: 0; flex: 1; }
.profile-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  margin: 0;
}
.profile-town {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--pine);
  font-weight: 600;
  margin-top: 2px;
}
.profile-bio { margin-top: 8px; font-size: 14.5px; overflow-wrap: break-word; }
.profile-bio-empty { color: var(--ink-soft); font-style: italic; }
.profile-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.profile-stats strong { color: var(--ink); }
.profile-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.profile-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  margin: 24px 0 12px;
}
.pe-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

@media (max-width: 700px) {
  .profile-head { flex-direction: column; align-items: center; text-align: center; }
  .profile-stats, .profile-actions { justify-content: center; }
}

/* ---------------- Messages ---------------- */

.messages-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 62vh;
}
.convo-pane { border-right: 1.5px solid var(--line); overflow-y: auto; }
.pane-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  margin: 0;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.convo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
}
.convo-item:hover { background: var(--paper); }
.convo-item.is-active { background: var(--pine-soft); }
.convo-who { min-width: 0; flex: 1; }
.convo-name { font-weight: 700; font-size: 14px; }
.convo-last {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft); flex: none; }
.convo-item .unread-dot { margin-left: 0; }

.thread-pane { display: flex; flex-direction: column; min-height: 0; }
.thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.thread-back { display: none; }
.thread-name { font-weight: 700; font-size: 14.5px; }
.thread-context { font-family: var(--font-mono); font-size: 11px; color: var(--pine); }
.thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.bubble-them { background: var(--paper); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble-me { background: var(--pine); color: #f2f6f1; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  align-self: center;
  margin: 4px 0;
}
.thread-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.thread-input input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 0;
}
.thread-input input:focus { outline: none; border-color: var(--blaze); }

/* ---------------- Modals, toast ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 53, 76, 0.45);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 14px;
  overflow-y: auto;
}
.modal {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(15, 25, 40, 0.3);
  width: 100%;
  max-width: 520px;
  padding: 18px 20px 20px;
}
.modal-sm { max-width: 380px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
}
.modal-close {
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 6px;
}
.modal-close:hover { color: var(--ink); background: var(--paper); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }

.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 80;
  max-width: 90vw;
  text-align: center;
}

/* ---------------- Mobile nav ---------------- */

#mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: none;
  background: var(--card);
  border-top: 2px solid var(--ink);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
}
.mnav-btn {
  flex: 1;
  background: none;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border-radius: 8px;
}
.mnav-ic { font-size: 17px; line-height: 1.1; }
.mnav-btn.is-active { color: var(--blaze-dark); }

/* ---------------- Responsive ---------------- */

@media (max-width: 920px) {
  .feed-layout { grid-template-columns: 1fr; }
  .side-col { position: static; }
}

@media (max-width: 700px) {
  .main-nav { display: none; }
  #mobile-nav[hidden] { display: none; }
  #mobile-nav:not([hidden]) { display: flex; }
  .view { padding-bottom: 120px; }
  .topbar-inner { padding: 8px 12px; gap: 10px; }
  .brand-name { font-size: 18px; }
  .town-chip { margin-left: auto; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }

  .messages-layout { grid-template-columns: 1fr; min-height: 70vh; }
  .convo-pane { border-right: none; }
  .messages-layout.show-thread .convo-pane { display: none; }
  .messages-layout:not(.show-thread) .thread-pane { display: none; }
  .thread-back { display: inline-flex; }

  .listing-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .listing-photo { height: 105px; }
  .field-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .listing-card:nth-child(odd), .listing-card:nth-child(even) { transform: none; }
}
