/*
 * RL Estates home valuation prototype
 * Design tokens are defined in design-tokens.css.
 *
 * Organization: foundations → shared components → screen components → overrides.
 * Keep responsive overrides in descending breakpoint order at the end of the file.
 * Shared rules precede component-specific rules so the cascade stays predictable.
 */


/* 01. Base and interaction defaults
   -------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--crm-ink);
  background: var(--crm-canvas);
  font: 400 16px/1.55 var(--crm-font);
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: var(--crm-blue);
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--crm-blue);
  outline-offset: 3px;
}

/* 02. Typography
   -------------------------------------------------------------------- */

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: Georgia,'Times New Roman',serif;
  font-size: 42px;
  line-height: 1.16;
  font-weight: 500;
  letter-spacing: -1.3px;
  margin-bottom: 14px;
}

h2 {
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -.5px;
  font-weight: 600;
  margin-bottom: 12px;
}

h3 {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
}

p {
  color: var(--crm-text);
}

/* 03. Shared controls, cards, and utilities
   -------------------------------------------------------------------- */

.eyebrow {
  font-size: 12px;
  letter-spacing: 1.65px;
  font-weight: 600;
  color: var(--crm-muted);
  display: block;
}

.primary {
  border: 0;
  background: var(--crm-blue);
  color: white;
  min-height: 48px;
  padding: 13px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: background .15s;
}

.primary:hover {
  background: var(--crm-blue-hover);
}

.primary:disabled {
  cursor: default;
  background: #5d7998;
  color: #fff;
  opacity: .8;
}

.card {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-feature);
  overflow: hidden;
}

.pill {
  display: inline-flex;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--crm-blue);
  background: var(--crm-blue-soft);
  font-weight: 500;
  white-space: nowrap;
}

label {
  display: block;
  font-size: 14px;
  color: var(--crm-text);
  font-weight: 500;
}

label span {
  color: var(--crm-muted);
  font-weight: 400;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--crm-control-border);
  border-radius: var(--crm-radius-control);
  padding: 10px 12px;
  background: white;
  color: var(--crm-ink);
  font-size: 16px;
}

select {
  padding-right: 22px;
}

.full {
  width: 100%;
}

