:root {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --surface-soft: #fbf8f1;
  --text: #221f19;
  --muted: #625b4f;
  --accent: #c8a358;
  --accent-dark: #7a5a1e;
  --ink: #2f2a20;
  --border: #e6ddcc;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(47, 42, 32, 0.12);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.shell {
  max-width: 30rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(2.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.property-hero {
  position: relative;
  min-height: 18rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow: var(--shadow);
  margin-bottom: 0.85rem;
}

.property-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 14, 0.08), rgba(20, 18, 14, 0.78));
}

.hero-content {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  color: #fff;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--accent);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.12;
}

h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

#property-location {
  margin: 0.3rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.96rem;
}

.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.fact-row span {
  display: inline-flex;
  min-height: 1.85rem;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  font-weight: 650;
}

.agent-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.eyebrow {
  margin: 0 0 0.15rem;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

#agent-meta {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

label,
.field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.field {
  margin-bottom: 1rem;
}

input,
textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  min-height: 3rem;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent-dark);
}

.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.radio-grid label,
.segmented label {
  min-height: 3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  margin: 0;
  background: var(--surface-soft);
}

.radio-grid input,
.segmented input {
  width: auto;
  min-height: auto;
  margin: 0;
  accent-color: var(--accent-dark);
}

.radio-grid label:has(:checked),
.segmented label:has(:checked) {
  border-color: var(--accent-dark);
  background: rgba(200, 163, 88, 0.18);
}

.btn {
  display: block;
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  margin-top: 0.5rem;
  min-height: 3rem;
}

.btn:hover {
  background: #17140f;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--surface-soft);
}

.footer-note {
  margin: 1rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.thanks-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(200, 163, 88, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-dark);
}

.thanks h2 {
  text-align: center;
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.thanks p.lead {
  text-align: center;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.link-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--surface-soft);
  transition: border-color 0.15s, background 0.15s;
}

.link-card:hover {
  border-color: var(--accent-dark);
  background: #fff;
}

.link-card strong {
  display: block;
  font-size: 0.95rem;
}

.link-card span {
  font-size: 0.8rem;
  color: var(--muted);
}

.link-card .arrow {
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 1.1rem;
}

.hidden {
  display: none !important;
}

.error-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.setup-error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.setup-error code {
  background: #eee;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

@media (max-width: 360px) {
  .radio-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.45rem;
  }
}
