@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #06080f;
  --bg-soft: #0d1018;
  --bg-elev: #11141d;
  --surface: rgba(16, 19, 28, 0.78);
  --text: #f5efe1;
  --muted: #a8a397;
  --muted-soft: #6c685f;
  --gold: #d4a85a;
  --gold-soft: #f1d28a;
  --gold-deep: #a87c2c;
  --ink: #0a0d14;
  --emerald: #10b981;
  --ruby: #f43f5e;
  --ice: #7ad9d3;
  --accent: var(--gold);
  --accent-strong: var(--gold-deep);
  --glass: rgba(14, 17, 26, 0.74);
  --border: rgba(212, 168, 90, 0.18);
  --border-strong: rgba(212, 168, 90, 0.34);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  font-feature-settings: "ss01", "cv11";
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(212, 168, 90, 0.08), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(122, 217, 211, 0.05), transparent 70%),
    linear-gradient(180deg, #06080f 0%, #0a0d14 50%, #06080f 100%);
  min-height: 100vh;
  line-height: 1.55;
  position: relative;
  letter-spacing: -0.005em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(212, 168, 90, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 168, 90, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.orb-1 { width: 320px; height: 320px; background: var(--gold); top: -100px; left: -80px; }
.orb-2 { width: 280px; height: 280px; background: var(--ice); right: -100px; top: 260px; }

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
  position: relative;
  z-index: 2;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 235, 200, 0.04);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  margin: 0;
  background: rgba(6, 8, 15, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  min-height: 78px;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.header-cta {
  flex-shrink: 0;
}

html[data-auth-state="authenticated"] .header-cta {
  display: none;
}

.site-header-inner.glass {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.site-logo-link {
  display: inline-flex;
  width: fit-content;
  margin: 0;
}

.site-logo {
  display: block;
  width: auto;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(212, 168, 90, 0.18));
}

.nav-links {
  display: none;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  overflow: auto hidden;
  -webkit-overflow-scrolling: touch;
  gap: 0.9rem;
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

html[data-auth-state="authenticated"] .nav-links {
  display: flex;
}

html[data-auth-state="authenticated"] .auth-anon-only {
  display: none !important;
}

@media (max-width: 860px) {
  .site-header-inner {
    width: min(1120px, calc(100% - 2rem));
  }

  .nav-links {
    flex-wrap: nowrap;
    gap: 0.75rem;
  }
}

@media (max-width: 720px) {
  .nav-links {
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .info-section.glass {
    padding: 0.85rem;
  }
}

.nav-links a {
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.4rem 0;
  border: 0;
  border-radius: 0;
  transition: color 0.25s ease;
  position: relative;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--gold-soft);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1.2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(600px 280px at 100% 0%, rgba(212, 168, 90, 0.10), transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

.hero > * {
  position: relative;
}

.landing-main {
  display: grid;
  gap: 1.2rem;
}

.landing-main .info-section {
  margin-bottom: 0;
}

.landing-main .hero {
  padding: clamp(1.8rem, 4vw, 3rem);
}

.hero-landing {
  background-image: linear-gradient(130deg, rgba(212, 168, 90, 0.18), rgba(122, 217, 211, 0.10));
}

.hero.compact { padding: 1.6rem; }

.hero-cta-group {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-subtext {
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  line-height: 1.75;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

h1, h2, h3 {
  font-family: "Fraunces", "Inter", serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { margin: 0.4rem 0 0.7rem; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.08; }
h2 { margin-top: 0; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
h3 { font-size: 1.15rem; }

.hero p { margin-bottom: 0; color: var(--muted); max-width: 70ch; line-height: 1.7; }

.info-section {
  margin-bottom: 1.2rem;
}

.info-section.glass {
  padding: 1rem;
}

.feature-grid,
.steps-grid {
  margin-top: 1rem;
}

.platform-overview .feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card,
.step-card {
  height: 100%;
}

.step-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(11, 17, 33, 0.6);
  padding: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.input-group span {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(245, 239, 225, 0.10);
  background: rgba(10, 13, 20, 0.85);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.78rem 0.9rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(212, 168, 90, 0.12);
  background: rgba(14, 17, 26, 0.95);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-soft);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.deals-area-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.area-select-group {
  min-width: 220px;
  max-width: 280px;
}

.area-dropdown {
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(18, 22, 33, 0.92), rgba(10, 13, 20, 0.88));
}

.area-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.deals-status {
  margin-top: 1rem;
  color: var(--muted);
}


.deals-loading {
  margin-top: 0.75rem;
  display: none;
}

.deals-loading.is-visible {
  display: block;
}

.deals-loading-bar {
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: rgba(10, 13, 20, 0.82);
}

.deals-loading-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  transition: width 180ms ease;
}

.deals-error {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 127, 127, 0.55);
  background: rgba(60, 12, 18, 0.62);
  color: #ffd6d6;
}

.deals-error-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.deals-error-subtitle {
  margin: 0 0 0.55rem;
  color: #ffc5c5;
  font-size: 0.92rem;
}

.deals-error-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.28rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.35;
}

.deals-grid,
.content-grid,
.steps-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
}

.card {
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
  border-color: var(--border-strong);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(135deg, #14181f, #0a0d14);
}

.card-body {
  padding: 1.1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.price {
  margin: 0.5rem 0;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--gold-soft);
  font-family: "Fraunces", serif;
  font-feature-settings: "tnum";
}

.score-pill {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.84rem;
  margin-bottom: 0.8rem;
}

.deal-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.deal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.metrics-panel {
  display: grid;
  gap: 0.6rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.metrics-grid div {
  background: rgba(10, 13, 20, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.metrics-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.metrics-grid strong {
  display: block;
  font-size: 1.15rem;
  color: var(--text);
}

.score-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.score-progress-track {
  flex: 1;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.score-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.score-progress-value {
  min-width: 2.8rem;
  text-align: right;
  font-size: 0.95rem;
}

.score-bar-green { background: var(--emerald); }
.score-bar-blue { background: var(--gold); }
.score-bar-orange { background: #ffad45; }
.score-bar-red { background: var(--ruby); }

.insights-grid {
  display: grid;
  gap: 0.35rem;
}

.metric-good { color: #7dffc0; }
.metric-bad { color: #ff9d9d; }

.cost-breakdown summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gold-soft);
}

.cost-rows {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.4rem;
}

.cost-rows p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.watch-toggle.is-active {
  border-color: var(--gold);
  background: rgba(212, 168, 90, 0.2);
  color: var(--gold-soft);
}

.deal-card.is-watchlisted {
  border-color: rgba(212, 168, 90, 0.45);
}

.deal-card.is-highlighted {
  outline: 2px solid rgba(212, 168, 90, 0.75);
  transform: translateY(-2px);
}


.deal-signals .score-pill {
  margin-bottom: 0;
}

.score-good {
  background: rgba(46, 255, 139, 0.16);
  border: 1px solid rgba(85, 255, 167, 0.45);
  color: #7dffc0;
}

.score-amber {
  background: rgba(255, 193, 77, 0.16);
  border: 1px solid rgba(255, 193, 77, 0.45);
  color: #ffd38d;
}

.score-risk {
  background: rgba(255, 104, 104, 0.16);
  border: 1px solid rgba(255, 122, 122, 0.45);
  color: #ffb3b3;
}

.score-heat {
  background: rgba(255, 154, 76, 0.16);
  border: 1px solid rgba(255, 162, 101, 0.4);
  color: #ffc89f;
}

.score-confidence {
  background: rgba(212, 168, 90, 0.16);
  border: 1px solid rgba(212, 168, 90, 0.45);
  color: var(--gold-soft);
}

.decision-flip {
  background: rgba(46, 255, 139, 0.16);
  border: 1px solid rgba(85, 255, 167, 0.45);
  color: #7dffc0;
}

.decision-rent {
  background: rgba(122, 217, 211, 0.16);
  border: 1px solid rgba(122, 217, 211, 0.45);
  color: #a8ebe6;
}

.decision-review {
  background: rgba(255, 193, 77, 0.16);
  border: 1px solid rgba(255, 193, 77, 0.45);
  color: #ffd38d;
}

.decision-avoid {
  background: rgba(255, 104, 104, 0.16);
  border: 1px solid rgba(255, 122, 122, 0.45);
  color: #ffb3b3;
}

.score-tag {
  background: rgba(212, 168, 90, 0.12);
  border: 1px solid rgba(212, 168, 90, 0.4);
  color: var(--gold-soft);
}

.condition-light {
  background: rgba(83, 217, 144, 0.16);
  border: 1px solid rgba(83, 217, 144, 0.42);
  color: #8cf3b7;
}

.condition-medium {
  background: rgba(255, 193, 77, 0.16);
  border: 1px solid rgba(255, 193, 77, 0.4);
  color: #ffd28a;
}

.condition-heavy {
  background: rgba(255, 104, 104, 0.15);
  border: 1px solid rgba(255, 122, 122, 0.42);
  color: #ffb0b0;
}

.buyer-insight {
  margin: 0.2rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 20, 0.48);
}

.buyer-insight p {
  margin: 0;
  color: var(--text);
  font-size: 0.83rem;
}

.buyer-insight p + p {
  margin-top: 0.35rem;
}

.btn-primary,
.btn-secondary {
  border: 1px solid transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 0.78rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--gold) 60%, var(--gold-deep) 100%);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 235, 200, 0.4) inset, 0 14px 32px rgba(212, 168, 90, 0.22);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 235, 200, 0.5) inset, 0 18px 36px rgba(212, 168, 90, 0.32);
}

.btn-secondary {
  background: rgba(245, 239, 225, 0.04);
  border: 1px solid rgba(245, 239, 225, 0.14);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(245, 239, 225, 0.08);
  border-color: var(--border-strong);
  color: var(--gold-soft);
  transform: translateY(-1px);
}

.btn-primary.is-disabled {
  pointer-events: none;
  opacity: 0.65;
}

.text-link {
  color: var(--gold-soft);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  color: var(--text);
}

.load-more-wrap {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
}

.tool-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.tool-form {
  display: grid;
  gap: 0.8rem;
}

.result-panel {
  border: 1px solid var(--border);
  background: rgba(10, 13, 20, 0.55);
  border-radius: 12px;
  padding: 1rem;
}

.result-panel p {
  font-size: 2rem;
  margin: 0.2rem 0;
  font-weight: 700;
}

.mortgage-providers-section {
  margin-top: 1.2rem;
  padding: 1rem;
}

.provider-search-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin: 1rem 0 0.75rem;
}

.providers-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.9rem;
}

.provider-card {
  padding: 1rem;
  border: 1px solid var(--border);
}

.provider-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
}

.provider-card h3 {
  margin: 0;
}

.list {
  padding-left: 1.1rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  background: rgba(5, 7, 12, 0.55);
}

.important-information {
  padding: 1rem;
}

.important-information h2 {
  margin-bottom: 0.25rem;
}

.important-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.important-list li {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}

.footer-inner {
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
}

.footer-inner nav {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-inner a:hover {
  color: var(--gold-soft);
}

@media (min-width: 760px) {
  .site-logo-link {
    margin-bottom: 0.8rem;
  }

  .filters {
    grid-template-columns: 2fr 1fr;
    align-items: end;
  }

  .tool-card {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
  }

  .provider-search-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    align-items: end;
  }

  .important-information {
    padding: 1.2rem 1.3rem;
  }
}

.templates-page {
  display: grid;
  gap: 1.2rem;
}

.templates-hero {
  background-image: linear-gradient(130deg, rgba(212, 168, 90, 0.22), rgba(10, 13, 20, 0.55));
}

.templates-featured-wrap,
.template-category {
  padding: 1rem;
}

.template-categories {
  display: grid;
  gap: 1rem;
}

.templates-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.template-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10, 13, 20, 0.72);
  display: grid;
  gap: 0.85rem;
}

