:root {
  --ink: #14251d;
  --muted: #63736a;
  --surface: #ffffff;
  --canvas: #f2f4ef;
  --green: #173d2b;
  --green-2: #245a40;
  --gold: #d4a94f;
  --line: #dfe6df;
  --shadow: 0 18px 45px rgba(23, 61, 43, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { max-width: 100%; }
button, input, textarea, select { max-width: 100%; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: inherit; }

.topbar {
  width: min(1240px, calc(100% - 40px));
  height: 76px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(23, 61, 43, .22);
}
.topbar { position: relative; z-index: 20; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.topbar nav a:hover { color: var(--green); }
.brand-context { color: var(--muted); font-weight: 650; }
.mobile-nav-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; }
.mobile-nav-toggle span { display: block; height: 2px; margin: 5px 0; border-radius: 2px; background: var(--green); transition: transform .18s ease, opacity .18s ease; }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

main { width: min(1240px, calc(100% - 40px)); margin: auto; }
.hero {
  overflow: hidden;
  position: relative;
  padding: clamp(34px, 6vw, 76px);
  border-radius: 30px;
  color: white;
  background:
    radial-gradient(circle at 87% 18%, rgba(212, 169, 79, .3), transparent 25%),
    radial-gradient(circle at 70% 105%, rgba(99, 164, 119, .3), transparent 34%),
    linear-gradient(135deg, #112f21, #1c5238);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -150px;
  bottom: -260px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
}
.hero-copy { max-width: 760px; position: relative; z-index: 1; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
h1 { max-width: 780px; margin: 12px 0 16px; font-size: clamp(38px, 6vw, 68px); line-height: 1.04; letter-spacing: -.045em; }
.hero-copy p { max-width: 700px; margin: 0; color: #d9e5de; font-size: clamp(16px, 2vw, 20px); }

.search {
  position: relative;
  z-index: 1;
  margin-top: 38px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 20px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
}
.search label { display: block; margin-bottom: 9px; color: #dce8e0; font-size: 13px; font-weight: 750; }
.search-row { display: flex; gap: 10px; }
.search input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border: 0;
  border-radius: 12px;
  outline: 3px solid transparent;
  background: #fff;
  color: var(--ink);
  font: inherit;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.search input:focus { outline-color: rgba(212, 169, 79, .5); }
.search button {
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: #213124;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}
.search button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.examples { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 13px; color: #bed0c5; font-size: 12px; }
.examples a { color: white; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
/* Suggestions are generated from live inventory, so make them read as buttons
   rather than incidental text and give clear affordance that they are tappable. */
.examples a.example-link {
  text-decoration: none;
  padding: 5px 11px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  transition: background .15s ease, border-color .15s ease;
}
.examples a.example-link:hover,
.examples a.example-link:focus-visible { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); }
.examples button.example-locate {
  font: inherit; color: white; cursor: pointer;
  padding: 5px 11px; border-radius: 999px;
  border: 1px dashed rgba(255,255,255,.38);
  background: transparent;
}
.examples button.example-locate:hover,
.examples button.example-locate:focus-visible { background: rgba(255,255,255,.12); border-style: solid; }
.coverage { position: relative; z-index: 1; margin: 20px 0 0; color: #dbe7df; font-size: 13px; }
.coverage span { margin-left: 5px; color: #aec5b7; }

.farm-section { display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 30px; margin: 24px 0; padding: 28px 32px; border: 1px solid var(--line); border-radius: 22px; background: #eaf1eb; }
.farm-section p { max-width: 720px; margin-bottom: 0; color: var(--muted); }
.farm-search { display: grid; gap: 10px; }
.farm-search input { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.farm-search button { padding: 12px; border: 0; border-radius: 10px; background: var(--green); color: white; cursor: pointer; font: inherit; font-weight: 800; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 24px 0 60px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
  box-shadow: 0 8px 28px rgba(23, 61, 43, .04);
}
.stats div { padding: 22px; background: var(--surface); }
.stats strong { display: block; color: var(--green); font-size: 27px; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
h2 { margin: 7px 0 0; font-size: clamp(27px, 4vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.result-count { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 12px; font-weight: 750; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: 70px; }
.card {
  min-width: 0;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 61, 43, .05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: #c5d3c8; box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.location { overflow: hidden; color: var(--green-2); font-size: 12px; font-weight: 850; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.score { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: #edf6ef; color: var(--green-2); font-size: 11px; font-weight: 800; }
.card h3 { min-height: 52px; margin: 14px 0 9px; font-size: 19px; line-height: 1.35; letter-spacing: -.015em; }
.price { margin: 0 0 14px; color: var(--green); font-size: 23px; font-weight: 900; }
.features { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.features span { padding: 5px 9px; border-radius: 7px; background: #f0f3ef; color: #4d6255; font-size: 12px; font-weight: 700; }
.description { min-height: 100px; margin: 0; color: var(--muted); font-size: 14px; }
.match-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.match-list span { padding: 5px 8px; border: 1px solid #dce7de; border-radius: 7px; color: #486153; font-size: 11px; }
.empty { grid-column: 1 / -1; padding: 50px; border: 1px dashed #bdcbbf; border-radius: 20px; text-align: center; background: white; }
.empty h3 { margin: 0 0 8px; font-size: 24px; }
.empty p { max-width: 600px; margin: auto; color: var(--muted); }

footer {
  width: min(1240px, calc(100% - 40px));
  margin: auto;
  padding: 26px 0 38px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.nav-button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }
.nav-button.primary { padding: 8px 13px; border-radius: 9px; background: var(--green); color: white; }
.user-pill { padding: 6px 10px; border-radius: 999px; background: #e5eee7; color: var(--green); font-size: 12px; font-weight: 800; }
.chat-panel { display: grid; grid-template-columns: .85fr 1.15fr; gap: 30px; margin: 42px 0 24px; padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.chat-copy h2 { margin-bottom: 15px; }
.chat-copy p, .chat-copy li { color: var(--muted); }
.chat-copy ul { padding-left: 19px; }
.chat-box { display: flex; min-height: 430px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #f7f9f6; }
.chat-messages { display: flex; max-height: 520px; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 18px; }
.assistant-message, .user-message { max-width: 86%; padding: 12px 14px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; }
.assistant-message { align-self: flex-start; background: white; border: 1px solid var(--line); }
.user-message { align-self: flex-end; background: var(--green); color: white; }
.assistant-message.error { color: #8a1f1f; }
.chat-match { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: #eaf1eb; font-size: 13px; align-items: stretch; }
.chat-match__thumb { flex: 0 0 96px; width: 96px; }
.chat-match__thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 9px; display: block; background: #d6e2d8; }
.chat-match__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.chat-match__header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chat-match__title { font-size: 14px; line-height: 1.25; }
.chat-match__price { color: var(--green-2); font-weight: 800; white-space: nowrap; }
.chat-match__spec { color: var(--ink); font-weight: 600; text-transform: capitalize; }
.chat-match__location { color: var(--muted); }
.chat-match__desc { color: var(--muted); margin: 2px 0 0; line-height: 1.4; }
.chat-match__reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 1px; }
.chat-match__tag { background: #d6e6d9; color: var(--green-2); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.chat-match__links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 3px; }
.chat-match__sources-label { color: var(--muted); font-size: 12px; }
.chat-match__links a { color: var(--green-2); font-weight: 800; }
.chat-match__title-link { color: inherit; text-decoration: none; }
.chat-match__title-link:hover { text-decoration: underline; }
.card-title-link { color: inherit; text-decoration: none; }
.card-title-link:hover { text-decoration: underline; }
.card-details-link { display: inline-block; margin-top: 8px; color: var(--green-2); font-weight: 800; text-decoration: none; }
.card-details-link:hover { text-decoration: underline; }

.site-banner { position: sticky; top: 0; z-index: 50; padding: 12px 20px; text-align: center; font-weight: 700; color: white; }
.site-banner.success { background: var(--green-2); }
.site-banner.error { background: #b23b3b; }

/* Shared header for detail/agent pages */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: white; }
.site-header .brand { font-weight: 800; color: var(--green-2); text-decoration: none; font-size: 18px; }
.site-nav { display: flex; gap: 16px; }
.site-nav a { color: var(--green-2); font-weight: 700; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* Agents */
.agent-search { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 24px; }
.agent-search input { flex: 1; min-width: 180px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.agent-search button { padding: 10px 18px; border: none; border-radius: 10px; background: var(--green-2); color: white; font-weight: 700; cursor: pointer; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.agent-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.agent-card h3 { margin: 0 0 4px; font-size: 16px; }
.agent-agency { color: var(--muted); margin: 0 0 6px; }
.agent-meta { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.chat-agent { background: #eef3f7; }
.agent-contact { margin-bottom: 8px; font-size: 13px; }

/* Contextual chat on detail pages */
.detail-chat .chat-messages { display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f6; margin-bottom: 10px; }
.detail-chat .assistant-message, .detail-chat .user-message { padding: 10px 12px; border-radius: 10px; max-width: 90%; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.detail-chat .assistant-message { background: #eaf1eb; align-self: flex-start; }
.detail-chat .user-message { background: var(--green-2); color: white; align-self: flex-end; }
.detail-chat .assistant-message.error { background: #f6e2e2; color: #8a2b2b; }
.chat-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
#detail-chat-form { display: flex; gap: 8px; }
#detail-chat-form textarea { flex: 1; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; font: inherit; }
#detail-chat-form button { padding: 0 20px; border: none; border-radius: 10px; background: var(--green-2); color: white; font-weight: 700; cursor: pointer; }

/* Contact cards on the property detail page */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.contact-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.contact-agency { color: var(--muted); }
.contact-role { color: var(--muted); font-size: 12px; }

/* Property detail page */
.detail { max-width: 900px; margin: 0 auto; padding: 20px 20px 60px; }
.detail-back { display: inline-block; margin-bottom: 14px; color: var(--green-2); font-weight: 700; text-decoration: none; }
.detail-gallery { display: grid; gap: 8px; margin-bottom: 22px; }
.detail-hero { width: 100%; max-height: 460px; object-fit: cover; border-radius: 16px; background: #e6ece6; }
.detail-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.detail-thumbs img { width: 100%; height: 80px; object-fit: cover; border-radius: 9px; background: #e6ece6; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.detail-head h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; }
.detail-location { color: var(--muted); margin: 0; }
.detail-price { font-size: 24px; font-weight: 800; color: var(--green-2); white-space: nowrap; margin: 0; }
.detail-specs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.detail-specs strong { color: var(--ink); }
.detail-features { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.feature-tag { background: #d6e6d9; color: var(--green-2); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.detail-section { margin-top: 26px; }
.detail-section h2 { font-size: 18px; margin: 0 0 10px; }
.detail-description { line-height: 1.6; white-space: pre-line; }
.detail-list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; }
.detail-list-grid dt { color: var(--muted); font-size: 13px; }
.detail-list-grid dd { margin: 0; font-weight: 600; }
.detail-note { color: var(--muted); font-size: 13px; }
.detail-warn { color: #b45309; font-weight: 600; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table th, .detail-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.detail-map { width: 100%; max-width: 640px; border-radius: 12px; margin-bottom: 10px; }
.detail-links { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.detail-links a { color: var(--green-2); font-weight: 800; text-decoration: none; }
.detail-links a:hover { text-decoration: underline; }
.detail-footer { text-align: center; padding: 30px; border-top: 1px solid var(--line); }
.detail-footer a { color: var(--green-2); font-weight: 700; text-decoration: none; }
#chat-form { display: flex; gap: 9px; padding: 13px; border-top: 1px solid var(--line); background: white; }
#chat-form textarea { flex: 1; min-height: 62px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 11px; font: inherit; }
#chat-form button, .secondary-button, .auth-form > button[type=submit] { border: 0; border-radius: 10px; background: var(--green); color: white; padding: 11px 16px; font: inherit; font-weight: 800; cursor: pointer; }
.secondary-button { margin: 0 13px 13px; background: var(--gold); color: var(--ink); }
dialog { width: min(440px, calc(100% - 24px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 24px 70px #0004; }
dialog::backdrop { background: #0d2319aa; backdrop-filter: blur(4px); }
.auth-form { position: relative; display: grid; gap: 14px; padding: 30px; }
.auth-form h2 { margin: 0 0 5px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
.auth-form input { border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; }
.dialog-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 25px; cursor: pointer; }
.oauth-button { padding: 10px; border: 1px solid var(--line); border-radius: 10px; text-align: center; text-decoration: none; font-weight: 750; }
.text-button { border: 0; background: transparent; color: var(--green); font: inherit; font-weight: 750; cursor: pointer; }
.auth-form > p:not(.form-error) { margin: 0; color: var(--muted); line-height: 1.5; }
.user-pill[type="button"] { border: 0; cursor: pointer; font: inherit; }
.form-error { min-height: 20px; margin: 0; color: #9b2424; font-size: 13px; }
.admin-hero { margin: 36px 0 24px; padding: 28px; border-radius: 20px; background: #eaf1eb; }
.admin-grid, .provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-card, .provider-card { display: grid; gap: 13px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; }
/* The category filter hides cards via the hidden attribute. Without this the
   display:grid above wins over the browser default [hidden]{display:none}, so a
   filtered-out card stays on screen and the filter buttons look broken. */
.provider-card[hidden], .admin-card[hidden] { display: none; }
.provider-card label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
.provider-card input, .provider-card select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font: inherit; background: white; }
.admin-card { min-width: 0; }
.analytics-period { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.analytics-period select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.analytics-subhead { margin: 22px 0 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-sub { font-size: 12px; color: var(--green-2); font-weight: 600; }
.analytics-box { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; overflow-x: auto; }
.analytics-box h4 { margin: 0 0 12px; }
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.analytics-grid .analytics-box { margin-top: 0; }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; min-width: min-content; }
.mini-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; flex: 1; min-width: 14px; height: 100%; }
.mini-bar__fill { width: 70%; min-height: 2px; background: var(--green-2); border-radius: 4px 4px 0 0; }
.mini-bar__label { font-size: 9px; color: var(--muted); white-space: nowrap; transform: rotate(-45deg); transform-origin: center; }
.analytics-box .muted { color: var(--muted); font-size: 13px; }
.embed-spaces { display: flex; flex-direction: column; gap: 12px; }
.embed-space { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfb; }
.embed-space__head { display: flex; align-items: center; gap: 8px; }
.embed-space__head strong { flex: 1; }
.embed-space__model { font-size: 11px; color: var(--muted); }
.embed-space__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.admin-action.small { padding: 4px 10px; font-size: 12px; }
.backfill-bar { height: 10px; border-radius: 999px; background: #e6ece6; overflow: hidden; }
.backfill-bar__fill { height: 100%; background: var(--green-2); border-radius: 999px; transition: width 0.4s ease; }
#image-backfill-card .detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
#image-backfill-card .detail-label { color: var(--muted); }
#image-backfill-card .detail-value { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.admin-card pre { max-width: 100%; overflow-x: auto; padding: 12px; border-radius: 9px; background: #f7f9f6; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.provider-card button { border: 0; border-radius: 9px; padding: 10px 14px; background: var(--green); color: white; font-weight: 800; cursor: pointer; }
.provider-card .card-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.provider-card .switch { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.provider-card .switch input { width: auto; }
.save-status { color: var(--green-2); font-size: 13px; }
.error-page { min-height: 100vh; background: radial-gradient(circle at 80% 15%, #dce9de, transparent 30%), var(--canvas); }
.error-main { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 36px 0 80px; }
.error-card { position: relative; width: min(760px, 100%); overflow: hidden; padding: clamp(34px, 7vw, 74px); border-radius: 30px; background: linear-gradient(135deg, #112f21, #1c5238); color: white; box-shadow: var(--shadow); }
.error-card h1 { max-width: 600px; margin-bottom: 18px; font-size: clamp(40px, 7vw, 70px); }
.error-card p { position: relative; z-index: 1; max-width: 590px; color: #d9e5de; font-size: 18px; }
.error-code { position: absolute; right: -10px; top: -58px; color: #ffffff0d; font-size: 240px; font-weight: 900; line-height: 1; }
.error-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.error-primary, .error-secondary { padding: 12px 17px; border-radius: 10px; text-decoration: none; font-weight: 800; }
.error-primary { background: var(--gold); color: var(--ink); }
.error-secondary { border: 1px solid #ffffff55; color: white; }
.error-card small { display: block; margin-top: 28px; color: #b7c9be; }
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-sidebar { position: sticky; top: 18px; display: grid; gap: 5px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.admin-tab { width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; font: inherit; font-weight: 750; cursor: pointer; }
.admin-tab:hover, .admin-tab.is-active { background: #eaf1eb; color: var(--green); }
.admin-content { min-width: 0; padding-bottom: 60px; }
.admin-section { display: none; }
.admin-section.is-active { display: block; }
.admin-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { display: grid; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.metric-card strong { color: var(--green); font-size: 28px; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.admin-list { display: grid; gap: 10px; }
.admin-row, .user-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-row > div, .user-identity { display: grid; min-width: 0; }
.admin-row span, .user-identity span { color: var(--muted); overflow-wrap: anywhere; }
.admin-row details { max-width: 60%; }
.admin-row pre { overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; background: #edf0ed; color: var(--muted); font-size: 11px; font-weight: 800; }
.status-healthy { background: #e4f3e8; color: #23613d; }
.status-failed { background: #fae8e8; color: #902b2b; }
.user-card { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 12px 20px; }
.user-badges, .user-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.user-controls { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
.inline-check { display: inline-flex !important; min-height: 40px; grid-template-columns: auto 1fr; align-items: center; gap: 7px !important; }
.inline-check input { width: auto !important; min-height: auto !important; }
.admin-action, .admin-refresh { min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--green); color: white; cursor: pointer; font: inherit; font-weight: 750; }
.admin-action.secondary { background: #e7ece8; color: var(--green); }
.admin-search { width: min(300px, 100%); min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.admin-filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.admin-filter-row button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; cursor: pointer; text-transform: capitalize; }
.admin-filter-row button.is-active { background: var(--green); color: white; }
.admin-empty { padding: 30px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.heading-actions, .dialog-actions, .check-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.detail-list { display: grid; gap: 8px; }
.detail-row { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); }
/* Duplicate review: vertical stacked blocks, one incoming listing over the
   existing properties it may duplicate, each with its own photo strip. */
.dedupe-block { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; margin-bottom: 18px; }
.dedupe-note { margin: 0; color: var(--muted); font-weight: 650; font-size: 13px; }
.dedupe-listing { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf8; }
.dedupe-incoming { border-left: 4px solid var(--accent, #2f7d4f); background: #eef5ef; }
.dedupe-candidate { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.dedupe-listing-head { display: flex; align-items: center; gap: 8px; }
.dedupe-tag { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.dedupe-title { font-size: 16px; overflow-wrap: anywhere; }
.dedupe-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.dedupe-price { font-weight: 800; }
.dedupe-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.dedupe-thumbs img { width: 92px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eee; }
.dedupe-nopics { color: var(--muted); font-size: 12px; font-style: italic; }
.dedupe-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.dedupe-scoreline { display: flex; align-items: center; gap: 8px; }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; flex: 1; }
.evidence-item { display: grid; gap: 2px; padding: 9px; border-radius: 9px; background: #f5f7f4; }
.evidence-item span, .source-stats span { color: var(--muted); font-size: 12px; }
.source-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.source-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 17px; font-weight: 800; }
.source-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.source-stats > div { display: grid; gap: 3px; padding: 10px; border-radius: 9px; background: #f5f7f4; }
.admin-dialog-form { position: relative; display: grid; gap: 18px; padding: 28px; }
.admin-dialog-form h2 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; font-size: 13px; }
.form-grid input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-grid label { display: flex; gap: 7px; align-items: center; }
.dialog-actions { justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
.dialog-actions .save-status { margin-right: auto; }
.admin-action.danger { background: #9f2f2f; }
.field-help { color: var(--muted); font-weight: 400; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; display: flex; overflow-x: auto; padding: 10px; scrollbar-width: thin; }
  .admin-sidebar .eyebrow { display: none; }
  .admin-tab { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-panel { grid-template-columns: 1fr; }
  .farm-section, .admin-grid, .provider-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .description { min-height: 0; }
}
@media (max-width: 700px) {
  .topbar { width: min(100% - 24px, 1240px); height: 68px; }
  main, footer { width: min(100% - 24px, 1240px); }
  .brand { min-width: 0; font-size: 17px; }
  .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-toggle { display: block; flex: 0 0 auto; }
  .topbar nav[data-mobile-nav] { position: absolute; display: none; top: 60px; right: 0; width: min(300px, calc(100vw - 24px)); max-height: calc(100vh - 80px); overflow-y: auto; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 18px 45px #173d2b2b; }
  .topbar nav[data-mobile-nav].is-open { display: flex; }
  .topbar nav[data-mobile-nav] a, .topbar nav[data-mobile-nav] .nav-button, .topbar nav[data-mobile-nav] .user-pill { width: 100%; min-height: 44px; display: flex; align-items: center; padding: 10px 12px; border-radius: 9px; text-align: left; }
  .topbar nav[data-mobile-nav] a:hover, .topbar nav[data-mobile-nav] .nav-button:hover { background: #f0f3ef; }
  .topbar nav[data-mobile-nav] .nav-button.primary { justify-content: center; background: var(--green); }
  .hero { padding: 30px 20px; border-radius: 20px; }
  .hero::after { width: 260px; height: 260px; right: -120px; bottom: -170px; }
  h1 { font-size: clamp(38px, 11vw, 52px); overflow-wrap: anywhere; }
  h2 { font-size: clamp(26px, 8vw, 34px); }
  .search { margin-top: 26px; padding: 14px; }
  .search-row { flex-direction: column; }
  .search input { width: 100%; min-height: 52px; font-size: 16px; }
  .search button, .farm-search button, #chat-form button, .provider-card button, .auth-form > button[type=submit] { min-height: 48px; }
  .examples { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 5px; scrollbar-width: thin; }
  .examples span, .examples a { flex: 0 0 auto; }
  .coverage span { display: block; margin: 4px 0 0; }
  .chat-panel { margin-top: 24px; padding: 18px; gap: 20px; border-radius: 19px; }
  .chat-copy ul { padding-left: 18px; }
  .chat-box { min-height: 390px; }
  .chat-messages { max-height: 65vh; padding: 12px; }
  .assistant-message, .user-message { max-width: 94%; overflow-wrap: anywhere; }
  .chat-match { overflow-wrap: anywhere; }
  .chat-match__thumb, .chat-match__thumb img { flex-basis: 72px; width: 72px; }
  .chat-match__thumb img { height: 72px; }
  .chat-match__header { flex-direction: column; gap: 2px; }
  #chat-form { flex-direction: column; padding: 10px; }
  #chat-form textarea { width: 100%; min-height: 84px; font-size: 16px; }
  .secondary-button { min-height: 48px; }
  .farm-section { gap: 20px; padding: 22px 18px; border-radius: 18px; }
  .farm-search input { min-height: 50px; font-size: 16px; }
  .stats { margin-bottom: 42px; }
  .stats div { min-width: 0; padding: 17px; }
  .stats strong { font-size: 23px; }
  .stats span { font-size: 10px; overflow-wrap: anywhere; }
  .grid { grid-template-columns: 1fr; gap: 14px; padding-bottom: 48px; }
  .card { padding: 19px; }
  .card:hover { transform: none; }
  .card h3 { min-height: 0; overflow-wrap: anywhere; }
  .card-top { align-items: flex-start; }
  .location { white-space: normal; overflow-wrap: anywhere; }
  .price { font-size: 21px; }
  .description { min-height: 0; }
  .results-heading { align-items: start; flex-direction: column; gap: 10px; }
  .empty { padding: 32px 18px; }
  dialog { width: 100%; max-width: none; max-height: 100dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .auth-form { max-height: 100dvh; overflow-y: auto; padding: 28px 20px calc(24px + env(safe-area-inset-bottom)); }
  .auth-form input { min-height: 48px; font-size: 16px; }
  .dialog-close { width: 44px; height: 44px; top: 7px; right: 7px; }
  .admin-shell { width: min(100% - 24px, 1240px); gap: 12px; }
  .admin-sidebar { margin: 0 -12px; border-right: 0; border-left: 0; border-radius: 0; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { padding: 14px; }
  .admin-row { align-items: flex-start; flex-direction: column; }
  .admin-row details { max-width: 100%; width: 100%; }
  .user-card { grid-template-columns: 1fr; }
  .user-controls { grid-column: auto; align-items: stretch; flex-direction: column; }
  .inline-check, .admin-action { width: 100%; }
  .results-heading .admin-search { width: 100%; }
  .admin-hero { margin-top: 8px; padding: 22px 18px; }
  .admin-hero h1 { font-size: clamp(36px, 10vw, 50px); }
  .admin-card, .provider-card { padding: 17px; }
  .provider-card .card-top { align-items: flex-start; flex-direction: column; }
  .provider-card .switch { width: 100%; min-height: 44px; justify-content: flex-start; }
  .provider-card input, .provider-card select { min-height: 46px; font-size: 16px; }
  .form-grid, .evidence-grid, .source-stats { grid-template-columns: 1fr; }
  .error-main { min-height: calc(100dvh - 68px); padding: 12px 0 36px; }
  .error-card { padding: 34px 20px; border-radius: 20px; }
  .error-card h1 { font-size: clamp(38px, 12vw, 54px); }
  .error-card p { font-size: 16px; }
  .error-code { top: -20px; right: -4px; font-size: 150px; }
  .error-actions { flex-direction: column; }
  .error-primary, .error-secondary { min-height: 48px; display: grid; place-items: center; text-align: center; }
  footer { gap: 12px; flex-direction: column; padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .stats, .admin-metrics { grid-template-columns: 1fr; }
  .brand-context { display: none; }
  .card-top { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Every source a deduplicated property was found on, so the original listing on
   each portal stays reachable. */
.source-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 12px; }
.source-links > span { color: var(--muted); font-weight: 700; }
.source-links a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #f7faf7; color: var(--green-2); font-weight: 700; text-decoration: none; }
.source-links a:hover { border-color: var(--green-2); background: #eef4ef; }

.panel-error { margin: 0; padding: 14px 16px; border: 1px solid #e6c9c9; border-radius: 12px; background: #fcf3f3; color: #7d2b2b; font-size: 13px; }
