:root {
  --brand: #84b83b;
  --brand-dark: #4f741f;
  --brand-ink: #26331f;
  --ink: #242522;
  --muted: #687065;
  --line: #dfe6d8;
  --soft: #fafbf7;
  --soft-green: #eef7e8;
  --panel: #ffffff;
  --amber: #a66b12;
  --amber-soft: #fff4dc;
  --danger: #b3261e;
  --danger-soft: #fbe7e4;
  --blue: #2f6f9f;
  --shadow-sm: 0 1px 2px rgba(31, 36, 28, 0.08);
  --shadow-md: 0 16px 38px rgba(31, 36, 28, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 190px) auto;
  gap: 8px;
}

body:not([data-route="browse"]) .searchbar {
  display: none;
}

.searchbar input,
.searchbar select,
.field input,
.field select,
.field textarea,
#messageBody {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

.searchbar input:focus,
.searchbar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
#messageBody:focus {
  border-color: var(--brand-dark);
}

.primary,
.secondary,
.ghost,
.danger,
.searchbar button,
.tab,
.pill,
.icon-button {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
}

.primary,
.searchbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-dark);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.primary:hover,
.searchbar button:hover {
  background: #42631a;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft-green);
  color: var(--brand-ink);
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger-soft);
  color: var(--danger);
}

.compact {
  min-height: 38px;
  padding-inline: 12px;
}

.topnav,
.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 8px;
  text-decoration: none;
  white-space: nowrap;
}

.topnav a:hover,
.topnav a.active {
  background: var(--soft-green);
  color: var(--brand-ink);
}

.view {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px 64px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy,
.post-gateway,
.about-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff 0%, #fbfdf8 100%);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 14px;
}

.trust-panel {
  display: grid;
  gap: 10px;
}

.trust-panel div,
.about-grid div,
.trust-note,
.form-section {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.trust-panel strong,
.about-grid strong {
  color: var(--brand-ink);
}

.trust-panel span,
.about-grid span {
  color: var(--muted);
  font-size: 14px;
}

.toolbar,
.browse-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.compact-toolbar {
  align-items: center;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.16;
}

h1 {
  max-width: 760px;
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 740;
}

h2 {
  font-size: 24px;
  font-weight: 720;
}

h3 {
  font-size: 18px;
  font-weight: 720;
}

p {
  margin: 0;
}

.lead {
  max-width: 780px;
  color: #4d5749;
  font-size: 18px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.listing-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.result-meta {
  margin: -4px 0 14px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 18px;
}

.listing-card {
  display: grid;
  min-height: 100%;
  overflow: hidden;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.listing-card:hover {
  border-color: #c6d7bb;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.photo-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eef1ea;
  overflow: hidden;
}

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

.photo-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(132, 184, 59, 0.14), rgba(255, 255, 255, 0.65)),
    #f4f6f1;
  color: var(--brand-ink);
  font-weight: 800;
}

.photo-placeholder span {
  border: 1px solid #cfe0c2;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
}

.request-listing .photo-placeholder {
  background:
    linear-gradient(135deg, rgba(47, 111, 159, 0.12), rgba(255, 255, 255, 0.7)),
    #f3f7fa;
}

.card-body {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.pill.active {
  background: var(--soft-green);
  border-color: #cfe0c2;
  color: var(--brand-ink);
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 42px;
  padding: 0 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f1f3ef;
  color: #3f463d;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

.chip.ok,
.chip.need,
.type-chip {
  background: var(--soft-green);
  color: var(--brand-ink);
}

.chip.need {
  background: #e9f2fb;
  color: #254e70;
}

.chip.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.stack {
  display: grid;
  gap: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.detail-photo {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef1ea;
}

.detail-photo img {
  width: 100%;
  display: block;
  max-height: 620px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.response-panel {
  margin-top: 20px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 720;
}

.field small {
  color: var(--muted);
}

.form-section {
  grid-template-columns: auto 1fr;
  align-items: center;
  background: var(--soft-green);
}

.section-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
}

.dropzone {
  display: grid;
  gap: 2px;
  justify-items: center;
  border: 1px dashed #b8cbaa;
  border-radius: var(--radius);
  background: #fbfdf8;
  color: var(--brand-ink);
  padding: 20px;
  text-align: center;
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

.request-card,
.message-row,
.admin-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-decoration: none;
}

.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 560px;
}

.message-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 320px;
  max-height: 55vh;
  overflow: auto;
  padding: 12px 0;
}

.bubble {
  max-width: 78%;
  border-radius: var(--radius);
  background: var(--soft-green);
  padding: 10px 12px;
}

.bubble.mine {
  justify-self: end;
  background: #edf3f8;
}

.auth-box {
  max-width: 520px;
  margin: 18px auto;
}

.post-gateway {
  display: grid;
  gap: 22px;
}

.gateway-copy {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

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

.choice-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  align-content: center;
  border: 1px solid #cfe0c2;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 22px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.choice-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.choice-card strong {
  font-size: 24px;
}

.choice-card span:last-child {
  color: var(--muted);
}

.choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
  text-transform: uppercase;
}

.about-section {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.about-page .about-section {
  margin-top: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed #cbd8c3;
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  padding: 32px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(18, 22, 16, 0.48);
  padding: 20px;
}

.modal {
  width: min(560px, 100%);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(79, 116, 31, 0.42);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (max-width: 1040px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .searchbar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .topnav {
    justify-content: center;
  }

  .home-hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .auth-actions .chip,
  .auth-actions button.ghost {
    display: none;
  }

  .auth-actions .primary {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .topnav {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
    justify-content: start;
    padding-bottom: 2px;
  }

  .topnav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    padding-inline: 10px;
  }

  .searchbar {
    grid-template-columns: 1fr auto;
    grid-column: 1 / -1;
  }

  .searchbar select {
    display: none;
  }

  .view {
    padding: 16px 12px 84px;
  }

  .home-hero {
    gap: 12px;
    margin-bottom: 16px;
  }

  .hero-copy,
  .post-gateway,
  .about-section {
    padding: 18px;
  }

  h1 {
    font-size: 32px;
  }

  .lead {
    font-size: 16px;
  }

  .trust-panel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .trust-panel div {
    min-width: 220px;
    scroll-snap-align: start;
  }

  .browse-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .listing-card {
    grid-template-columns: 112px 1fr;
    min-height: 136px;
  }

  .listing-card .photo-frame {
    aspect-ratio: auto;
    min-height: 100%;
  }

  .card-body {
    min-width: 0;
  }

  .card-body .split {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .form-grid,
  .choice-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 150px;
  }

  .actions .primary,
  .actions .secondary,
  .actions .ghost,
  .actions .danger {
    flex: 1 1 160px;
  }
}

@media (max-width: 420px) {
  .topbar {
    position: static;
  }

  .brand strong {
    font-size: 15px;
  }

  .home-hero h1 {
    font-size: 30px;
  }

  .listing-card {
    grid-template-columns: 96px 1fr;
  }

  .chip {
    font-size: 11px;
    min-height: 26px;
  }
}