.template-card-head {
  display: flex;
  gap: 0.75rem;
}

.template-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(212, 168, 90, 0.18);
  border: 1px solid rgba(212, 168, 90, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--gold-soft);
}

.template-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.template-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.template-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.74rem;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: rgba(14, 17, 26, 0.7);
}

.template-badge.highlight {
  background: rgba(212, 168, 90, 0.18);
  border-color: rgba(212, 168, 90, 0.5);
  color: var(--gold-soft);
}

.template-card p {
  margin: 0;
}

.template-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.template-actions .btn-primary,
.template-actions .btn-secondary {
  flex: 1;
  min-width: 120px;
}

.template-modal {
  width: min(980px, 96vw);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(6, 8, 15, 0.96);
  padding: 0;
  color: var(--text);
}

.template-modal::backdrop {
  background: rgba(2, 4, 10, 0.72);
}

.template-modal-inner {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.template-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.template-modal-head h3 {
  margin: 0;
}

.template-preview-frame {
  width: 100%;
  height: min(76vh, 760px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.deal-analysis-modal {
  width: min(1100px, calc(100vw - 2rem));
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle at top right, rgba(212, 168, 90, 0.18), rgba(6, 8, 15, 0.96) 56%);
}

.analysis-modal-body {
  display: grid;
  gap: 0.9rem;
  max-height: min(78vh, 820px);
  overflow: auto;
  padding-right: 0.25rem;
  overflow-x: hidden;
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.analysis-header h3 {
  margin: 0;
}

.analysis-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.analysis-carousel img {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.analysis-modal-body details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(10, 13, 20, 0.46);
}

.analysis-modal-body summary {
  cursor: pointer;
  font-weight: 700;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  margin-top: 0.6rem;
  min-width: 0;
}

.analysis-grid p {
  margin: 0;
}

.analysis-grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.analysis-data-card {
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(18, 22, 33, 0.78), rgba(10, 13, 20, 0.7));
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  min-width: 0;
}

.analysis-data-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 0.35rem;
}

.analysis-data-card strong {
  color: var(--text);
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.analysis-table-wrap {
  overflow: auto;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.analysis-table th,
.analysis-table td {
  border: 1px solid var(--border);
  padding: 0.45rem;
  text-align: left;
}

.analysis-best-row {
  background: rgba(16, 185, 129, 0.12);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.social-links a {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(11, 14, 22, 0.72);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  color: var(--gold-soft);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.social-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  padding: 1rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(6, 8, 15, 0.95);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.cookie-banner p {
  margin: 0;
  color: var(--text);
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
}

.cookie-actions button {
  min-width: 88px;
}

.cookie-deny {
  background: rgba(245, 239, 225, 0.06);
  border: 1px solid var(--border);
}

.privacy-page {
  display: grid;
  gap: 1rem;
}

.privacy-section {
  padding: 1.25rem;
}

.privacy-section h2 {
  margin-top: 0;
}

.privacy-consent-reset button {
  margin-top: 0.5rem;
}

@media (max-width: 760px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-actions button {
    flex: 1;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    width: 100%;
    justify-content: space-between;
  }

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

.map-page {
  display: grid;
  gap: 1.1rem;
}

.map-shell,
.map-results-section {
  padding: 1rem;
}

.map-head {
  align-items: center;
}

#clearCityFilter {
  visibility: hidden;
}

.investment-map {
  width: 100%;
  height: min(62vh, 520px);
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 0.8rem;
}

.leaflet-container {
  background: var(--ink);
}

.map-marker {
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 0 8px currentColor);
}

.map-marker:hover,
.map-marker-active {
  filter: drop-shadow(0 0 14px currentColor);
}

.map-tooltip {
  background: rgba(6, 8, 15, 0.92);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.map-tooltip::before {
  border-top-color: var(--border-strong);
}

.map-deal-card {
  animation: fadeInUp 0.25s ease;
}

.map-deal-actions {
  margin-top: 0.8rem;
}

.map-popup img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 0.4rem;
}

.map-popup h3 {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.map-popup p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: grid;
  gap: 0.45rem;
}

.toast-item {
  margin: 0;
  background: rgba(6, 8, 15, 0.94);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chart-visual {
  --feature-chart-height: 132px;
  margin: 0.85rem 0.85rem 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(18, 22, 33, 0.72), rgba(10, 13, 20, 0.5));
  min-height: var(--feature-chart-height);
  height: var(--feature-chart-height);
  position: relative;
  overflow: hidden;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chart-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to right,
    transparent 0 26px,
    rgba(212, 168, 90, 0.06) 26px 27px
  );
  opacity: 0.35;
}

.chart-label {
  display: inline-block;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.chart-visual > :not(.chart-label) {
  flex: 1;
  position: relative;
  z-index: 1;
}

.chart-line svg,
.chart-wave svg,
.chart-radar svg,
.complex-simple svg {
  width: 100%;
  height: 100%;
  min-height: 78px;
  shape-rendering: geometricPrecision;
}

.chart-line polyline,
.chart-wave path,
.complex-simple polyline {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(212, 168, 90, 0.32));
}

.chart-radar polygon {
  fill: none;
  stroke: rgba(212, 168, 90, 0.48);
  stroke-width: 1.5;
}

.chart-radar .radar-fill {
  fill: rgba(212, 168, 90, 0.32);
  stroke: var(--gold-soft);
}

.bar-track {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 0.55rem;
  min-height: 78px;
}

.bar-track span {
  height: var(--h);
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(to top, var(--gold-deep), var(--gold-soft));
  box-shadow: 0 0 18px rgba(212, 168, 90, 0.34);
}

.timeline-line {
  position: relative;
  height: 100%;
  min-height: 78px;
  margin-top: 0;
}

.timeline-line::before {
  content: "";
  position: absolute;
  inset: 29px 6px auto;
  border-top: 2px dashed rgba(212, 168, 90, 0.55);
}

.timeline-line::after {
  content: "";
  position: absolute;
  inset: 12px 16px auto;
  height: 34px;
  background: radial-gradient(circle at 4% 50%, var(--gold-soft) 3px, transparent 4px),
    radial-gradient(circle at 36% 50%, var(--gold) 3px, transparent 4px),
    radial-gradient(circle at 68% 50%, var(--gold-deep) 3px, transparent 4px),
    radial-gradient(circle at 96% 50%, var(--ice) 3px, transparent 4px);
}

.donut {
  width: 84px;
  height: 84px;
  margin: auto;
  border-radius: 50%;
  background: conic-gradient(var(--gold-soft) 0 34%, var(--gold) 34% 70%, var(--gold-deep) 70% 100%);
  position: relative;
  box-shadow: 0 0 18px rgba(212, 168, 90, 0.28);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: rgba(6, 8, 15, 0.95);
}

.gauge {
  width: 84px;
  height: 84px;
  margin: auto;
  border-radius: 50%;
  background: conic-gradient(var(--gold-soft) 0 60%, var(--gold-deep) 60% 86%, rgba(108, 104, 95, 0.22) 86% 100%);
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(212, 168, 90, 0.28);
}

.gauge::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: var(--ink);
}

.gauge span {
  position: relative;
  font-size: 0.85rem;
  color: var(--gold-soft);
  font-weight: 700;
}

.analytics-grid {
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
}

.analytics-card {
  background: linear-gradient(155deg, rgba(18, 22, 33, 0.82), rgba(10, 13, 20, 0.78));
}

.analytics-chart {
  margin: 0.95rem 0.95rem 0;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(18, 22, 33, 0.7), rgba(10, 13, 20, 0.38));
}

.roi-growth {
  display: grid;
  gap: 0.45rem;
}

.roi-bar {
  width: var(--w);
  min-width: 120px;
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(168, 124, 44, 0.85), rgba(241, 210, 138, 0.85));
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 600;
}