.secondary {
  border: 1px solid var(--crm-control-border);
  border-radius: 8px;
  background: white;
  color: var(--crm-ink);
  padding: 11px 18px;
  font-size: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.secondary:hover {
  background: var(--crm-canvas);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.section-copy {
  font-size: 14px;
  margin: 8px 0 22px;
}

.data-note {
  font-size: 12px;
  margin: 16px 0 0;
  color: var(--crm-muted);
}

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

/* 04. Page layout and progress
   -------------------------------------------------------------------- */

.shell {
  max-width: 1100px;
  padding: 0 32px;
  margin: auto;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 40px;
  gap: 18px;
  color: var(--crm-muted);
  font-size: 13px;
}

.steps span {
  display: flex;
  gap: 9px;
  align-items: center;
  white-space: nowrap;
}

.steps b {
  width: 25px;
  height: 25px;
  background: var(--crm-border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 12px;
}

.steps .active {
  color: var(--crm-blue);
}

.steps .active b {
  background: var(--crm-blue-soft);
}

.steps span[aria-current] b {
  background: var(--crm-blue);
  color: white;
}

.steps i {
  width: 65px;
  height: 1px;
  background: var(--crm-border);
}

.details-shell {
  padding-top: 48px;
}

.page-heading {
  text-align: center;
  position: relative;
  margin-bottom: 32px;
}

.page-heading .eyebrow {
  margin-bottom: 12px;
}

.page-heading p {
  font-size: 16px;
  margin-bottom: 0;
}

.back {
  position: absolute;
  left: 0;
  top: 30px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--crm-border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 23px;
  background: white;
}

footer {
  padding: 40px 0 24px;
  margin-top: 20px;
  color: var(--crm-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

/* 05. Brand and header
   -------------------------------------------------------------------- */

#header {
  height: 120px;
  padding: 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1500px;
  margin: auto;
}

#header[hidden] {
  display: none;
}

#header .header-agent[hidden] {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  color: var(--crm-ink);
  gap: 12px;
  font-family: Georgia,serif;
}

.rl {
  border: 1px solid currentColor;
  height: 53px;
  width: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  line-height: .9;
}

.rl small {
  font-size: 10px;
  margin-top: 3px;
}

.brand-divider {
  height: 58px;
  width: 1px;
  background: currentColor;
  opacity: .6;
  margin: 0 3px;
}

.equity-symbol {
  font-size: 35px;
  width: 47px;
  height: 47px;
  border: 1px solid currentColor;
  border-radius: 50%;
  text-align: center;
  line-height: 43px;
}

.equity {
  font-size: 15px;
  line-height: 1.05;
  letter-spacing: .5px;
}

.equity small {
  display: block;
  font-size: 5px;
  letter-spacing: 1px;
  margin-top: 4px;
}

.header-agent {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.header-agent img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
}

.header-agent strong {
  font-weight: 600;
  display: block;
}

.header-agent strong span {
  font-weight: 400;
}

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

.header-agent a {
  font-size: 19px;
  font-weight: 700;
  color: var(--crm-ink);
  display: block;
  line-height: 1.3;
}

.light,
.light .brand,
.light .header-agent a {
  color: white;
}

.light .header-agent small {
  color: #e2e8f0;
}

.landing #header {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  max-width: none;
}

/* 06. Address entry and suggestions
   -------------------------------------------------------------------- */

.hero {
  --hero-overlay-opacity: 0.7;
  min-height: 100svh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
background:
  linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
  url('assets/hero.jpg') center 55% / cover;
  color:  white;
  padding: 160px 24px 140px;
}

.hero-content {
  max-width: 660px;
  width: 100%;
  text-align: center;
  margin-top: -10px;
}

.hero h1 {
  font-size: clamp(48px,5.1vw,70px);
  letter-spacing: -1.7px;
  line-height: 1.05;
  margin-bottom: 24px;
  text-shadow: 0 2px 20px #0002;
}

.search-wrap {
  position: relative;
  display: flex;
  background: white;
  border-radius: 8px;
  color: var(--crm-ink);
  height: 64px;
  align-items: center;
  text-align: left;
  box-shadow: 0 4px 24px #0001;
}

.search-wrap input {
  background: transparent;
  border: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 18px;
  font-size: 16px;
  outline-offset: 1px;
  border-radius: 8px;
}

.search-wrap input::placeholder {
  color: #697786;
}

.hero .primary {
  min-width: 280px;
  margin-top: 20px;
  border-radius: 999px;
  height: 52px;
}

.hero-note {
  font-size: 14px;
  color: white;
  margin: 20px 0 8px;
  opacity: .85;
}

.demo-link {
  border: 0;
  background: none;
  color: white;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13px;
  padding: 8px;
}

#suggestions {
  position: absolute;
  top: 72px;
  background: white;
  z-index: 5;
  left: 0;
  right: 0;
  border-radius: 8px;
  box-shadow: var(--crm-shadow-menu);
  padding: 8px;
  max-height: 330px;
  overflow: auto;
}

#suggestions[hidden] {
  display: none;
}

#suggestions button {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  height: 30px;
  min-height: 30px;
  width: 100%;
  border: 0;
  background: white;
  border-radius: 6px;
  color: var(--crm-ink);
}

#suggestions button:hover,
#suggestions button.selected {
  background: var(--crm-blue-soft);
}

#suggestions button > span {
  font-size: 22px;
  color: var(--crm-blue);
}

#suggestions strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

#suggestions small {
  display: block;
  color: var(--crm-muted);
  font-size: 13px;
}

/* 07. Property imagery
   -------------------------------------------------------------------- */

.property-map {
  position: relative;
  overflow: hidden;
  background: #dbe3dd;
  min-height: 280px;
}

.property-map > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.map-caption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  background: rgba(255,255,255,.94);
  padding: 5px 9px;
  border-radius: 5px;
  color: var(--crm-text);
  font-size: 11px;
  box-shadow: 0 2px 8px #0001;
}

/* 08. Home details form
   -------------------------------------------------------------------- */

.details-card {
  display: grid;
  grid-template-columns: 1.17fr 1fr;
  max-width: 960px;
  margin: auto;
  min-height: 500px;
  box-shadow: 0 4px 20px #0a223703;
}

.details-card .property-map > img {
  position: absolute;
  inset: 0;
  object-position: 50%;
}

.details-card form {
  padding: 32px;
}

.details-card .pill {
  margin-bottom: 15px;
}

