:root {
  --navy: #0f172a;
  --navy-2: #1e293b;
  --gold: #b8935f;
  --gold-light: #d9b98a;
  --green: #1f8a52;
  --red-line: #b3413a;
  --text: #f4f1ea;
  --muted: #b7c0cf;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 50% 0%, var(--navy-2), var(--navy) 70%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.screen {
  display: none;
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; align-items: center; justify-content: center; }

.wrap {
  width: 100%;
  max-width: 720px;
  padding: 32px;
  text-align: center;
}
.wrap.center { display: flex; flex-direction: column; align-items: center; }

.brand {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 18px;
}
.brand.small { font-size: 13px; margin-bottom: 8px; opacity: 0.85; }

h1 { font-size: 34px; margin: 0 0 10px; font-weight: 700; }
.huge-title { font-size: 42px; margin-bottom: 12px; }

.sub { font-size: 18px; color: var(--muted); margin: 0 0 28px; line-height: 1.4; }
.sub.small { font-size: 14px; margin-bottom: 6px; }
.sub.big-sub { font-size: 24px; color: var(--text); max-width: 560px; }

.field-label {
  display: block;
  text-align: left;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 8px 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.text-input {
  width: 100%;
  font-size: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 2px solid #33415580;
  background: #ffffff0d;
  color: var(--text);
  outline: none;
  margin-bottom: 18px;
}
.text-input:focus { border-color: var(--gold); }
.text-input.big { font-size: 26px; padding: 20px 22px; text-align: center; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  min-height: 4px;
}
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: #ffffff14;
  border: 1px solid #ffffff26;
  color: var(--text);
  font-size: 15px;
}

.btn {
  border: none;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 700;
  padding: 20px 28px;
  cursor: pointer;
  color: var(--navy);
}
.btn-primary { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #241a0e; }
.btn-primary:disabled { opacity: 0.4; }
.btn-ghost { background: #ffffff14; color: var(--text); border: 1px solid #ffffff33; }
.btn-huge { width: 100%; padding: 26px; font-size: 24px; margin-top: 6px; }

.btn-row { display: flex; gap: 14px; justify-content: center; }
.btn-row .btn { flex: 1; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  margin-top: 22px;
  text-decoration: underline;
  padding: 10px;
}

.mic-button {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 60%, #93713f 100%);
  box-shadow: 0 0 0 10px #ffffff0f, 0 20px 50px -10px #000000aa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #241a0e;
  font-size: 18px;
  font-weight: 700;
  padding: 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mic-button:active { transform: scale(0.96); }
.mic-button.listening {
  background: radial-gradient(circle at 35% 30%, #ff9d8a, var(--red-line) 65%);
  box-shadow: 0 0 0 10px #b3413a33, 0 0 0 22px #b3413a1a, 0 20px 50px -10px #000000aa;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.mic-icon { width: 54px; height: 54px; fill: currentColor; }

.step-dots { display: flex; gap: 10px; margin-bottom: 22px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ffffff2e; }
.dot.done { background: var(--green); }
.dot.current { background: var(--gold); }

.result-box { width: 100%; margin-top: 30px; }
.result-box.hidden { display: none; }

.yesno-row { display: flex; gap: 20px; width: 100%; }
.btn-yesno {
  flex: 1;
  padding: 40px 20px;
  font-size: 30px;
  border-radius: 20px;
  background: #ffffff14;
  border: 2px solid #ffffff26;
  color: var(--text);
  font-weight: 700;
}
#btn-realtor-yes:active, #btn-realtor-no:active { transform: scale(0.97); }

.spinner {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 6px solid #ffffff22;
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
  margin-bottom: 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.check-mark {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.corner-tap {
  position: fixed;
  top: 0; right: 0;
  width: 70px; height: 70px;
  background: transparent;
  border: none;
}

.overlay {
  position: fixed; inset: 0;
  background: #000000b3;
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
.overlay.hidden { display: none; }
.overlay-card {
  background: var(--navy-2);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid #ffffff1f;
}
.overlay-card h2 { margin-top: 0; }
.overlay-card .btn { width: 100%; margin-top: 12px; }

.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: #111827;
  border: 1px solid #ffffff26;
  color: var(--text);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 15px;
  z-index: 60;
  max-width: 90vw;
}
.toast.hidden { display: none; }
.toast.error { border-color: var(--red-line); }

@media (max-width: 480px) {
  .mic-button { width: 190px; height: 190px; }
  h1, .huge-title { font-size: 30px; }
}