.ai-analysis {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}

.signal-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 7px solid rgba(212, 168, 90, 0.28);
  border-top-color: var(--gold-soft);
  border-right-color: var(--gold);
  box-shadow: 0 0 18px rgba(212, 168, 90, 0.33);
}

.ai-analysis ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.ai-analysis li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.ai-analysis strong {
  color: var(--text);
}

.complex-simple rect {
  fill: rgba(18, 22, 33, 0.88);
  stroke: var(--border-strong);
}

.complex-simple circle {
  fill: var(--gold-soft);
  stroke: rgba(10, 13, 20, 0.8);
  stroke-width: 2;
}

/* Premium deal cards */
.upgraded-deal-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 22, 33, 0.78) 0%, rgba(10, 13, 20, 0.86) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.upgraded-deal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(212, 168, 90, 0.04));
}

.upgraded-deal-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 168, 90, 0.12);
}

.deal-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #14181f, #0a0d14);
  overflow: hidden;
}

.deal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.upgraded-deal-card:hover .deal-card-image img {
  transform: scale(1.04);
}

.deal-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(6, 8, 15, 0.85));
  pointer-events: none;
}

.deal-card-image-tag {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 2;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(10, 13, 20, 0.7);
  border: 1px solid rgba(245, 239, 225, 0.14);
  color: var(--text);
}