.details-card h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.address-secondary {
  font-size: 14px;
  margin-bottom: 24px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
}

.fields .wide {
  grid-column: span 2;
}

.reason-label {
  margin-top: 20px;
  margin-bottom: 24px;
}

.form-note {
  text-align: center;
  font-size: 12px;
  color: var(--crm-muted);
  margin: 12px 0 0;
}

/* 09. Valuation layout and property summary
   -------------------------------------------------------------------- */

.results-shell {
  max-width: 1240px;
  padding-top: 32px;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0,1.7fr) minmax(330px,1fr);
  gap: 24px;
  align-items: start;
}

.result-main {
  display: grid;
  gap: 24px;
}

.property-card {
  padding: 16px;
}

.property-card .property-map {
  height: 350px;
  border-radius: 8px;
  min-height: 0;
}

.property-summary {
  padding: 18px 8px 4px;
}

.property-summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.property-summary-heading > div {
  flex: 1 1 220px;
  min-width: 0;
}

.new-search {
  flex-shrink: 0;
}

.property-summary h2 {
  font-size: 20px;
  margin: 0 0 4px;
}

.property-summary p {
  font-size: 14px;
  margin: 0;
}

.property-facts {
  display: flex;
  gap: 0;
  font-size: 14px;
  margin-top: 15px;
  color: var(--crm-muted);
}

.property-facts span + span {
  border-left: 1px solid var(--crm-border);
  margin-left: 20px;
  padding-left: 20px;
}

.property-facts b {
  color: var(--crm-ink);
  font-weight: 600;
}

/* 10. Value estimate and range
   -------------------------------------------------------------------- */

.value-card {
  padding: 28px;
  text-align: center;
}

.value-card > .eyebrow {
  letter-spacing: 1.1px;
  font-size: 11px;
}

.estimate {
  font-size: clamp(35px,3.6vw,49px);
  font-weight: 600;
  color: var(--crm-blue);
  letter-spacing: -1.8px;
  line-height: 1.3;
  margin: 12px 0;
  font-variant-numeric: tabular-nums;
}

.range-bar {
  height: 6px;
  background: var(--crm-border);
  position: relative;
  margin: 31px 3px 18px;
  border-radius: 4px;
}

.range-bar i {
  position: absolute;
  background: var(--crm-blue);
  width: 13px;
  height: 13px;
  top: -4px;
  left: 45%;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--crm-blue);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  text-align: left;
}

.range-labels > div:last-child {
  text-align: right;
}

.range-labels span {
  display: block;
  font-size: 12px;
  color: var(--crm-muted);
  margin-bottom: 3px;
}

.range-labels strong {
  font-size: 16px;
  font-weight: 500;
}

.estimate-note {
  font-size: 12px;
  line-height: 1.65;
  color: var(--crm-muted);
  margin: 22px 0 26px;
}

/* 11. Agent card
   -------------------------------------------------------------------- */

.agent-card {
  background: var(--crm-canvas);
  border-radius: 12px;
  padding: 25px 18px 20px;
  margin-top: 20px;
}

.agent-card img {
  height: 83px;
  width: 83px;
  border: 3px solid white;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px #0a22371a;
}

.agent-card h2 {
  font-size: 20px;
  margin: 12px 0 2px;
}

.agent-card p {
  font-size: 14px;
  margin: 0px;
}

.agent-card > span {
  font-size: 14px;
  color: var(--crm-muted);
}

.agent-card .phone {
  display: block;
  margin: 0px 0 18px;
  font-weight: 600;
  font-size: 21px;
  color: var(--crm-ink);
}

/* Client testimonial, styled after the supplied reference. */
.testimonial {
  margin: 28px 0 0;
  padding: 24px;
  border-radius: 12px;
  background: var(--crm-canvas);
  text-align: left;
}

.testimonial-stars {
  color: #efa500;
  font-size: 22px;
  letter-spacing: 3px;
  margin-bottom: 7px;
  line-height: 1;
}

.testimonial blockquote {
  margin: 0 0 20px;
  color: var(--crm-text);
  font-size: 16px;
  line-height: 1.65;
}

.testimonial figcaption {
  font-size: 14px;
  color: var(--crm-ink);
}

.testimonial time,
.testimonial small {
  display: block;
  color: var(--crm-muted);
  font-size: 12px;
  margin-top: 4px;
}

/* 12. Local market snapshot
   -------------------------------------------------------------------- */