.deal-card-image-tag.tag-buy {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}
.deal-card-image-tag.tag-rent {
  background: rgba(122, 217, 211, 0.18);
  border-color: rgba(122, 217, 211, 0.5);
  color: #a8ebe6;
}
.deal-card-image-tag.tag-review {
  background: rgba(212, 168, 90, 0.18);
  border-color: rgba(212, 168, 90, 0.5);
  color: var(--gold-soft);
}
.deal-card-image-tag.tag-avoid {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.deal-card-image-score {
  position: absolute;
  bottom: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  border: 1.5px solid rgba(255, 235, 200, 0.5);
  box-shadow: 0 8px 22px rgba(212, 168, 90, 0.4);
  letter-spacing: -0.03em;
}

.deal-card-image-score small {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: -2px;
  opacity: 0.8;
}

.upgraded-deal-card .card-body {
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
}

.deal-address {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.deal-stats-line {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.deal-headline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 239, 225, 0.06);
  background: rgba(6, 8, 15, 0.55);
}

.deal-headline-grid .h-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.deal-headline-grid .h-label {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
  font-weight: 600;
}

.deal-headline-grid .h-value {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
  font-feature-settings: "tnum";
}

.deal-headline-grid .h-value.profit-pos { color: #6ee7b7; }
.deal-headline-grid .h-value.profit-neg { color: #fda4af; }
.deal-headline-grid .h-value.gold { color: var(--gold-soft); }

.deal-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(245, 239, 225, 0.06);
  border-bottom: 1px solid rgba(245, 239, 225, 0.06);
  padding: 0.7rem 0;
  margin: 0;
}

.deal-metric-strip .m-cell {
  text-align: center;
  border-right: 1px solid rgba(245, 239, 225, 0.06);
  padding: 0 0.4rem;
}

.deal-metric-strip .m-cell:last-child {
  border-right: none;
}

.deal-metric-strip .m-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.deal-metric-strip .m-value {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  font-feature-settings: "tnum";
}

.deal-metric-strip .m-value.good { color: #6ee7b7; }
.deal-metric-strip .m-value.warn { color: var(--gold-soft); }
.deal-metric-strip .m-value.bad { color: #fda4af; }

.deal-context-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.deal-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid rgba(245, 239, 225, 0.1);
  background: rgba(6, 8, 15, 0.45);
  color: var(--muted);
}

.deal-chip.chip-good {
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
}
.deal-chip.chip-warn {
  border-color: rgba(212, 168, 90, 0.35);
  color: var(--gold-soft);
  background: rgba(212, 168, 90, 0.08);
}
.deal-chip.chip-risk {
  border-color: rgba(244, 63, 94, 0.32);
  color: #fda4af;
  background: rgba(244, 63, 94, 0.08);
}

.deal-confidence-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.deal-confidence-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(245, 239, 225, 0.08);
  overflow: hidden;
}

.deal-confidence-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  transition: width 0.6s ease;
}

.deal-confidence-value {
  font-family: "Fraunces", serif;
  font-weight: 500;
  color: var(--gold-soft);
  font-size: 0.86rem;
  font-feature-settings: "tnum";
  min-width: 2.6rem;
  text-align: right;
}

.upgraded-deal-card .deal-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.upgraded-deal-card .deal-actions .btn-primary {
  grid-column: 1 / -1;
}

.upgraded-deal-card .deal-actions .btn-primary,
.upgraded-deal-card .deal-actions .btn-secondary {
  min-height: 42px;
  font-size: 0.84rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
}

.upgraded-deal-card .watch-toggle.is-active {
  border-color: var(--border-strong);
  background: rgba(212, 168, 90, 0.12);
  color: var(--gold-soft);
}

.deal-card.is-watchlisted {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(212, 168, 90, 0.18) inset;
}

@media (max-width: 720px) {
  .deal-headline-grid {
    grid-template-columns: 1fr;
  }
  .deal-metric-strip .m-value {
    font-size: 0.95rem;
  }
}