.market,
.report {
  padding: 28px;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.metrics > div {
  background: var(--crm-blue-soft);
  border: 1px solid #dcebf8;
  border-radius: 10px;
  padding: 18px;
}

.metrics span {
  font-size: 13px;
  color: var(--crm-text);
  display: block;
}

.metrics strong {
  display: block;
  font-size: 28px;
  line-height: 1.3;
  margin: 6px 0;
  font-weight: 600;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}

.metrics small {
  font-size: 12px;
  color: var(--crm-success);
}

/* 13. Home value report
   -------------------------------------------------------------------- */

.report {
  scroll-margin-top: 24px;
}

/* Research stays inside the existing report card; no results-grid changes. */
.report-status { display: flex; align-items: center; gap: 12px; }
.report-status .button-spinner { color: var(--crm-blue); flex-shrink: 0; }
.report-market-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 20px 0; }
.report-market-metrics > div { padding: 16px; border: 1px solid var(--crm-border); border-radius: 10px; }
.report-market-metrics dt { font-size: 14px; color: var(--crm-muted); }
.report-market-metrics dd { margin: 8px 0; font-size: 22px; font-weight: 600; }
.report-market-metrics small, .report-attribution, .report .comparables small { display: block; font-size: 14px; overflow-wrap: anywhere; }
.report a { color: var(--crm-blue); text-decoration: underline; }
.report .comparables strong { font-size: 16px; }
.report .insight ul { padding-left: 20px; }
.report #report-body h3 { margin-top: 24px; }
@media (max-width: 720px) {
  .report-market-metrics { grid-template-columns: 1fr; }
  .report .comparables > div { flex-direction: column; }
  .report .comparables span:last-child { text-align: left; }
}

.spark {
  color: var(--crm-blue);
  font-size: 26px;
  vertical-align: middle;
  margin-right: 6px;
}

.report > .section-head {
  margin-bottom: 16px;
}

.report p {
  font-size: 15px;
  line-height: 1.8;
}

.report-preview {
  background: var(--crm-canvas);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 24px;
  display: grid;
  gap: 12px;
  color: var(--crm-blue);
  font-size: 12px;
}

.report-preview b {
  color: var(--crm-text);
  margin-left: 12px;
  font-size: 14px;
  font-weight: 500;
}

.report-meta {
  font-size: 12px;
  color: var(--crm-muted);
  border-bottom: 1px solid var(--crm-border);
  padding-bottom: 16px;
}

.insight {
  background: var(--crm-blue-soft);
  padding: 20px;
  border-radius: 10px;
  border-left: 3px solid var(--crm-blue);
  margin: 24px 0;
}

.insight > strong {
  font-size: 15px;
}

.insight p {
  margin: 8px 0 0;
  font-size: 14px;
}

.comparables {
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  overflow: hidden;
}

.comparables > div {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.comparables > div + div {
  border-top: 1px solid var(--crm-border);
}

.comparables span:last-child {
  text-align: right;
}

.comparables strong {
  font-size: 14px;
  font-weight: 500;
  display: block;
}

.comparables small {
  font-size: 12px;
  color: var(--crm-muted);
  display: block;
  margin-top: 5px;
}

.report ol {
  padding-left: 22px;
  font-size: 14px;
  color: var(--crm-text);
  line-height: 1.8;
}

.report li {
  padding-left: 5px;
  margin-bottom: 8px;
}

.report .report-disclaimer {
  font-size: 12px;
  line-height: 1.7;
  border-top: 1px solid var(--crm-border);
  padding-top: 16px;
}

/* 14. Contact dialog and confirmation
   -------------------------------------------------------------------- */

dialog {
  width: min(480px,calc(100% - 32px));
  border: 1px solid var(--crm-border);
  border-radius: 16px;
  padding: 34px;
  color: var(--crm-ink);
  max-height: 90svh;
  overflow: auto;
}

dialog::backdrop {
  background: #0a22378c;
  backdrop-filter: blur(4px);
}

dialog h2 {
  font-family: Georgia,serif;
  font-size: 30px;
  font-weight: 500;
  margin: 12px 0;
}

dialog p {
  font-size: 14px;
}

dialog label {
  margin-bottom: 16px;
}

.close {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 0;
  background: transparent;
  font-size: 28px;
  color: var(--crm-muted);
  width: 38px;
  height: 38px;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
}

.consent input {
  min-height: 0;
  width: 18px;
  height: 18px;
  margin: 3px 0;
  accent-color: var(--crm-blue);
  flex-shrink: 0;
}

.consent span {
  font-size: 12px;
  color: var(--crm-text);
}

.contact-success {
  text-align: center;
  padding-top: 20px;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--crm-success-soft);
  color: var(--crm-success);
  font-size: 25px;
  margin: 0 auto 20px;
}

/* 15. Responsive, motion, and print overrides
   -------------------------------------------------------------------- */

/* Keep the valuation visible throughout the two-column layout. */
@media screen and (min-width: 721px) {
  .results-grid aside {
    position: sticky;
    top: 24px;
  }

  .results-grid aside > .value-card {
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

/* Tablet and smaller (900px and below) */
@media (max-width: 900px) {
  #header {
    padding: 24px;
  }

  .header-agent strong span {
    display: none;
  }

  .shell {
    padding: 0 24px;
  }

  .details-card {
    grid-template-columns: 1fr 1fr;
  }

  .details-card form {
    padding: 24px;
  }

  .results-grid {
    grid-template-columns: minmax(0,1fr) 320px;
    gap: 18px;
  }

  .value-card {
    padding: 22px;
  }

  .estimate {
    font-size: 38px;
  }

  .market,
  .report {
    padding: 22px;
  }

  .metrics > div {
    padding: 14px;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .metrics strong {
    font-size: 25px;
  }

}

/* Stacked layouts (720px and below) */
@media (max-width: 720px) {
  #header {
    height: 100px;
    padding: 20px;
  }

  .header-agent img {
    height: 44px;
    width: 44px;
  }

  .header-agent strong {
    font-size: 12px;
  }

  .header-agent small {
    display: none;
  }

  .header-agent a {
    font-size: 14px;
  }

  .brand {
    gap: 8px;
  }

  .rl {
    width: 44px;
    height: 42px;
    font-size: 29px;
  }

  .rl small {
    font-size: 8px;
  }

  .brand-divider {
    height: 43px;
    margin: 0;
  }

  .equity-symbol {
    width: 35px;
    height: 35px;
    font-size: 27px;
    line-height: 33px;
  }

  .equity {
    font-size: 11px;
  }

  .equity small {
    font-size: 4px;
  }

  .hero {
    padding: 145px 20px 110px;
    background-position: 60% center;
  }

  .hero h1 {
    font-size: 52px;
  }

  .hero-content {
    max-width: 540px;
  }

  .shell {
    padding: 0 20px;
  }

  .steps {
    gap: 10px;
    margin: 18px 0 30px;
    font-size: 12px;
  }

  .steps i {
    width: 25px;
  }

  .steps span {
    gap: 6px;
  }

  .steps b {
    height: 22px;
    width: 22px;
  }

  .page-heading h1 {
    font-size: 34px;
  }

  .page-heading .eyebrow {
    font-size: 10px;
  }

  .back {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
  }

  .details-card {
    display: flex;
    flex-direction: column;
  }

  .details-card .property-map {
    height: 290px;
    flex-shrink: 0;
  }

  .details-card form {
    padding: 26px;
  }

  .results-grid {
    display: flex;
    flex-direction: column;
  }

  .results-grid aside {
    order: -1;
    width: 100%;
  }

  .result-main {
    width: 100%;
  }

  .value-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 26px;
  }

  .value-card > .eyebrow,
  .estimate,
  .range-bar,
  .range-labels,
  .estimate-note {
    grid-column: 1;
  }

  .testimonial {
    grid-column: 1 / -1;
  }

  .value-card .agent-card {
    grid-column: 2;
    grid-row: 1/7;
  }

  .estimate {
    font-size: 36px;
  }

  .range-labels strong {
    font-size: 14px;
  }

  .estimate-note {
    margin-bottom: 0;
  }

  .agent-card {
    padding: 18px 12px;
  }

  .agent-card h2 {
    font-size: 18px;
  }

  .agent-card .phone {
    font-size: 18px;
  }

  .agent-card .primary {
    font-size: 13px;
    padding: 12px;
  }

  .property-card .property-map {
    height: 300px;
  }

  footer {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

/* Small phones (460px and below) */
@media (max-width: 460px) {
  .header-agent img {
    display: none;
  }

  .header-agent strong {
    font-size: 11px;
  }

  .header-agent a {
    font-size: 13px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero .primary {
    width: 100%;
  }

  .search-wrap {
    height: 60px;
  }

  .search-wrap input {
    font-size: 14px;
    padding: 14px;
  }

  .steps i {
    width: 12px;
  }

  .steps {
    gap: 7px;
    font-size: 11px;
  }

  .steps span {
    gap: 4px;
  }

  .shell {
    padding: 0 16px;
  }

  .page-heading h1 {
    font-size: 31px;
  }

  .page-heading p {
    font-size: 14px;
  }

  .details-card .property-map {
    height: 240px;
    min-height: 240px;
  }

  .details-card form {
    padding: 24px;
  }

  .value-card {
    display: block;
    padding: 26px;
  }

  .estimate {
    font-size: 47px;
  }

  .value-card .agent-card {
    margin-top: 24px;
  }

  .agent-card {
    padding: 24px;
  }

  .agent-card h2 {
    font-size: 22px;
  }

  .agent-card .primary {
    font-size: 15px;
  }

  .property-card .property-map {
    height: 250px;
  }

  .property-summary h2 {
    font-size: 19px;
  }

  .market,
  .report {
    padding: 22px;
  }

  .metrics {
    gap: 12px;
  }

  .metrics > div {
    padding: 13px;
  }

  .metrics strong {
    font-size: 23px;
  }

  .metrics span {
    font-size: 12px;
  }

  .metrics small {
    font-size: 11px;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .comparables > div {
    gap: 10px;
    padding: 12px;
  }

  .comparables strong {
    font-size: 12px;
  }

  .comparables small {
    font-size: 11px;
  }

  dialog {
    padding: 28px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto!important;
    transition: none!important;
  }
}

/* Print layout */
@media print {
  #header,
  .steps,
  footer,
  .agent-card,
  .report .secondary,
  dialog {
    display: none!important;
  }

  .shell {
    padding: 0;
    max-width: none;
  }

  .results-grid {
    display: block;
  }

  .result-main {
    display: block;
  }

  .card {
    break-inside: avoid;
    margin-bottom: 20px;
  }

  .property-card .property-map {
    height: 220px;
  }

  .report {
    break-inside: auto;
  }

  .results-grid aside {
    position: static;
  }

  .value-card {
    margin-top: 20px;
  }

  .report-preview,
  #generate-report {
    display: none;
  }

  body {
    background: white;
  }
}

/* Google Maps integration */
.live-property-map { min-height: 350px; }
.google-property-map { position: absolute; inset: 0; }
#address-form { position: relative; }
.search-status { position:absolute; top:100%; left:0; right:0; color:#fff; font-size:14px; line-height:1.5; margin:20px 0 0; }
.hero-content:has(.search-status:not(:empty)) .hero-note { visibility:hidden; }
.search-status:empty { display: none; }
.google-attribution { text-align: right; padding: 8px 16px; color: #5f6368; font-size: 12px; background: white; }

/* Live market comparisons: direction does not imply buyer/seller advantage. */
.metrics small.increase { color: var(--crm-text); }
.metrics small.decrease { color: var(--crm-text); }
.metrics small.neutral { color: var(--crm-text-muted, #5e718d); }

/* Progress inside primary actions; preserve the active button appearance. */
.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: progress; }
.button-spinner { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid rgb(255 255 255 / 35%); border-top-color: currentColor; border-radius: 50%; animation: button-spin .75s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .button-spinner { animation-duration: 1.5s; } }

/* Market research follows the existing report card typography and colors. */
.market-analysis h3{color:var(--navy,#092238);font-size:1.2rem;margin:1.8rem 0 .75rem;font-weight:600}
.market-analysis h3:first-child{margin-top:.5rem}
.market-analysis p,.market-analysis li{line-height:1.75}
.market-analysis ul,.market-analysis ol{padding-left:1.3rem;margin:.75rem 0 1.25rem}
.market-analysis li{margin-bottom:.65rem}
.market-analysis strong{color:var(--navy,#092238);font-weight:600}
.market-analysis a,.report-sources a{color:var(--blue,#126bc5);text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.market-analysis sup{margin-left:.2rem;font-size:.75em}
.report-sources{border-top:1px solid #dce5ef;margin-top:1.8rem;padding-top:1rem}
.report-sources h3{font-size:1rem;margin:0 0 .75rem}
.report-sources ul{padding-left:1.2rem;font-size:.85rem;line-height:1.6}

.comp-subject h3{font-size:1.15rem;margin:0 0 .6rem;color:#092238}
.comp-subject p{font-weight:600;margin-bottom:1.5rem}
.comp-table-scroll{overflow-x:auto;max-width:100%;margin:1.25rem 0}
.comp-sales-table{width:100%;border-collapse:collapse;font-size:.88rem;text-align:left;min-width:600px}
.comp-sales-table th{padding:.8rem .5rem;color:#092238;border-bottom:1px solid #ccd7e3;font-weight:600;white-space:nowrap}
.comp-sales-table td{padding:1.1rem .5rem;border-bottom:1px solid #e5ebf1;vertical-align:top;line-height:1.6}
.comp-sales-table th:first-child,.comp-sales-table td:first-child{padding-left:0;width:27%}
.comp-sales-table th:nth-child(n+3),.comp-sales-table td:nth-child(n+3){text-align:right;white-space:nowrap}
.comp-sales-table td strong{color:#092238;font-weight:600}
.comp-source{display:block;font-size:.75rem;color:#126bc5;text-decoration:underline;text-underline-offset:3px;margin-top:.25rem}
.result-main{min-width:0}

.comp-relevance,.comp-explanation,.comp-details{display:block;margin-top:.4rem;font-size:.75rem;line-height:1.5}
.comp-relevance{color:#126bc5;font-weight:600}
.comp-explanation,.comp-details{color:#5b6f88}
.comp-sales-table td:first-child{min-width:180px}

.zip-market-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin:.5rem 0 1.25rem}
.market-temperature{color:#092238;font-size:.9rem;font-weight:600;display:flex;align-items:center;gap:.5rem}
.market-temperature:before{content:'';width:8px;height:8px;background:#126bc5;border-radius:50%}
.zip-market-summary{line-height:1.8;margin:0 0 1rem}
.zip-market-reason{font-size:.9rem;line-height:1.7;color:#5b6f88}
.zip-market-sources{border-top:1px solid #e5ebf1;padding-top:1rem;margin-top:1.25rem;font-size:.8rem;color:#5b6f88}
.zip-market-sources a{color:#126bc5;text-decoration:underline;text-underline-offset:3px}

#suggestions .suggestion-address { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; color:var(--crm-ink); font-weight:500; }

/* Keep the reason menu native while placing its decorative arrow inward. */
.reason-label select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23092238' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}

/* Market commentary panels echo the overview reference without changing the report data. */
.market-text-panel { display: flex; align-items: flex-start; gap: 18px; padding: 24px; border-radius: 18px; margin-bottom: 18px; }
.market-summary-panel { background: #eef6ff; }
.market-evidence-panel { background: var(--crm-canvas); }
.market-panel-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; background: #dcecff; color: #096bd7; }
.market-panel-icon svg { width: 24px; height: 24px; }
.market-evidence-panel .market-panel-icon { background: #e3e9f1; color: #536780; }
.market-text-panel .zip-market-summary, .market-text-panel .zip-market-reason { margin: 0; line-height: 1.8; font-size: 16px; }
.market-text-panel strong { color: var(--crm-ink); font-weight: 600; }
.market-source-row { display: flex; align-items: flex-start; gap: 16px; border-top: 1px solid #e5ebf1; padding-top: 20px; margin-top: 24px; }
.market-source-row .zip-market-sources { border: 0; padding: 0; margin: 0; line-height: 1.8; overflow-wrap: anywhere; }
.market-source-row .market-panel-icon { flex-basis: 36px; width: 36px; height: 36px; }
.market-source-row .market-panel-icon svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .market-text-panel { padding: 18px; gap: 12px; border-radius: 14px; }
  .market-text-panel .market-panel-icon { flex-basis: 34px; width: 34px; height: 34px; }
  .market-text-panel .market-panel-icon svg { width: 20px; height: 20px; }
  .market-text-panel .zip-market-summary, .market-text-panel .zip-market-reason { font-size: 15px; }
}

.market-inline-link { color: #126bc5; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.market-inline-link:hover { color: #084b94; }

/* Keep mobile form text readable and prevent iPhone Safari focus zoom.
   The scoped override also covers touch phones in landscape; zoom stays enabled. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}
