/* ==========================================================================
   Monterey County Mortgage Calculator — styles.css
   Fonts: DM Serif Display, DM Sans
   ========================================================================== */

:root{
  --bg: #0b0f19;
  --panel: rgba(255,255,255,.92);
  --panel2: rgba(255,255,255,.82);
  --card: #ffffff;
  --border: rgba(16, 24, 40, .10);
  --text: #0b1220;
  --text-muted: rgba(11,18,32,.65);
  --white: #ffffff;

  --brand: #0f5fff;
  --brand2:#7c3aed;
  --green: #12b76a;
  --red: #f04438;
  --amber: #f79009;

  --shadow: 0 14px 44px rgba(0,0,0,.18);
  --shadow2: 0 10px 28px rgba(17,24,39,.12);
  --radius: 18px;
  --radius2: 14px;

  --maxw: 1060px;
}

*{ box-sizing:border-box; }
.sr-only{
  position:absolute; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); border:0;
}
.skip-link{
  position:absolute; left:-9999px; top:auto;
  padding:8px 16px; background:var(--brand); color:#fff;
  font-size:14px; font-weight:600; border-radius:0 0 8px 0; z-index:10000;
  text-decoration:none;
}
.skip-link:focus{ left:0; top:0; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--white);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(15,95,255,.20), transparent 55%),
    radial-gradient(900px 600px at 80% 20%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(900px 600px at 50% 90%, rgba(18,183,106,.10), transparent 60%),
    linear-gradient(180deg, #070a12 0%, #0b0f19 100%);
}

/* Generic helpers */
a{ color:inherit; }
small{ opacity:.8; }
button{ font-family: inherit; }
input, select{ font-family: inherit; }

.wizard{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.hero{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 12px;
  text-align:center;
}
.hero-eyebrow{
  display:inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  font-weight:600;
  letter-spacing:.2px;
  font-size: 13px;
}
.hero h1{
  margin: 14px 0 10px;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.05;
}
.hero h1 em{
  font-style: italic;
  background: linear-gradient(90deg, #ffffff, rgba(255,255,255,.75));
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
}
.hero-sub{
  margin: 0 auto;
  max-width: 760px;
  opacity: .88;
  font-size: 16px;
  line-height: 1.55;
}

/* AI Search Highlight */
.hero-ai-highlight{
  margin: 18px auto 0;
  max-width: 620px;
  padding: 14px 20px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}
.hero-ai-label{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 8px;
}
.hero-ai-ico{
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-ai-example{
  font-family: "DM Serif Display", serif;
  font-style: italic;
  font-size: clamp(15px, 2.4vw, 20px);
  line-height: 1.35;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  opacity: .92;
}
.hero-ai-example:hover{
  opacity: 1;
  transform: translateY(-1px);
}
.hero-ai-notice{
  margin-top: 10px;
  font-size: 11px;
  opacity: .45;
  letter-spacing: .2px;
}

/* Chat sample data notice */
.chat-sample-notice{
  margin-top: 8px;
  font-size: 11px;
  color: rgba(0,0,0,.40);
  text-align: center;
  letter-spacing: .2px;
}

/* Top bar */
.top-bar{
  position: sticky;
  top:0;
  z-index: 50;
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 16px;
  background: rgba(5,8,14,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
a.top-logo{
  font-weight: 800;
  letter-spacing:.2px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
a.top-logo:hover{ opacity:.8; }
.top-nav{
  display:flex;
  gap:4px;
  margin-left:8px;
}
.top-nav-link{
  font-size:13px;
  font-weight:600;
  padding:5px 12px;
  border-radius:999px;
  text-decoration:none;
  color:rgba(255,255,255,.55);
  transition:background .15s,color .15s;
}
.top-nav-link:hover{ color:#fff; background:rgba(255,255,255,.10); }
.top-nav-link.active{ color:#fff; background:rgba(255,255,255,.12); }
.top-nav-disabled{
  opacity:.45;
  pointer-events:none;
  cursor:default;
}
.top-nav-soon{
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.3px;
  padding:2px 5px;
  border-radius:4px;
  background:rgba(245,158,11,.20);
  color:rgba(245,158,11,.90);
  margin-left:4px;
  vertical-align:middle;
}
.top-right{
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:auto;
}
.lang-toggle{
  display:flex;
  gap:8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}
.lang-btn{
  border:0;
  background: transparent;
  color: rgba(255,255,255,.8);
  padding: 7px 10px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 700;
  font-size: 12px;
}
.lang-btn.active{
  background: rgba(255,255,255,.18);
  color: #fff;
}
.live-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 700;
  font-size: 12px;
}
.live-dot{
  width:10px; height:10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(18,183,106,.18);
}

/* Rate ribbon */
.rate-ribbon{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  display:flex;
  align-items: stretch;
  gap: 12px;
  overflow-x:auto;
}
.rate-item{
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.rate-item-label{ font-size: 12px; opacity: .85; font-weight: 700; }
.rate-item-val{ font-size: 18px; font-weight: 900; margin-top: 2px; }
.rate-change{
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}
.rate-change.down{ color: #a7f3d0; }
.rate-change.up{ color: #fecaca; }
.rate-divider{
  width: 1px;
  background: rgba(255,255,255,.10);
}
.rate-source{
  margin-left:auto;
  align-self:center;
  font-size: 12px;
  opacity: .85;
  white-space: nowrap;
}
.rate-source a{
  opacity: .95;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.35);
}

/* Progress */
.progress-wrap{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 14px auto 0;
}
.start-over{
  display:inline-flex;
  align-items:center;
  gap:5px;
  margin-top:10px;
  font-size:12px;
  font-weight:600;
  color:rgba(11,18,32,.45);
  text-decoration:none;
  cursor:pointer;
  transition:color .15s;
}
.start-over:hover{ color:rgba(11,18,32,.75); }
.start-over svg{
  width:13px;
  height:13px;
  stroke:currentColor;
  stroke-width:2;
  fill:none;
}
.progress-steps{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
}
.p-step{
  flex:1;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  opacity: .65;
}
.p-step.active{
  opacity: 1;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.p-dot{
  width: 26px; height: 26px;
  border-radius: 50%;
  display:grid;
  place-items:center;
  font-weight: 900;
  font-size: 13px;
  background: rgba(255,255,255,.16);
}
.p-step.active .p-dot{
  background: linear-gradient(135deg, rgba(15,95,255,.9), rgba(124,58,237,.9));
}
.p-label{
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

/* Step panels */
.step-panel{ display:none; }
.step-panel.active{ display:block; }

.step-card,
.lead-card{
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
}

.step-title{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.2px;
  margin-bottom: 6px;
}
.step-sub{
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Option cards */
.option-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.option-card{
  position: relative;
  background: #fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 14px 14px 14px 14px;
  cursor:pointer;
  box-shadow: var(--shadow2);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.option-card:hover{ transform: translateY(-1px); border-color: rgba(15,95,255,.35); }
a.option-card-link{
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
}
.option-card.selected{
  border-color: rgba(15,95,255,.55);
  box-shadow: 0 12px 28px rgba(15,95,255,.14);
}
.option-icon{
  width: 38px; height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(15,95,255,.10);
  border: 1px solid rgba(15,95,255,.18);
  margin-bottom: 8px;
}
.option-icon svg{
  width:20px; height:20px;
  fill:none;
  stroke: #0f5fff;
  stroke-width: 1.6;
}
.option-title{
  font-weight: 900;
  margin-bottom: 4px;
}
.option-desc{
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}
.option-badge{
  position:absolute;
  top: 12px; right: 12px;
  font-size: 11px;
  font-weight: 900;
  color: #065f46;
  background: rgba(18,183,106,.12);
  border: 1px solid rgba(18,183,106,.25);
  padding: 6px 10px;
  border-radius: 999px;
}
.option-badge-soon{
  right: 105px;
  color: #92400e;
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.30);
}
.option-card-disabled{
  grid-column: 1 / -1;
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

/* Neighborhood cards */
.neighborhood-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.hood-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 12px;
  cursor:pointer;
  box-shadow: var(--shadow2);
  transition: transform .12s ease, border-color .12s ease;
}
.hood-card:hover{ transform: translateY(-1px); border-color: rgba(15,95,255,.35); }
.hood-card.selected{ border-color: rgba(15,95,255,.55); }
.hood-name{ font-weight: 900; }
.hood-price{ font-weight: 900; color: rgba(15,95,255,.95); margin-top: 2px; }
.hood-note{
  margin-top: 6px;
  font-size: 11px;
  font-weight: 900;
  display:inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(124,58,237,.10);
  border: 1px solid rgba(124,58,237,.20);
  color: rgba(124,58,237,.95);
}

/* Sliders */
.slider-field{
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: var(--radius2);
  padding: 12px;
  margin-top: 10px;
}
.slider-header{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.slider-label{ font-weight: 900; }
.slider-value{
  font-weight: 900;
  color: rgba(15,23,42,.85);
}
.slider-value small{ font-weight: 800; opacity: .7; margin-left: 6px; }
input[type="range"]{
  width:100%;
  accent-color: var(--brand);
}
.slider-marks{
  display:flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(11,18,32,.55);
  margin-top: 6px;
}
.preset-row{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.preset-btn{
  border: 1px solid rgba(15,23,42,.12);
  background: #fff;
  cursor:pointer;
  font-weight: 900;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
}
.preset-btn.active{
  border-color: rgba(15,95,255,.45);
  background: rgba(15,95,255,.08);
}

/* Income & expense cards */
.section-divider{
  display:flex;
  align-items:center;
  gap: 12px;
  margin: 16px 0 10px;
}
.section-divider-line{
  height: 1px;
  flex:1;
  background: rgba(15,23,42,.12);
}
.section-divider-text{
  font-size: 12px;
  font-weight: 900;
  color: rgba(11,18,32,.55);
  text-transform: uppercase;
  letter-spacing: .7px;
}

.income-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.income-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 12px;
  box-shadow: var(--shadow2);
}
.income-card-icon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(15,23,42,.10);
  margin-bottom: 8px;
}
.income-card-icon svg{
  width:18px; height:18px;
  fill:none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.green-icon{ background: rgba(18,183,106,.12); color: #067647; border-color: rgba(18,183,106,.25); }
.red-icon{ background: rgba(240,68,56,.10); color: #b42318; border-color: rgba(240,68,56,.22); }

.income-card-label{ font-weight: 900; margin-bottom: 6px; }
.income-input-wrap{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.10);
}
.dollar-sign{ font-weight: 900; opacity: .65; }
.income-input{
  flex:1;
  border:0;
  outline:none;
  background: transparent;
  font-weight: 900;
  font-size: 16px;
}
.income-suffix{
  font-size: 12px;
  font-weight: 900;
  opacity: .6;
}
.income-card-hint{
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Loan cards */
.loan-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.loan-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 14px;
  cursor:pointer;
  box-shadow: var(--shadow2);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  position: relative;
}
.loan-card:hover{ transform: translateY(-1px); border-color: rgba(15,95,255,.35); }
.loan-card.selected{ border-color: rgba(15,95,255,.55); box-shadow: 0 12px 28px rgba(15,95,255,.14); }
.loan-card-top{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap:10px;
}
.loan-name{ font-weight: 900; }
.loan-rate-badge{
  font-weight: 900;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15,95,255,.10);
  border: 1px solid rgba(15,95,255,.18);
  color: rgba(15,95,255,.95);
}
.loan-desc{
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}
.loan-tag{
  position:absolute;
  right: 12px;
  bottom: 12px;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(247,144,9,.12);
  border: 1px solid rgba(247,144,9,.22);
  color: #7a4b00;
}
.loan-tag.green{
  background: rgba(18,183,106,.12);
  border: 1px solid rgba(18,183,106,.25);
  color: #065f46;
}

.info-box{
  margin-top: 12px;
  background: rgba(15,95,255,.08);
  border: 1px solid rgba(15,95,255,.18);
  color: rgba(15,23,42,.80);
  padding: 12px;
  border-radius: var(--radius2);
  font-size: 13px;
  line-height: 1.4;
}

/* Results */
.results-grid{
  display:grid;
  grid-template-columns: 1.35fr repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.result-hero{
  grid-row: span 2;
  background: linear-gradient(135deg, rgba(15,95,255,.10), rgba(124,58,237,.10));
  border: 1px solid rgba(15,95,255,.18);
  border-radius: var(--radius2);
  padding: 16px;
}
.result-hero-label{
  font-weight: 900;
  opacity: .75;
}
.result-hero-amount{
  font-size: 40px;
  font-weight: 1000;
  letter-spacing: -1px;
  margin-top: 6px;
}
.result-hero-sub{
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}
.result-rate-chip{
  margin-top: 14px;
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(15,23,42,.10);
  width: fit-content;
}
.result-rate-chip strong{ font-weight: 1000; }
.result-rate-chip span{ font-size: 12px; font-weight: 900; opacity: .7; }

.metric-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 14px;
  box-shadow: var(--shadow2);
}
.metric-label{ font-weight: 900; opacity: .72; font-size: 12px; }
.metric-value{ font-weight: 1000; font-size: 22px; margin-top: 6px; }
.metric-sub{ color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Affordability */
.afford-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 14px;
  box-shadow: var(--shadow2);
}
.afford-header{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}
.afford-title{ font-weight: 1000; }
.afford-dti-badge{
  font-weight: 1000;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(15,23,42,.04);
}
.afford-gauge{
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow:hidden;
  background: rgba(15,23,42,.08);
  border: 1px solid rgba(15,23,42,.10);
}
.afford-gauge-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(18,183,106,.9), rgba(247,144,9,.9), rgba(240,68,56,.9));
}
.afford-gauge-marker{
  position:absolute;
  top: -4px;
  width: 2px;
  height: 20px;
  background: rgba(11,18,32,.35);
}
.afford-gauge-marker.m28{ left: 28%; }
.afford-gauge-marker.m36{ left: 36%; }
.afford-gauge-marker.m43{ left: 43%; }
.afford-gauge-marks{
  display:flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(11,18,32,.55);
}
.afford-breakdown{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 12px;
}
.afford-item{
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  padding: 10px;
}
.afford-item-label{ font-weight: 900; font-size: 12px; opacity: .7; }
.afford-item-value{ font-weight: 1000; font-size: 16px; margin-top: 6px; }
.afford-item-value.green{ color: #067647; }
.afford-item-value.red{ color: #b42318; }
.afford-item-sub{ font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.afford-tip{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(15,95,255,.18);
  background: rgba(15,95,255,.06);
}
.afford-tip-icon{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display:grid;
  place-items:center;
  background: rgba(15,95,255,.10);
  border: 1px solid rgba(15,95,255,.18);
  color: rgba(15,95,255,.95);
}

/* FHA Detail Box */
.fha-detail-box{
  background: rgba(15,95,255,.04);
  border: 1px solid rgba(15,95,255,.15);
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 16px;
}
.fha-detail-header{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand, #0f5fff);
  margin-bottom: 14px;
}
.fha-detail-grid{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.fha-detail-item{
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fha-detail-label{
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-muted, #666);
}
.fha-detail-value{
  font-size: 14px;
  font-weight: 700;
}
.fha-detail-value.fha-highlight{
  color: var(--brand, #0f5fff);
}
.fha-detail-note{
  font-size: 11px;
  color: var(--text-muted, #999);
  line-height: 1.5;
  padding-top: 12px;
  border-top: 1px solid rgba(15,95,255,.10);
}

/* ── Refinance-specific styles ── */
#refiTypeGrid{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.refi-savings-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
  margin: 10px 0;
}
.refi-savings-badge.positive{
  background: rgba(18,183,106,.12);
  border: 1px solid rgba(18,183,106,.25);
  color: #065f46;
}
.refi-savings-badge.negative{
  background: rgba(240,68,56,.10);
  border: 1px solid rgba(240,68,56,.22);
  color: #b42318;
}

/* Cost breakdown */
.cost-breakdown{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 14px;
  box-shadow: var(--shadow2);
}
.cost-title{ font-weight: 1000; margin-bottom: 12px; }
.cost-bar-row{ margin-bottom: 10px; }
.cost-bar-header{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 6px;
}
.cost-bar-track{
  height: 10px;
  border-radius: 999px;
  overflow:hidden;
  background: rgba(15,23,42,.08);
  border: 1px solid rgba(15,23,42,.10);
}
.cost-bar-fill{
  height:100%;
  width:0%;
  border-radius: 999px;
}

/* Editable property tax */
.cost-edit-btn{
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted, #999);
  vertical-align: middle;
  margin-left: 4px;
  transition: color .15s;
}
.cost-edit-btn svg{
  width: 13px; height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.cost-edit-btn:hover{ color: var(--brand, #0f5fff); }

.cost-tax-edit{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.cost-tax-input-wrap{
  display: flex;
  align-items: center;
  background: var(--card, #fff);
  border: 1px solid rgba(15,95,255,.30);
  border-radius: 8px;
  padding: 0 10px;
  height: 36px;
  flex: 1;
  max-width: 180px;
}
.cost-tax-input-wrap .dollar-sign{
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #666);
  margin-right: 2px;
}
.cost-tax-input{
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #141414);
  width: 80px;
}
.cost-tax-suffix{
  font-size: 11px;
  color: var(--text-muted, #999);
  margin-left: 2px;
}
.cost-tax-apply{
  background: var(--brand, #0f5fff);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.cost-tax-apply:hover{ background: #0d4fdd; }
.cost-tax-reset{
  background: none;
  color: var(--text-muted, #999);
  border: 1px solid var(--border, rgba(15,23,42,.12));
  border-radius: 8px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.cost-tax-reset:hover{ background: rgba(0,0,0,.03); }

.cost-tax-hint{
  font-size: 11px;
  color: var(--text-muted, #999);
  margin-top: 6px;
  line-height: 1.5;
}
.cost-tax-hint a{
  color: var(--brand, #0f5fff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cost-total{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(15,23,42,.10);
  font-weight: 1000;
}
.cost-total-label{ opacity:.8; }
.cost-total-val{ font-size: 18px; }

/* ── Upfront Cost Summary ── */
.upfront-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.upfront-toggle{
  display:flex;
  justify-content: space-between;
  align-items:center;
  width:100%;
  padding: 14px;
  border:0;
  background:transparent;
  cursor:pointer;
  font-family:inherit;
  color: var(--text);
}
.upfront-toggle-left{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:1000;
  font-size:14px;
}
.upfront-toggle-right{
  display:flex;
  align-items:center;
  gap:8px;
}
.upfront-toggle-amount{
  font-weight:1000;
  font-size:18px;
  color: var(--text);
}
.upfront-chevron{
  transition:transform .2s ease;
}
.upfront-card.open .upfront-chevron{ transform:rotate(180deg); }
.upfront-body{ padding:0 14px 14px; }
.upfront-item{
  display:flex;
  justify-content: space-between;
  padding:8px 0;
  border-bottom:1px solid rgba(15,23,42,.06);
  font-size:13px;
  font-weight:700;
}
.upfront-item-name{ color: rgba(11,18,32,.55); }
.upfront-item-val{ font-weight:900; }
.upfront-total{
  display:flex;
  justify-content: space-between;
  padding-top:10px;
  margin-top:4px;
  border-top:1px solid rgba(15,23,42,.12);
  font-weight:1000;
  font-size:15px;
}
.upfront-note{
  margin-top:10px;
  font-size:11px;
  color: rgba(11,18,32,.45);
  line-height:1.5;
}

/* ── Insurance Monterey County Note ── */
.cost-bar-note{
  display:flex;
  align-items:flex-start;
  gap:6px;
  margin-top:6px;
  padding:8px 10px;
  border-radius:10px;
  background: rgba(247,144,9,.08);
  border:1px solid rgba(247,144,9,.15);
  font-size:11px;
  font-weight:600;
  color:rgba(11,18,32,.70);
  line-height:1.4;
}
.cost-bar-note svg{ flex-shrink:0; margin-top:1px; color: #b45309; }

/* ── Cost Bar Sub (utility breakdown) ── */
.cost-bar-sub{
  font-size:10px;
  color: rgba(11,18,32,.45);
  margin-top:3px;
  font-weight:600;
}

/* ── Cost Layout (bars + donut) ── */
.cost-layout{
  display:grid;
  grid-template-columns: 1fr 200px;
  gap:16px;
  align-items:start;
}
.cost-donut-col{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}
.donut-wrap{
  position:relative;
  width:170px;
  height:170px;
}
.donut-ring{
  width:100%;
  height:100%;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.donut-center{
  width:96px;
  height:96px;
  border-radius:50%;
  background: #fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.donut-center-label{
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.3px;
  opacity:.55;
}
.donut-center-val{
  font-size:15px;
  font-weight:1000;
}
.donut-legend{
  width:100%;
}
.donut-legend-item{
  display:flex;
  align-items:center;
  gap:6px;
  padding:3px 0;
  font-size:11px;
  font-weight:700;
}
.donut-swatch{
  width:8px;
  height:8px;
  border-radius:2px;
  flex-shrink:0;
}
.donut-legend-label{ flex:1; color: rgba(11,18,32,.55); }
.donut-legend-pct{ font-weight:900; }

/* ── Projection Table ── */
.projection-note{
  font-size:11px;
  color: rgba(11,18,32,.45);
  margin-top:8px;
  line-height:1.5;
  font-weight:600;
}

/* ── Maintenance Slider ── */
.maint-slider-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:6px;
}
.maint-slider{
  flex:1;
  height:4px;
  accent-color: #111;
  cursor:pointer;
}
.maint-pct{
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
  min-width:35px;
}
.maint-covers{
  font-size:10px;
  color: rgba(11,18,32,.45);
  margin-top:4px;
  font-weight:600;
}

/* ── Not Included Checklist ── */
.not-included-section{
  margin-top:12px;
  border:1px solid rgba(15,23,42,.08);
  border-radius: var(--radius2);
  overflow:hidden;
}
.not-included-toggle{
  display:flex;
  justify-content:space-between;
  align-items:center;
  width:100%;
  padding:12px 14px;
  border:0;
  background:rgba(15,23,42,.02);
  cursor:pointer;
  font-family:inherit;
  font-weight:900;
  font-size:13px;
  color: var(--text);
}
.not-included-chevron{
  width:14px;height:14px;
  fill:none;stroke:currentColor;stroke-width:2;
  transition:transform .2s;
}
.not-included-section.open .not-included-chevron{ transform:rotate(180deg); }
.not-included-body{ padding:0 14px 14px; }
.not-included-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 0;
  border-bottom:1px solid rgba(15,23,42,.05);
  font-size:12px;
  font-weight:700;
  color: rgba(11,18,32,.55);
}
.not-included-item svg{
  width:14px;height:14px;
  fill:none;stroke:currentColor;stroke-width:1.6;
  flex-shrink:0;
}

/* ── Affordability Confidence Score ── */
.conf-section{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid rgba(15,23,42,.08);
}
.conf-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.conf-title{
  font-weight:900;
  font-size:13px;
}
.conf-badge{
  font-weight:1000;
  font-size:15px;
  color: var(--brand, #0f5fff);
}
.conf-bar-track{
  height:8px;
  border-radius:999px;
  background: rgba(15,23,42,.08);
  overflow:hidden;
}
.conf-bar-fill{
  height:100%;
  border-radius:999px;
  background: linear-gradient(90deg, #f04438, #f79009, #12b76a);
  width:0%;
  transition:width .6s ease;
}
.conf-label{
  margin-top:6px;
  font-size:12px;
  font-weight:700;
  color: rgba(11,18,32,.55);
}

/* Rate table */
.rate-table{
  width:100%;
  border-collapse: collapse;
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  overflow:hidden;
  box-shadow: var(--shadow2);
}
.rate-table thead th{
  text-align:left;
  font-size: 12px;
  padding: 12px;
  background: rgba(15,23,42,.04);
  border-bottom: 1px solid rgba(15,23,42,.10);
}
.rate-table tbody td{
  padding: 12px;
  border-bottom: 1px solid rgba(15,23,42,.08);
  font-weight: 700;
  font-size: 13px;
}
.rate-table tbody tr:last-child td{ border-bottom: none; }
.rate-table .pos{ color: #067647; font-weight: 1000; }
.rate-table .neg{ color: #b42318; font-weight: 1000; }

/* Market Trends */
.market-trends{
  margin-top: 4px;
}
.market-stats-row{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.market-stat-card{
  background: rgba(15,23,42,.02);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.market-stat-label{
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(11,18,32,.50);
  margin-bottom: 4px;
}
.market-stat-value{
  font-size: 20px;
  font-weight: 800;
  color: #111;
  font-family: 'DM Serif Display', serif;
}
.market-stat-sub{
  font-size: 10px;
  color: rgba(11,18,32,.40);
  margin-top: 2px;
}
.market-chart-wrap{
  background: rgba(15,23,42,.02);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  padding: 16px 12px 12px;
  margin-bottom: 10px;
}
.market-chart-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.market-chart-title{
  font-size: 12px;
  font-weight: 700;
  color: rgba(11,18,32,.65);
}
.market-chart{
  position: relative;
  width: 100%;
  min-height: 200px;
}
.market-chart canvas{
  width: 100%;
}
.market-chart-loading{
  text-align: center;
  padding: 80px 0;
  font-size: 12px;
  color: rgba(11,18,32,.35);
}
.market-source{
  text-align: center;
  font-size: 10px;
  color: rgba(11,18,32,.35);
  margin-top: 4px;
}
@media (max-width: 480px){
  .market-stats-row{
    grid-template-columns: 1fr;
  }
  .market-stat-value{
    font-size: 18px;
  }
}

/* Rent vs Buy */
.rvb-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.rvb-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 14px;
  box-shadow: var(--shadow2);
}
.rvb-icon{
  width: 38px; height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  margin-bottom: 8px;
  border: 1px solid rgba(15,23,42,.10);
}
.rvb-card.buy .rvb-icon{ background: rgba(18,183,106,.10); color:#067647; border-color: rgba(18,183,106,.22); }
.rvb-card.rent .rvb-icon{ background: rgba(240,68,56,.08); color:#b42318; border-color: rgba(240,68,56,.20); }
.rvb-icon svg{
  width: 20px; height: 20px;
  fill:none; stroke: currentColor; stroke-width: 1.6;
}
.rvb-label{ font-weight: 1000; opacity: .7; font-size: 12px; }
.rvb-main{ font-weight: 1100; font-size: 28px; margin-top: 6px; }
.rvb-sub{ font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rvb-item{
  display:flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,23,42,.08);
  font-weight: 800;
}

/* Breakeven */
.breakeven-callout{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius2);
  background: rgba(124,58,237,.07);
  border: 1px solid rgba(124,58,237,.18);
}
.breakeven-icon{
  width: 34px; height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(124,58,237,.10);
  border: 1px solid rgba(124,58,237,.18);
  color: rgba(124,58,237,.95);
}
.breakeven-icon svg{
  width: 18px; height: 18px;
  fill:none; stroke: currentColor; stroke-width: 1.6;
}
.breakeven-text{
  font-size: 13px;
  color: rgba(11,18,32,.78);
  line-height: 1.4;
}

/* Programs */
.programs-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}
.program-card{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius2);
  padding: 14px;
  box-shadow: var(--shadow2);
}
.program-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.program-name{ font-weight: 1100; }
.program-badge{
  font-size: 11px;
  font-weight: 1000;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(18,183,106,.12);
  border: 1px solid rgba(18,183,106,.22);
  color: #065f46;
}
.program-desc{ font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.program-list{
  margin: 10px 0 0;
  padding-left: 16px;
  color: rgba(11,18,32,.75);
  font-size: 12px;
}
.program-list li{ margin: 4px 0; }

/* Navigation buttons */
.nav-row{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.btn-back, .btn-next, .btn-cta, .btn-pdf{
  border:0;
  cursor:pointer;
  border-radius: 14px;
  font-weight: 1000;
  padding: 12px 14px;
  transition: transform .12s ease, filter .12s ease;
}
.btn-back{
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.12);
  color: rgba(11,18,32,.85);
}
.btn-next{
  background: linear-gradient(135deg, rgba(15,95,255,.95), rgba(124,58,237,.95));
  color:#fff;
  box-shadow: 0 12px 28px rgba(15,95,255,.20);
}
.btn-back:hover, .btn-next:hover, .btn-cta:hover, .btn-pdf:hover{ transform: translateY(-1px); filter: brightness(1.02); }

/* Lead capture */
.lead-card{
  position: relative;
  overflow:hidden;
}
.lead-urgency{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-weight: 1000;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(247,144,9,.12);
  border: 1px solid rgba(247,144,9,.22);
  color: #7a4b00;
}
.lead-urgency svg{
  width: 14px; height: 14px;
  fill:none; stroke: currentColor; stroke-width: 1.6;
}
.lead-title{
  margin-top: 10px;
  font-size: 24px;
  font-weight: 1100;
  letter-spacing: -.3px;
}
.lead-sub{
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
}
.lead-summary{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 14px;
}
.lead-summary-item{
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  padding: 10px;
}
.lead-summary-label{
  font-size: 11px;
  font-weight: 1000;
  opacity: .65;
}
.lead-summary-val{
  margin-top: 6px;
  font-size: 16px;
  font-weight: 1100;
}
.lead-fields{ margin-top: 12px; }
.lead-fields-row{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}
.field-group label{
  display:block;
  font-size: 12px;
  font-weight: 1000;
  opacity: .75;
  margin-bottom: 6px;
}
.field-group input, .lead-select{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: #fff;
  outline: none;
  font-weight: 800;
}
.field-group input:focus, .lead-select:focus{
  border-color: rgba(15,95,255,.45);
  box-shadow: 0 0 0 4px rgba(15,95,255,.10);
}

/* Credit score grid */
.credit-score-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 8px;
}
.cs-btn{
  background:#fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  padding: 10px 8px;
  cursor:pointer;
  text-align:center;
  box-shadow: var(--shadow2);
}
.cs-btn.selected{
  border-color: rgba(15,95,255,.55);
  background: rgba(15,95,255,.06);
}
.cs-range{ font-weight: 1100; font-size: 12px; }
.cs-label{ font-size: 11px; opacity:.65; font-weight: 900; margin-top: 4px; }

/* CTA buttons under form */
.btn-cta{
  width:100%;
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(18,183,106,.95), rgba(15,95,255,.95));
  color:#fff;
  box-shadow: 0 12px 28px rgba(18,183,106,.16);
}
.btn-pdf{
  width:100%;
  margin-top: 10px;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.12);
  color: rgba(11,18,32,.85);
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}
.btn-pdf svg{
  width: 16px; height: 16px;
  fill:none; stroke: currentColor; stroke-width: 1.8;
}
.btn-chat-listings{
  border-color: rgba(124,58,237,.25);
  background: rgba(124,58,237,.08);
}

/* Trust row */
.trust-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(15,23,42,.10);
}
.trust-item{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(11,18,32,.70);
}
.trust-item svg{
  width: 16px; height: 16px;
  fill:none; stroke: currentColor; stroke-width: 1.6;
}

/* Success panel */
.success-panel{ display:none; text-align:center; }
.success-ring{
  width: 64px; height:64px;
  margin: 4px auto 12px;
  border-radius: 50%;
  display:grid;
  place-items:center;
  background: rgba(18,183,106,.12);
  border: 1px solid rgba(18,183,106,.25);
  color: #067647;
}
.success-ring svg{
  width: 28px; height: 28px;
  fill:none; stroke: currentColor; stroke-width: 2.2;
}
.success-panel h3{ margin: 6px 0 6px; font-weight: 1100; }
.success-panel p{ margin:0; color: var(--text-muted); line-height: 1.5; }

/* Footer note */
.footer-note{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 20px auto 24px;
  font-size: 12px;
  opacity: .75;
  text-align:center;
}
.footer-love{
  display:inline-block;
  margin-top:6px;
  font-style:italic;
  opacity:.85;
}

/* PDF overlay */
.pdf-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  z-index: 100;
}
.pdf-spinner{
  width: min(420px, calc(100% - 40px));
  background: rgba(255,255,255,.92);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.35);
  padding: 18px;
  color: var(--text);
  box-shadow: var(--shadow);
  text-align:center;
}
.pdf-spinner-ring{
  width: 44px; height: 44px;
  margin: 2px auto 10px;
  border-radius: 50%;
  border: 4px solid rgba(15,95,255,.20);
  border-top-color: rgba(15,95,255,.95);
  animation: spin 1s linear infinite;
}
.pdf-spinner-text{
  font-weight: 1000;
  color: rgba(11,18,32,.80);
}
@keyframes spin{ to{ transform: rotate(360deg); } }
@keyframes shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-4px)}40%,80%{transform:translateX(4px)}}
.option-card.shake{ animation: shake .4s ease; border-color:rgba(239,68,68,.50); }

/* =========================================================
   Chat Widget — Optimized UI
   ========================================================= */

/* --- FAB Button --- */
.chat-fab{
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  bottom: 18px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  cursor:pointer;
  background: #111;
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
  z-index: 60;
  display:inline-flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
  transition: box-shadow .2s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.chat-fab:hover{
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
}
.chat-fab svg{
  width: 20px;
  height: 20px;
  fill:none;
  stroke:#fff;
  stroke-width: 2;
  flex-shrink:0;
  transition: transform .2s ease;
}
.chat-fab-label{
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .2px;
}
.chat-fab-ico-x{ display:none; }

/* Attention pulse ring */
.chat-fab::before{
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(17,17,17,.35);
  animation: fabPulse 2.4s ease-out infinite;
  pointer-events: none;
}
.chat-fab.open::before{ animation: none; opacity: 0; }

@keyframes fabPulse{
  0%  { transform: scale(1); opacity: .6; }
  70% { transform: scale(1.35); opacity: 0; }
  100%{ transform: scale(1.35); opacity: 0; }
}

/* Notification badge */
.chat-fab-badge{
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #e74c3c;
  border: 2.5px solid #fff;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  display: grid;
  place-items: center;
  line-height: 1;
  pointer-events: none;
}
.chat-fab.open .chat-fab-badge{ display:none; }

/* When open: collapse to small circle in corner */
.chat-fab.open .chat-fab-ico-msg{ display:none; }
.chat-fab.open .chat-fab-label{ display:none; }
.chat-fab.open .chat-fab-ico-x{ display:block; }
.chat-fab.open svg{ transform: rotate(90deg); }
.chat-fab.open{
  left:auto;
  right:16px;
  margin:0;
  width:52px;
  height:52px;
  padding:0;
  justify-content:center;
}
.chat-fab.open:hover{
  opacity:.9;
}

/* Minimized: small pill in bottom-right */
.chat-fab.minimized{
  left:auto;
  right:16px;
  margin:0;
  padding:0 16px;
  height:42px;
  gap:7px;
}
.chat-fab.minimized:hover{ opacity:.9; }
.chat-fab.minimized .chat-fab-label{
  font-size:12px;
  font-weight:600;
}
.chat-fab.minimized svg{ width:16px; height:16px; }
.chat-fab.minimized::before{ display:none; }

/* --- Chat Panel --- */
.chat-box{
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 20px 60px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.04);

  /* Default: centered popup above FAB */
  left: 16px;
  right: 16px;
  bottom: 80px;
  width: min(500px, calc(100% - 32px));
  margin: 0 auto;
  height: 560px;
  max-height: 75vh;
  border-radius: 20px;

  /* closed state */
  opacity: 0;
  transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: opacity .28s cubic-bezier(.4,0,.2,1),
              transform .28s cubic-bezier(.4,0,.2,1),
              width .32s cubic-bezier(.4,0,.2,1),
              height .32s cubic-bezier(.4,0,.2,1),
              max-width .32s cubic-bezier(.4,0,.2,1),
              border-radius .32s cubic-bezier(.4,0,.2,1),
              box-shadow .28s cubic-bezier(.4,0,.2,1);
}
.chat-box.open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Desktop default: large centered panel (~70% width) --- */
@media (min-width: 769px){
  .chat-box{
    /* Pre-position at center so open animation doesn't slide from left */
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) scale(.97);
    transform-origin: center center;
    width: 70%;
    max-width: 900px;
    height: 80vh;
    max-height: 80vh;
    border-radius: 16px;
  }
  .chat-box.open{
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04);
  }
  .chat-box.open .chat-header{
    padding: 14px 20px;
  }
  .chat-box.open .chat-messages{
    padding: 20px 24px;
  }
  .chat-box.open .chat-input-row{
    padding: 14px 20px;
  }
  .chat-box.open .chat-quick-actions{
    padding: 10px 24px 16px;
  }
  .chat-box.open .chat-msg{
    max-width: 65%;
    font-size: 14px;
  }
  .chat-box.open .chat-msg.bot{
    max-width: 100%;
  }
  .chat-box.open .chat-welcome-text{
    max-width: 400px;
  }
}

/* --- Expanded = right sidebar (~35% width) --- */
@media (min-width: 769px){
  .chat-box.expanded{
    top: 0 !important;
    left: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: translate(0, 0) !important;
    width: 35% !important;
    max-width: 520px !important;
    height: 100dvh !important;
    height: 100vh !important;
    max-height: 100dvh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border-right: none;
    border-top: none;
    border-bottom: none;
    border-left: 1px solid rgba(15,23,42,.10);
    box-shadow: -6px 0 30px rgba(0,0,0,.08) !important;
  }
  .chat-box.expanded .chat-header{
    padding: 14px 16px;
  }
  .chat-box.expanded .chat-messages{
    padding: 16px;
  }
  .chat-box.expanded .chat-input-row{
    padding: 12px 14px;
  }
  .chat-box.expanded .chat-quick-actions{
    padding: 8px 16px 12px;
  }
  .chat-box.expanded .chat-msg{
    max-width: 85%;
    font-size: 13px;
  }
  .chat-box.expanded .chat-msg.bot{
    max-width: 100%;
  }
  .chat-box.expanded .chat-welcome-text{
    max-width: 280px;
  }
}
/* Smaller screens: sidebar takes more room */
@media (min-width: 769px) and (max-width: 1200px){
  .chat-box.expanded{
    width: 42% !important;
    max-width: none !important;
  }
}

.chat-box[hidden]{ display:none !important; }

/* --- Backdrop overlay (desktop centered modal) --- */
.chat-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 59;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s cubic-bezier(.4,0,.2,1);
}
.chat-backdrop.visible{
  opacity: 1;
  pointer-events: auto;
}
/* No backdrop needed in sidebar mode — content is still usable */
.chat-backdrop.sidebar-mode{
  background: rgba(0,0,0,.12);
}

/* Hide FAB when chat is open on desktop */
@media (min-width: 769px){
  .chat-fab.open{
    opacity: 0;
    pointer-events: none;
    transform: scale(.6);
  }
}

body.chat-open{
  overflow: auto !important;
}

/* --- Chat Header (Agentforce style) --- */
.chat-header{
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(15,23,42,.10);
}
.chat-header-text{
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.chat-header-title{
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.chat-header-info{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(15,23,42,.25);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  color: rgba(15,23,42,.45);
  transition: color .15s, border-color .15s;
}
.chat-header-info:hover{
  color: rgba(15,23,42,.70);
  border-color: rgba(15,23,42,.40);
}
.chat-header-info svg{
  width: 14px;
  height: 14px;
}
.chat-header-actions{
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
/* Header action buttons (three-dot, expand, minimize) */
.chat-header-btn{
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s;
  flex-shrink: 0;
  color: rgba(15,23,42,.50);
}
.chat-header-btn:hover{
  background: rgba(15,23,42,.06);
  color: rgba(15,23,42,.75);
}
.chat-header-btn svg{
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
/* Hide old elements */
.chat-header-close{ display: none; }
.chat-header > .live-dot{ display:none; }

/* --- Messages Area --- */
.chat-messages{
  flex:1;
  padding: 16px;
  overflow:auto;
  background: #fafafa;
  scroll-behavior: smooth;
  -webkit-transform: translateZ(0); /* iOS: promote to compositing layer for tap reliability */
}

/* --- Message Bubbles --- */
.chat-msg-row{
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  animation: msgSlideIn .25s cubic-bezier(.4,0,.2,1) both;
}
.chat-msg-row.user{
  flex-direction: row-reverse;
}

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

/* Bot avatar in message row */
.chat-msg-avatar{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.chat-msg-avatar svg{
  width: 13px;
  height: 13px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}
.chat-msg-row.user .chat-msg-avatar{
  display: none;
}

.chat-msg{
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid rgba(15,23,42,.08);
  word-wrap: break-word;
}
.chat-msg.bot{
  max-width: 100%;
  background: #fff;
  border-radius: 4px 16px 16px 16px;
  border-color: rgba(15,23,42,.10);
}
.chat-msg.user{
  margin-left:auto;
  background: #111;
  border-color: rgba(0,0,0,.15);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}

/* Message timestamp (Agentforce style) */
.chat-msg-time{
  font-size: 11px;
  color: rgba(11,18,32,.45);
  margin-top: 4px;
  padding: 0 2px;
}
.chat-msg-row.user .chat-msg-time{
  text-align: right;
}

/* --- Animated Typing Indicator --- */
.chat-typing-row{
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  animation: msgSlideIn .25s cubic-bezier(.4,0,.2,1) both;
}
.chat-typing-bubble{
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 4px 16px 16px 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-typing-dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(11,18,32,.30);
  animation: typingBounce .9s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2){ animation-delay: .15s; }
.chat-typing-dot:nth-child(3){ animation-delay: .30s; }

@keyframes typingBounce{
  0%, 60%, 100%{ transform: translateY(0); opacity: .4; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* Legacy .chat-msg without row wrapper (backwards compat) */
.chat-msg.bot:not(.chat-msg-row .chat-msg){
  margin-bottom: 10px;
}

/* --- Welcome Message --- */
.chat-welcome{
  text-align: center;
  padding: 20px 12px 8px;
}
.chat-welcome-avatar{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #111;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}
.chat-welcome-avatar svg{
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 1.8;
  fill: none;
}
.chat-welcome-title{
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text);
}
.chat-welcome-text{
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
}
.chat-welcome-divider{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(11,18,32,.35);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chat-welcome-divider::before,
.chat-welcome-divider::after{
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(15,23,42,.08);
}

/* --- Quick Action Buttons (Agentforce suggested actions) --- */
.chat-quick-actions{
  display: flex;
  gap: 8px;
  padding: 8px 16px 14px;
  flex-wrap: wrap;
}
.chat-quick-btn{
  border: 1.5px solid #111;
  background: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  color: #111;
}
.chat-quick-btn:hover{
  background: #111;
  color: #fff;
  border-color: #111;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.chat-quick-btn:active{
  transform: translateY(0);
}

/* --- Input Area (Agentforce style: send button inside input) --- */
.chat-input-row{
  display: flex;
  padding: 12px 14px;
  border-top: 1px solid rgba(15,23,42,.08);
  background: #fff;
  align-items: center;
}
.chat-input-wrap{
  display: flex;
  align-items: center;
  flex: 1;
  border-radius: 24px;
  border: 1.5px solid rgba(15,23,42,.15);
  background: #fff;
  padding: 4px 4px 4px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-input-wrap:focus-within{
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}
.chat-input{
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 8px 8px 0;
  font-size: 14px;
  font-weight: 400;
  background: transparent;
  color: var(--text);
}
.chat-input::placeholder{
  color: rgba(11,18,32,.40);
  font-weight: 400;
}
.chat-send{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: #111;
  display: grid;
  place-items: center;
  transition: transform .12s ease, background .15s ease;
  flex-shrink: 0;
}
.chat-send:hover{
  background: #333;
  transform: scale(1.05);
}
.chat-send:active{
  transform: scale(.96);
}
.chat-send svg{
  width: 16px; height: 16px;
  fill: none; stroke: #fff; stroke-width: 2;
}

/* ── Chat Listing Cards ── */
.chat-listings-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 100%;
}
@media (max-width: 480px){
  .chat-listings-grid{
    grid-template-columns: 1fr;
  }
}
.chat-listing-card{
  position: relative;
  border: 1px solid rgba(11,18,32,.10);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s, transform .1s;
  display: flex;
  flex-direction: column;
}
.chat-listing-card:hover{
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.chat-listing-img{
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  background-color: rgba(11,18,32,.04);
}
.chat-listing-info{
  padding: 8px 10px;
  flex: 1;
}
.chat-listing-price{
  font-weight: 700;
  font-size: 15px;
  color: #111;
}
.chat-listing-details{
  font-size: 12px;
  color: rgba(11,18,32,.55);
  margin-top: 2px;
}
.chat-listing-addr{
  font-size: 11px;
  color: rgba(11,18,32,.45);
  margin-top: 2px;
}
.chat-listing-mls{
  font-size: 10px;
  color: rgba(11,18,32,.35);
  margin-top: 2px;
}
.chat-listing-like{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(15,23,42,.15);
  border-radius: 14px;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: rgba(15,23,42,.55);
  cursor: pointer;
  transition: all .2s;
  line-height: 1;
}
.chat-listing-like:hover{
  border-color: #22c55e;
  color: #16a34a;
}
.chat-listing-like.liked{
  background: #dcfce7;
  border-color: #22c55e;
  color: #16a34a;
}
.chat-listing-like svg{
  flex-shrink: 0;
}
.chat-listing-type{
  font-size: 11px;
  color: rgba(11,18,32,.50);
  margin-top: 2px;
}
.chat-listing-badge{
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #fff;
  background: var(--red);
}
.chat-listing-badge.sold{ background: var(--red); }

/* Chat listing card links */
a.chat-listing-card-link{
  text-decoration: none;
  color: inherit;
  display: block;
  -webkit-tap-highlight-color: rgba(0,0,0,.08);
  touch-action: manipulation; /* remove 300ms tap delay on mobile */
  cursor: pointer;
}
a.chat-listing-card-link:active .chat-listing-card{
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  transform: scale(.98);
}

/* Building cards in chat */
.chat-buildings-header{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(11,18,32,.55);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.chat-buildings-icon{
  width: 16px;
  height: 16px;
  fill: rgba(11,18,32,.45);
}
.chat-buildings-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: 100%;
}
.chat-building-card{
  display: flex;
  border: 1px solid rgba(11,18,32,.10);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s;
}
.chat-building-card:hover{
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.chat-building-img-wrap{
  position: relative;
  flex-shrink: 0;
  width: 100px;
}
.chat-building-img{
  display: block;
  width: 100%;
  height: 100%;
  min-height: 80px;
  object-fit: cover;
  background-color: rgba(11,18,32,.04);
}
.chat-building-badge{
  position: absolute;
  bottom: 4px;
  left: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #fff;
  background: rgba(11,18,32,.65);
  backdrop-filter: blur(4px);
}
.chat-building-info{
  padding: 8px 10px;
  flex: 1;
  min-width: 0;
}
.chat-building-name{
  font-weight: 700;
  font-size: 13px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-building-addr{
  font-size: 11px;
  color: rgba(11,18,32,.50);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-building-price{
  font-weight: 600;
  font-size: 12px;
  color: var(--brand);
  margin-top: 3px;
}
.chat-building-stats{
  font-size: 11px;
  color: rgba(11,18,32,.45);
  margin-top: 2px;
}

/* Statistics cards in chat */
.chat-stats-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  max-width: 100%;
}
.chat-stat-card{
  background: #f8f9fb;
  border: 1px solid rgba(11,18,32,.08);
  border-radius: 8px;
  padding: 10px 12px;
}
.chat-stat-label{
  font-weight: 700;
  font-size: 12px;
  color: #111;
  margin-bottom: 6px;
}
.chat-stat-row{
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(11,18,32,.65);
  padding: 2px 0;
}
.chat-stat-row span:last-child{
  font-weight: 600;
  color: #111;
}

/* =========================================================
   SIDE CTA BUTTON (fixed left edge)
   ========================================================= */
.side-cta{
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 50;
  text-decoration: none;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: top left;

  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: #111;
  color: #fff;
  border-radius: 0 0 10px 10px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  transition: background .15s ease, padding .15s ease;
}
.side-cta:hover{
  background: #333;
  padding: 10px 24px;
}
@media (max-width: 768px){
  .side-cta{ display:none; } /* moved to hamburger menu */
}

/* =========================================================
   MONOCHROME OVERRIDE (Black & White UI)
   Paste at END of styles.css
   ========================================================= */

/* 1) Theme tokens → light monochrome */
:root{
  --bg: #ffffff;
  --panel: #ffffff;
  --panel2: #ffffff;
  --card: #ffffff;

  --border: rgba(15,23,42,.12);
  --text: #0b1220;
  --text-muted: rgba(11,18,32,.62);
  --white: #ffffff;

  /* Keep these defined, but we won't use them visually */
  --brand: #111111;
  --brand2: #111111;

  --shadow: 0 14px 40px rgba(0,0,0,.10);
  --shadow2: 0 10px 26px rgba(0,0,0,.08);
}

/* 2) Page background + global text */
body{
  color: var(--text);
  background: #fff !important; /* kills the dark + radial gradients */
}

/* 3) Top bar becomes white like the screenshots */
.top-bar{
  background: rgba(255,255,255,.92) !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(10px);
}

.top-logo{ color: var(--text); }
.top-nav-link{ color:rgba(11,18,32,.45) !important; }
.top-nav-link:hover{ color:var(--text) !important; background:rgba(15,23,42,.05) !important; }
.top-nav-link.active{ color:var(--text) !important; background:rgba(15,23,42,.07) !important; }
.top-nav-soon{ background:rgba(245,158,11,.12) !important; color:#92400e !important; }

/* Language toggle monochrome */
.lang-toggle{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid var(--border) !important;
}
.lang-btn{ color: rgba(11,18,32,.70) !important; }
.lang-btn.active{
  background: #111 !important;
  color: #fff !important;
}

/* Live pill monochrome (no colored glow) */
.live-pill{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid var(--border) !important;
  color: rgba(11,18,32,.80) !important;
}
.live-dot{
  background: #12b76a !important;
  box-shadow: 0 0 0 4px rgba(18,183,106,.18) !important;
}

/* 4) Hero text becomes black */
.hero-eyebrow{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid var(--border) !important;
  color: rgba(11,18,32,.80) !important;
}
.hero h1{ color: var(--text) !important; }
.hero h1 em{
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--text) !important;
}
.hero-sub{ color: rgba(11,18,32,.70) !important; opacity: 1 !important; }
.hero-ai-highlight{
  background: rgba(15,23,42,.03) !important;
  border-color: var(--border) !important;
}
.hero-ai-example{ color: var(--text) !important; }
.hero-ai-notice{ color: rgba(11,18,32,.40) !important; opacity: 1 !important; }

/* 5) Ribbon + progress bars become white/gray */
.rate-ribbon,
.progress-steps{
  background: #fff !important;
  border: 1px solid var(--border) !important;
}
.rate-item{
  background: rgba(15,23,42,.02) !important;
  border: 1px solid rgba(15,23,42,.08) !important;
}
.rate-divider{ background: rgba(15,23,42,.10) !important; }
.rate-source{ color: rgba(11,18,32,.70) !important; }

/* Progress dots monochrome */
.p-dot{
  background: rgba(15,23,42,.08) !important;
  color: rgba(11,18,32,.85) !important;
}
.p-step.active .p-dot{
  background: #111 !important;
  color: #fff !important;
}

/* 6) Main cards */
.step-card,
.lead-card{
  background: #fff !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow2) !important;
  color: var(--text) !important;
}

/* 7) Remove “blue/purple” accents across cards */
.option-icon,
.chat-header-icon,
.afford-tip-icon,
.breakeven-icon{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  color: #111 !important;
}
.option-icon svg{ stroke: #111 !important; }

/* Hoods */
.hood-price{
  color: #111 !important;
}
.hood-note{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  color: rgba(11,18,32,.75) !important;
}

/* Loan rate badge monochrome */
.loan-rate-badge{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  color: rgba(11,18,32,.85) !important;
}

/* Info box monochrome */
.info-box{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  color: rgba(11,18,32,.80) !important;
}

/* Results hero: remove gradient */
.result-hero{
  background: rgba(15,23,42,.03) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
}
.result-rate-chip{
  background: #fff !important;
  border: 1px solid rgba(15,23,42,.10) !important;
}

/* Afford gauge fill: remove multicolor gradient */
.afford-gauge-fill{
  background: #111 !important;
}

/* Program badges monochrome */
.program-badge,
.option-badge,
.loan-tag,
.loan-tag.green,
.lead-urgency{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  color: rgba(11,18,32,.78) !important;
}

/* 8) Buttons: make primary black, secondary light gray */
.btn-next,
.btn-cta{
  background: #111 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.12) !important;
}
.chat-fab,
.chat-send{
  background: #111 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.12) !important;
}

.btn-back,
.btn-pdf{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid rgba(15,23,42,.12) !important;
  color: rgba(11,18,32,.85) !important;
}

/* Gold border for chat listings is handled in the goldBorderSweep block below */

/* 9) Chat panel monochrome (matches Agentforce UI) */
.chat-box{
  background: #fff !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.chat-header{
  background: #fff !important;
  border-bottom: 1px solid rgba(15,23,42,.10) !important;
}
.chat-header-title{ color: var(--text) !important; }
.chat-messages{
  background: #fafafa !important;
}
.chat-input-row{
  background: #fff !important;
}
.chat-msg.bot{
  background: #fff !important;
  border-color: rgba(15,23,42,.10) !important;
}
.chat-msg.user{
  background: #111 !important;
  border-color: rgba(0,0,0,.15) !important;
  color: #fff !important;
}
.chat-quick-btn{
  background: #fff !important;
  border-color: #111 !important;
  color: #111 !important;
}
.chat-quick-btn:hover{
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

/* 10) Footer note readable on white */
.footer-note{
  color: rgba(11,18,32,.60) !important;
  opacity: 1 !important;
}

/* Programs: smaller, cleaner icons */
.program-icon{
  width: 32px;          /* was too big */
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.10);
  flex: 0 0 auto;
}

.program-icon svg{
  width: 16px;          /* icon size */
  height: 16px;
  fill: none;
  stroke: rgba(11,18,32,.80);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

/* If some icons are filled shapes, keep them clean */
.program-icon svg [fill]:not([fill="none"]){
  fill: rgba(11,18,32,.80);
}

/* Optional: tighten spacing in the program card header */
.program-top{
  gap: 10px;
}

/* Subtle moving gold border (reliable) */
.btn-chat-listings{
  position: relative;
  border-radius: 12px;
  border: 2px solid transparent !important;
  background:
    /* warm gold tint fill */
    linear-gradient(135deg, rgba(252,243,210,.70) 0%, rgba(255,249,230,.85) 100%) padding-box,
    /* animated sweeping gold border */
    linear-gradient(
      90deg,
      rgba(242,195,74,0) 0%,
      rgba(242,195,74,.70) 40%,
      rgba(255,215,80,1.00) 50%,
      rgba(242,195,74,.70) 60%,
      rgba(242,195,74,0) 100%
    ) border-box !important;
  background-size: 100% 100%, 240% 100%;
  background-position: 0 0, 0% 0;
  color: rgba(90,60,0,.90) !important;
  animation: goldBorderSweep 2.8s linear infinite;
  box-shadow: 0 2px 14px rgba(242,195,74,.18), inset 0 1px 0 rgba(255,255,255,.60);
}

/* Hover = brighter */
.btn-chat-listings:hover{
  box-shadow: 0 4px 20px rgba(242,195,74,.30), inset 0 1px 0 rgba(255,255,255,.60);
  animation-duration: 2.0s;
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes goldBorderSweep{
  to { background-position: 0 0, 100% 0; }
}

/* Make the chat box a flex column so the input row can sit at the bottom */
#chatBox{
  display:flex;
  flex-direction:column;
}

/* Expanded sidebar #chatBox overrides */
#chatBox.expanded{
  bottom: 0;
}

/* The messages area must be allowed to shrink so it can scroll (min-height:0 is key) */
#chatMessages{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:16px;
  padding-bottom:10px;
}

/* Pin the input row at the bottom */
#chatBox .chat-input-row{
  flex:0 0 auto;
  display:flex;
  padding:12px 14px;
  border-top:1px solid rgba(0,0,0,.06);
  background:#fff;
}

/* Input wrap (send button inside) */
#chatBox .chat-input-wrap{
  display:flex;
  align-items:center;
  flex:1;
  border-radius:24px;
  border:1.5px solid rgba(0,0,0,.12);
  background:#fff;
  padding:4px 4px 4px 16px;
  transition: border-color .15s, box-shadow .15s;
}
#chatBox .chat-input-wrap:focus-within{
  border-color:#111;
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}
#chatBox .chat-input{
  flex:1;
  border:none;
  outline:none;
  padding:8px 8px 8px 0;
  font-size:16px;
  background:transparent;
}
#chatBox .chat-send{
  width:44px;
  height:44px;
  border-radius:50%;
  border:0;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#111;
  transition: transform .12s, background .15s;
}
#chatBox .chat-send:hover{ transform:scale(1.05); background:#333; }
#chatBox .chat-send:active{ transform:scale(.96); }

/* ---- Mobile full-screen chat ---- */
@media (max-width: 600px){
  .chat-box{
    top: auto !important;
    left: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100dvh !important;
    max-height: 100vh !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
  }
  .chat-box.open{
    transform: translateY(0) scale(1) !important;
  }
  /* No backdrop on mobile */
  .chat-backdrop{ display: none !important; }
  .chat-fab{
    bottom: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    padding: 0 20px;
    height: 48px;
  }
  .chat-fab-label{ font-size:13px; }
  .chat-header{
    padding: 14px 16px !important;
    padding-top: max(14px, env(safe-area-inset-top)) !important;
  }
  .chat-input-row{
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }
  body.chat-open{
    overflow: hidden !important;
  }
}

@media (max-width: 640px){
  .top-nav{ display:none; }
  .live-pill{ display:none; }
  .mobile-menu-btn{ display:flex; }
  .top-right .lang-toggle{ display:none; }
  .top-bar{ padding:10px 12px; }
  .top-logo{ font-size:14px; }
  /* Touch target improvements */
  .preset-btn{ padding:11px 16px; font-size:13px; min-height:44px; }
  .lang-btn{ min-height:44px; min-width:44px; padding:8px 12px; font-size:13px; }
  .p-dot{ width:32px; height:32px; font-size:14px; }
  .p-step{ padding:8px 6px; min-height:44px; }
  .cs-btn{ min-height:48px; padding:10px 6px; }
}

/* Responsive */
@media (max-width: 880px){
  .option-grid{ grid-template-columns: 1fr; }
  .loan-grid{ grid-template-columns: 1fr; }
  .neighborhood-grid{ grid-template-columns: 1fr 1fr; }
  .results-grid{ grid-template-columns: 1fr; }
  .result-hero{ grid-row: auto; }
  .fha-detail-grid{ grid-template-columns: 1fr 1fr; }
  #refiTypeGrid{ grid-template-columns: 1fr; }
  .programs-grid{ grid-template-columns: 1fr; }
  .lead-summary{ grid-template-columns: 1fr; }
  .credit-score-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .income-grid{ grid-template-columns: 1fr; }
  .rvb-grid{ grid-template-columns: 1fr; }
  .progress-steps{ gap: 8px; }
  .p-label{ display:none; }
  .cost-layout{ grid-template-columns: 1fr; }
  .cost-donut-col{ order:-1; }
  .donut-wrap{ width:150px; height:150px; }
  .donut-center{ width:84px; height:84px; }

  /* Upfront card */
  .upfront-toggle-amount{ font-size:16px; }

  /* Rate impact & projection tables: horizontal scroll */
  .rate-table{ display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .rate-table thead, .rate-table tbody, .rate-table tr{ display:table; width:100%; table-layout:auto; }

  /* Not included */
  .not-included-item{ font-size:11px; }
}

/* Small phones */
@media (max-width: 480px){
  .step-card, .lead-card{ padding:14px 12px; }
  .result-hero-amount{ font-size:32px; }
  .result-hero-label{ font-size:13px; }
  .step-title{ font-size:19px; }
  .rate-ribbon{ padding:8px 10px; gap:8px; }
  .rate-item{ min-width:0; flex:0 0 auto; padding:6px 8px; }
  .rate-item-val{ font-size:15px; }
  .rate-source{ font-size:10px; }
  .hero{ padding:18px 0 8px; }
  .hero-sub{ font-size:14px; }
  .hero-ai-highlight{ margin-top:14px; padding:12px 16px 14px; }
  .hero-ai-example{ font-size:15px; }

  /* Upfront card */
  .upfront-toggle{ padding:10px 12px; }
  .upfront-toggle-left{ font-size:12px; }
  .upfront-toggle-amount{ font-size:14px; }
  .upfront-body{ padding:0 12px 12px; }
  .upfront-item{ font-size:12px; }
  .upfront-total{ font-size:13px; }

  /* Donut */
  .donut-wrap{ width:130px; height:130px; }
  .donut-center{ width:72px; height:72px; }
  .donut-center-val{ font-size:13px; }
  .donut-legend-item{ font-size:10px; }

  /* Cost bar note */
  .cost-bar-note{ font-size:10px; padding:6px 8px; }

  /* Maintenance slider */
  .maint-pct{ font-size:11px; }
  .maint-covers{ font-size:9px; }

  /* Projection table */
  .rate-table thead th{ padding:8px 6px; font-size:10px; }
  .rate-table tbody td{ padding:8px 6px; font-size:11px; }
  .projection-note{ font-size:10px; }

  /* Not included */
  .not-included-toggle{ padding:10px 12px; font-size:12px; }
  .not-included-item{ font-size:11px; padding:6px 0; }
  .not-included-item svg{ width:12px; height:12px; }

  /* Confidence score */
  .conf-title{ font-size:12px; }
  .conf-badge{ font-size:13px; }
  .conf-label{ font-size:11px; }
}

/* =========================================================
   SALINAS HUSTLE MODE
   ========================================================= */

/* Toggle row */
.hustle-toggle-row{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 10px 14px;
  background: rgba(15,23,42,.03);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
}
.hustle-toggle{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.hustle-toggle input{
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
/* Track */
.hustle-toggle-track{
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(15,23,42,.14);
  position: relative;
  transition: background .2s ease;
  flex-shrink: 0;
}
.hustle-toggle-thumb{
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .2s ease;
}
.hustle-toggle input:checked + .hustle-toggle-track{
  background: #111;
}
.hustle-toggle input:checked + .hustle-toggle-track .hustle-toggle-thumb{
  transform: translateX(18px);
}
/* Label */
.hustle-toggle-label{
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -.1px;
}
.hustle-toggle-hint{
  font-size: 11px;
  color: var(--text-muted);
  width: 100%;
}

/* Hustle notes (motivational helper text) */
.hustle-note{
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  color: var(--text-muted);
  margin: 8px 0 4px;
  animation: hustleFadeIn .3s ease;
}
.hustle-note--center{
  text-align: center;
}
@keyframes hustleFadeIn{
  from{ opacity:0; transform:translateY(-4px); }
  to{ opacity:1; transform:translateY(0); }
}

/* Toast notification */
.hustle-toast{
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  max-width: calc(100% - 40px);
  text-align: center;
}
.hustle-toast.visible{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* =========================================================
   MOBILE HAMBURGER MENU
   ========================================================= */

/* Hamburger button — hidden on desktop */
.mobile-menu-btn{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  margin-left: auto;
  order: 10;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-bar{
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.mobile-menu-btn.open .mobile-menu-bar:nth-child(1){
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.open .mobile-menu-bar:nth-child(2){
  opacity: 0;
}
.mobile-menu-btn.open .mobile-menu-bar:nth-child(3){
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay backdrop */
.mobile-menu-overlay{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 49;
}
.mobile-menu-overlay.open{
  display: block;
}

/* Slide-down menu panel */
.mobile-menu{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 51;
  background: #fff;
  border-bottom: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  padding: 60px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.mobile-menu.open{
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-menu-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: #111;
  font-weight: 700;
  font-size: 15px;
  transition: background .15s ease;
  min-height: 48px;
}
.mobile-menu-item:active{
  background: rgba(15,23,42,.06);
}
.mobile-menu-icon{
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.mobile-menu-disabled{
  opacity: .45;
  pointer-events: none;
}
.mobile-menu-soon{
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245,158,11,.20);
  color: rgba(245,158,11,.90);
  margin-left: auto;
}
.mobile-menu-divider{
  height: 1px;
  background: rgba(15,23,42,.08);
  margin: 8px 0;
}
.mobile-menu-lang{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  color: #666;
}

/* Mobile overrides — must come AFTER component base styles */
@media (max-width: 640px){
  .mobile-menu-btn{ display: flex; }
  /* Loan card badges side-by-side in header row */
  .loan-card-top{ flex-wrap: wrap; }
  .loan-name{ flex: 1; min-width: 0; }
  .loan-tag{ position: static; }
}

/* =========================================================
   INFO ICON TOOLTIPS
   ========================================================= */
.info-tip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  color: rgba(15,23,42,.35);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
}
.info-tip::after{
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #f0f0f0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 10px;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,.20);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 100;
  text-align: left;
}
.info-tip::before{
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a2e;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 101;
}
.info-tip:hover::after,
.info-tip:hover::before,
.info-tip:focus::after,
.info-tip:focus::before{
  opacity: 1;
  visibility: visible;
}
.info-tip.tip-below::after{
  bottom: auto;
  top: calc(100% + 8px);
}
.info-tip.tip-below::before{
  bottom: auto;
  top: calc(100% + 3px);
  border-top-color: transparent;
  border-bottom-color: #1a1a2e;
}
@media (max-width: 480px){
  .info-tip::after{
    max-width: 200px;
    font-size: 11px;
  }
}

/* =========================================================
   DARK MODE
   Activated via [data-theme="dark"] on <html>
   Uses dark gray (not pure black) + off-white text
   ========================================================= */

/* Theme toggle button */
.theme-toggle{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(15,23,42,.04);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover{
  background: rgba(15,23,42,.08);
}
.theme-toggle svg{
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
/* Show/hide sun vs moon icon */
.theme-toggle .ico-sun{ display:none; }
.theme-toggle .ico-moon{ display:block; }

/* Dark mode tokens */
[data-theme="dark"]{
  --bg: #141414;
  --panel: #1c1c1c;
  --panel2: #1c1c1c;
  --card: #1c1c1c;
  --border: rgba(255,255,255,.10);
  --text: #e4e4e4;
  --text-muted: rgba(228,228,228,.55);
  --white: #e4e4e4;
  --brand: #e4e4e4;
  --brand2: #e4e4e4;
  --shadow: 0 14px 40px rgba(0,0,0,.30);
  --shadow2: 0 10px 26px rgba(0,0,0,.25);
  --green: #34d399;
  --red: #f87171;
}

/* Toggle icon swap */
[data-theme="dark"] .theme-toggle .ico-sun{ display:block; }
[data-theme="dark"] .theme-toggle .ico-moon{ display:none; }
[data-theme="dark"] .theme-toggle{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: #e4e4e4;
}
[data-theme="dark"] .theme-toggle:hover{
  background: rgba(255,255,255,.14);
}

/* Body + page background */
[data-theme="dark"] body{
  background: #141414 !important;
  color: #e4e4e4 !important;
}

/* Top bar */
[data-theme="dark"] .top-bar{
  background: rgba(20,20,20,.92) !important;
  border-bottom-color: rgba(255,255,255,.08) !important;
  backdrop-filter: blur(10px);
}
[data-theme="dark"] .top-logo{ color: #e4e4e4; }
[data-theme="dark"] .top-nav-link{ color:rgba(228,228,228,.40) !important; }
[data-theme="dark"] .top-nav-link:hover{ color:#e4e4e4 !important; background:rgba(255,255,255,.08) !important; }
[data-theme="dark"] .top-nav-link.active{ color:#e4e4e4 !important; background:rgba(255,255,255,.10) !important; }
[data-theme="dark"] .top-nav-soon{ background:rgba(245,158,11,.15) !important; color:rgba(245,158,11,.80) !important; }
[data-theme="dark"] .lang-toggle{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .lang-btn{ color: rgba(228,228,228,.65) !important; }
[data-theme="dark"] .lang-btn.active{
  background: #e4e4e4 !important;
  color: #141414 !important;
}
[data-theme="dark"] .live-pill{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.75) !important;
}
[data-theme="dark"] .live-dot{
  background: #34d399 !important;
}

/* Rate ribbon */
[data-theme="dark"] .rate-ribbon,
[data-theme="dark"] .progress-steps{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .rate-item{
  background: rgba(255,255,255,.03) !important;
  border-color: rgba(255,255,255,.06) !important;
}
[data-theme="dark"] .rate-item-label,
[data-theme="dark"] .rate-source{ color: rgba(228,228,228,.65) !important; }
[data-theme="dark"] .rate-item-val{ color: #e4e4e4 !important; }
[data-theme="dark"] .rate-divider{ background: rgba(255,255,255,.08) !important; }

/* Hero */
[data-theme="dark"] .hero-eyebrow{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.70) !important;
}
[data-theme="dark"] .hero h1{ color: #e4e4e4 !important; }
[data-theme="dark"] .hero h1 em{ color: #e4e4e4 !important; }
[data-theme="dark"] .hero-sub{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .hero-ai-highlight{
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .hero-ai-example{ color: rgba(228,228,228,.90) !important; }
[data-theme="dark"] .hero-ai-notice{ color: rgba(228,228,228,.35) !important; }
[data-theme="dark"] .chat-sample-notice{ color: rgba(228,228,228,.35) !important; }

/* Progress dots */
[data-theme="dark"] .start-over{ color:rgba(228,228,228,.35) !important; }
[data-theme="dark"] .start-over:hover{ color:rgba(228,228,228,.65) !important; }
[data-theme="dark"] .p-dot{
  background: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.75) !important;
}
[data-theme="dark"] .p-step.active .p-dot{
  background: #e4e4e4 !important;
  color: #141414 !important;
}
[data-theme="dark"] .p-step.done .p-dot{
  background: rgba(255,255,255,.14) !important;
  color: rgba(228,228,228,.80) !important;
}
[data-theme="dark"] .p-label{ color: rgba(228,228,228,.60) !important; }

/* Cards */
[data-theme="dark"] .step-card,
[data-theme="dark"] .lead-card{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.08) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .step-title,
[data-theme="dark"] .step-sub{ color: #e4e4e4 !important; }
[data-theme="dark"] .step-sub{ color: rgba(228,228,228,.55) !important; }

/* Option cards, hood cards, loan cards */
[data-theme="dark"] .option-card,
[data-theme="dark"] .hood-card,
[data-theme="dark"] .loan-card{
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .option-card:hover,
[data-theme="dark"] .hood-card:hover,
[data-theme="dark"] .loan-card:hover{
  border-color: rgba(255,255,255,.20) !important;
}
[data-theme="dark"] .option-card.selected,
[data-theme="dark"] .hood-card.selected,
[data-theme="dark"] .loan-card.selected{
  border-color: rgba(228,228,228,.45) !important;
  background: rgba(255,255,255,.07) !important;
}
[data-theme="dark"] .option-icon{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .option-icon svg{ stroke: #e4e4e4 !important; }
[data-theme="dark"] .option-title{ color: #e4e4e4 !important; }
[data-theme="dark"] .option-desc{ color: rgba(228,228,228,.60) !important; }
[data-theme="dark"] .hood-name{ color: #e4e4e4 !important; }
[data-theme="dark"] .hood-price{ color: #e4e4e4 !important; }
[data-theme="dark"] .hood-note{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.60) !important;
}
[data-theme="dark"] .loan-name{ color: #e4e4e4 !important; }
[data-theme="dark"] .loan-desc{ color: rgba(228,228,228,.60) !important; }
[data-theme="dark"] .loan-rate-badge{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.80) !important;
}
[data-theme="dark"] .loan-tag,
[data-theme="dark"] .loan-tag.green,
[data-theme="dark"] .option-badge{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.65) !important;
}

/* Sliders */
[data-theme="dark"] .slider-label,
[data-theme="dark"] .slider-value{ color: #e4e4e4 !important; }
[data-theme="dark"] .slider-marks span{ color: rgba(228,228,228,.50) !important; }
[data-theme="dark"] .preset-btn{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.70) !important;
}
[data-theme="dark"] .preset-btn.active{
  background: #e4e4e4 !important;
  color: #141414 !important;
  border-color: #e4e4e4 !important;
}
[data-theme="dark"] input[type="range"]{
  accent-color: #e4e4e4;
}

/* Income cards */
[data-theme="dark"] .income-card{
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .income-card-label{ color: #e4e4e4 !important; }
[data-theme="dark"] .income-card-hint{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .income-input{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .dollar-sign,
[data-theme="dark"] .income-suffix{ color: rgba(228,228,228,.55) !important; }

/* Section dividers */
[data-theme="dark"] .section-divider-line{ background: rgba(255,255,255,.10) !important; }
[data-theme="dark"] .section-divider-text{ color: rgba(228,228,228,.65) !important; }

/* Info box */
[data-theme="dark"] .info-box{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.80) !important;
}

/* Results */
[data-theme="dark"] .result-hero{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .result-hero-label,
[data-theme="dark"] .result-hero-sub{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .result-hero-amount{ color: #e4e4e4 !important; }
[data-theme="dark"] .result-rate-chip{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(228,228,228,.85) !important;
}
[data-theme="dark"] .metric-card{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .metric-label{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .metric-value{ color: #e4e4e4 !important; }
[data-theme="dark"] .metric-sub{ color: rgba(228,228,228,.55) !important; }

/* FHA detail box dark */
[data-theme="dark"] .fha-detail-box{
  background: rgba(15,95,255,.06);
  border-color: rgba(15,95,255,.20);
}
[data-theme="dark"] .fha-detail-note{
  border-top-color: rgba(15,95,255,.15);
  color: #777;
}
/* Refi dark mode */
[data-theme="dark"] .refi-savings-badge.positive{
  background: rgba(52,211,153,.10);
  border-color: rgba(52,211,153,.20);
  color: #34d399;
}
[data-theme="dark"] .refi-savings-badge.negative{
  background: rgba(248,113,113,.10);
  border-color: rgba(248,113,113,.20);
  color: #f87171;
}

/* Cost breakdown */
[data-theme="dark"] .cost-breakdown{
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .cost-title{ color: #e4e4e4 !important; }
[data-theme="dark"] .afford-item{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .afford-item-label{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .afford-item-value{ color: #e4e4e4 !important; }
[data-theme="dark"] .afford-item-sub{ color: rgba(228,228,228,.45) !important; }
[data-theme="dark"] .cost-bar-name{ color: rgba(228,228,228,.80) !important; }
[data-theme="dark"] .cost-bar-val{ color: #e4e4e4 !important; }
[data-theme="dark"] .cost-bar-track{ background: rgba(255,255,255,.08) !important; }
[data-theme="dark"] .cost-bar-fill{ background: #e4e4e4 !important; }
[data-theme="dark"] #barTax{ background: rgba(228,228,228,.60) !important; }
[data-theme="dark"] #barIns{ background: rgba(228,228,228,.45) !important; }
[data-theme="dark"] #barPMI{ background: var(--red) !important; }
[data-theme="dark"] .cost-tax-input-wrap{
  background: rgba(255,255,255,.04);
  border-color: rgba(15,95,255,.40);
}
[data-theme="dark"] .cost-tax-input{ color: #e4e4e4; }
[data-theme="dark"] .cost-tax-reset{
  border-color: rgba(255,255,255,.10);
  color: #aaa;
}
[data-theme="dark"] .cost-tax-reset:hover{ background: rgba(255,255,255,.06); }
[data-theme="dark"] #barMaint{ background: rgba(228,228,228,.30) !important; }
[data-theme="dark"] .cost-total{
  border-top-color: rgba(255,255,255,.12) !important;
  color: #e4e4e4 !important;
}

/* Upfront card dark */
[data-theme="dark"] .upfront-card{
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .upfront-toggle{ color: #e4e4e4 !important; }
[data-theme="dark"] .upfront-toggle-amount{ color: #e4e4e4 !important; }
[data-theme="dark"] .upfront-item{ border-color: rgba(255,255,255,.06) !important; }
[data-theme="dark"] .upfront-item-name{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .upfront-item-val{ color: #e4e4e4 !important; }
[data-theme="dark"] .upfront-total{ border-top-color: rgba(255,255,255,.10) !important; color: #e4e4e4 !important; }
[data-theme="dark"] .upfront-note{ color: rgba(228,228,228,.40) !important; }

/* Insurance note dark */
[data-theme="dark"] .cost-bar-note{
  background: rgba(247,144,9,.06) !important;
  border-color: rgba(247,144,9,.12) !important;
  color: rgba(228,228,228,.70) !important;
}
[data-theme="dark"] .cost-bar-note svg{ color: #f59e0b !important; }

/* Cost bar sub dark */
[data-theme="dark"] .cost-bar-sub{ color: rgba(228,228,228,.40) !important; }

/* Donut dark */
[data-theme="dark"] .donut-center{ background: #1c1c1c !important; }
[data-theme="dark"] .donut-center-val{ color: #e4e4e4 !important; }
[data-theme="dark"] .donut-legend-label{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .donut-legend-pct{ color: #e4e4e4 !important; }

/* Projection note dark */
[data-theme="dark"] .projection-note{ color: rgba(228,228,228,.40) !important; }

/* Utility bar dark */
[data-theme="dark"] #barUtil{ background: #8b5cf6 !important; }

/* Maintenance slider dark */
[data-theme="dark"] .maint-slider{ accent-color: #e4e4e4; }
[data-theme="dark"] .maint-pct{ color: #e4e4e4 !important; }
[data-theme="dark"] .maint-covers{ color: rgba(228,228,228,.40) !important; }

/* Not included dark */
[data-theme="dark"] .not-included-section{ border-color: rgba(255,255,255,.06) !important; }
[data-theme="dark"] .not-included-toggle{ background: rgba(255,255,255,.03) !important; color: #e4e4e4 !important; }
[data-theme="dark"] .not-included-item{ border-color: rgba(255,255,255,.05) !important; color: rgba(228,228,228,.55) !important; }

/* Confidence score dark */
[data-theme="dark"] .conf-section{ border-top-color: rgba(255,255,255,.08) !important; }
[data-theme="dark"] .conf-title{ color: #e4e4e4 !important; }
[data-theme="dark"] .conf-badge{ color: #60a5fa !important; }
[data-theme="dark"] .conf-bar-track{ background: rgba(255,255,255,.08) !important; }
[data-theme="dark"] .conf-label{ color: rgba(228,228,228,.50) !important; }

/* Rate table */
[data-theme="dark"] .rate-table{
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .rate-table th{
  background: rgba(255,255,255,.08) !important;
  color: rgba(228,228,228,.75) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .rate-table td{
  border-color: rgba(255,255,255,.08) !important;
  color: rgba(228,228,228,.85) !important;
}
[data-theme="dark"] .rate-table tr.active-row{
  background: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .rate-table tr.active-row td{
  color: #e4e4e4 !important;
  font-weight: 700;
}

/* Market Trends dark mode */
[data-theme="dark"] .market-stat-card{
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .market-stat-label{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .market-stat-value{ color: #e4e4e4 !important; }
[data-theme="dark"] .market-stat-sub{ color: rgba(228,228,228,.35) !important; }
[data-theme="dark"] .market-chart-wrap{
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .market-chart-title{ color: rgba(228,228,228,.65) !important; }
[data-theme="dark"] .market-chart-loading{ color: rgba(228,228,228,.35) !important; }
[data-theme="dark"] .market-source{ color: rgba(228,228,228,.35) !important; }

/* Rent vs Buy */
[data-theme="dark"] .rvb-card{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .rvb-label{ color: #e4e4e4 !important; }
[data-theme="dark"] .rvb-amount{ color: #e4e4e4 !important; }
[data-theme="dark"] .rvb-sub,
[data-theme="dark"] .rvb-item span:first-child{ color: rgba(228,228,228,.65) !important; }
[data-theme="dark"] .rvb-item span:last-child{ color: #e4e4e4 !important; }

/* Affordability */
[data-theme="dark"] .afford-card{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .afford-label{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .afford-value{ color: #e4e4e4 !important; }
[data-theme="dark"] .afford-gauge{
  background: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .afford-gauge-fill{ background: #e4e4e4 !important; }
[data-theme="dark"] .afford-tip{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .afford-tip-icon{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .afford-tip p{ color: rgba(228,228,228,.70) !important; }

/* Programs */
[data-theme="dark"] .program-card{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .program-card h4,
[data-theme="dark"] .program-name{ color: #e4e4e4 !important; }
[data-theme="dark"] .program-card p,
[data-theme="dark"] .program-desc{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .program-icon{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
}
[data-theme="dark"] .program-icon svg{ stroke: rgba(228,228,228,.85) !important; }
[data-theme="dark"] .program-badge{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(228,228,228,.80) !important;
}
[data-theme="dark"] .program-highlight{
  color: #e4e4e4 !important;
}
[data-theme="dark"] .breakeven-callout{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .breakeven-icon{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .breakeven-callout p{ color: rgba(228,228,228,.70) !important; }

/* Lead form */
[data-theme="dark"] .lead-urgency{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(228,228,228,.85) !important;
}
[data-theme="dark"] .lead-title{ color: #e4e4e4 !important; }
[data-theme="dark"] .lead-sub{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .lead-summary-item{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .lead-summary-label{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .lead-summary-val{ color: #e4e4e4 !important; }
[data-theme="dark"] .field-group label{ color: rgba(228,228,228,.75) !important; }
[data-theme="dark"] .field-group input,
[data-theme="dark"] .lead-select{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .field-group input::placeholder{
  color: rgba(228,228,228,.35) !important;
}
[data-theme="dark"] .lead-select option{
  background: #1c1c1c !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .cs-label{ color: rgba(228,228,228,.75) !important; }
[data-theme="dark"] .cs-btn{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(228,228,228,.80) !important;
}
[data-theme="dark"] .cs-btn .cs-range{ color: rgba(228,228,228,.80) !important; }
[data-theme="dark"] .cs-btn .cs-label-text{ color: rgba(228,228,228,.60) !important; }
[data-theme="dark"] .cs-btn.selected{
  background: #e4e4e4 !important;
  color: #141414 !important;
  border-color: #e4e4e4 !important;
}
[data-theme="dark"] .cs-btn.selected .cs-range,
[data-theme="dark"] .cs-btn.selected .cs-label-text{ color: #141414 !important; }

/* Buttons dark mode */
[data-theme="dark"] .btn-next,
[data-theme="dark"] .btn-cta{
  background: #e4e4e4 !important;
  color: #141414 !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.30) !important;
}
[data-theme="dark"] .btn-back{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.14) !important;
  color: rgba(228,228,228,.85) !important;
}
[data-theme="dark"] .btn-pdf{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.14) !important;
  color: rgba(228,228,228,.85) !important;
}
[data-theme="dark"] .btn-pdf svg{ stroke: rgba(228,228,228,.85) !important; }

/* Trust row */
[data-theme="dark"] .trust-row{ border-top-color: rgba(255,255,255,.10) !important; }
[data-theme="dark"] .trust-item{ color: rgba(228,228,228,.70) !important; }
[data-theme="dark"] .trust-item svg{ stroke: rgba(228,228,228,.55) !important; }

/* Success panel */
[data-theme="dark"] .success-ring{
  background: rgba(52,211,153,.12) !important;
  border-color: rgba(52,211,153,.25) !important;
}

/* Footer */
[data-theme="dark"] .footer-note{
  color: rgba(228,228,228,.60) !important;
}
[data-theme="dark"] .footer-love{
  color: rgba(228,228,228,.50) !important;
}

/* Chat widget dark mode */
[data-theme="dark"] .chat-fab{
  background: #e4e4e4 !important;
  color: #141414 !important;
}
[data-theme="dark"] .chat-fab svg{ stroke: #141414 !important; }
[data-theme="dark"] .chat-fab-label{ color: #141414 !important; }
[data-theme="dark"] .chat-fab-badge{
  background: #e74c3c !important;
  border-color: #141414 !important;
  color: #fff !important;
}
/* Info-tip tooltips — dark mode */
[data-theme="dark"] .info-tip{ color: rgba(228,228,228,.35); }
[data-theme="dark"] .info-tip::after{
  background: #2a2a2a;
  color: #e4e4e4;
  box-shadow: 0 8px 24px rgba(0,0,0,.40);
}
[data-theme="dark"] .info-tip::before{ border-top-color: #2a2a2a; }
[data-theme="dark"] .info-tip.tip-below::before{
  border-top-color: transparent;
  border-bottom-color: #2a2a2a;
}
/* Mobile menu — dark mode */
[data-theme="dark"] .mobile-menu{
  background: #1c1c1c;
  border-bottom-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .mobile-menu-item{ color: #e4e4e4; }
[data-theme="dark"] .mobile-menu-item:active{ background: rgba(255,255,255,.08); }
[data-theme="dark"] .mobile-menu-divider{ background: rgba(255,255,255,.08); }
[data-theme="dark"] .mobile-menu-lang{ color: rgba(228,228,228,.55); }
[data-theme="dark"] .mobile-menu-overlay{ background: rgba(0,0,0,.6); }
[data-theme="dark"] .chat-box{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.10) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .chat-header{
  background: #1c1c1c !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .chat-header-title{ color: #e4e4e4 !important; }
[data-theme="dark"] .chat-header-info{
  border-color: rgba(255,255,255,.25) !important;
  color: rgba(228,228,228,.55) !important;
}
[data-theme="dark"] .chat-header-btn{
  color: rgba(228,228,228,.55) !important;
}
[data-theme="dark"] .chat-header-btn:hover{
  background: rgba(255,255,255,.10) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .chat-header-btn svg{ stroke: currentColor !important; }
[data-theme="dark"] .chat-messages{
  background: #141414 !important;
}
[data-theme="dark"] .chat-msg.bot{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.08) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .chat-msg.user{
  background: #e4e4e4 !important;
  color: #141414 !important;
  border-color: rgba(255,255,255,.12) !important;
}
[data-theme="dark"] .chat-msg-avatar{
  background: rgba(255,255,255,.10);
}
[data-theme="dark"] .chat-msg-avatar svg{ stroke: #e4e4e4 !important; }
[data-theme="dark"] .chat-welcome-avatar{ background: rgba(255,255,255,.10) !important; }
[data-theme="dark"] .chat-welcome-title{ color: #e4e4e4 !important; }
[data-theme="dark"] .chat-welcome-text{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .chat-quick-btn{
  background: transparent !important;
  border-color: rgba(228,228,228,.35) !important;
  color: rgba(228,228,228,.75) !important;
}
[data-theme="dark"] .chat-quick-btn:hover{
  background: #e4e4e4 !important;
  color: #141414 !important;
  border-color: #e4e4e4 !important;
}
[data-theme="dark"] .chat-input-row{
  background: #1c1c1c !important;
  border-top-color: rgba(255,255,255,.06) !important;
}
[data-theme="dark"] .chat-input-wrap,
[data-theme="dark"] #chatBox .chat-input-wrap{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
}
[data-theme="dark"] .chat-input-wrap:focus-within,
[data-theme="dark"] #chatBox .chat-input-wrap:focus-within{
  border-color: rgba(228,228,228,.35) !important;
  box-shadow: 0 0 0 3px rgba(228,228,228,.08) !important;
}
[data-theme="dark"] .chat-input,
[data-theme="dark"] #chatBox .chat-input{
  background: transparent !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .chat-send,
[data-theme="dark"] #chatBox .chat-send{
  background: #e4e4e4 !important;
}
[data-theme="dark"] .chat-send svg{ stroke: #141414 !important; }
[data-theme="dark"] .chat-typing-bubble{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .chat-typing-dot{ background: rgba(228,228,228,.30) !important; }

/* Chat listing cards dark mode */
[data-theme="dark"] .chat-listing-card{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .chat-listing-img{
  background-color: rgba(255,255,255,.06);
}
[data-theme="dark"] .chat-listing-price{ color: #e4e4e4 !important; }
[data-theme="dark"] .chat-listing-details{ color: rgba(228,228,228,.65) !important; }
[data-theme="dark"] .chat-listing-addr{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .chat-listing-mls{ color: rgba(228,228,228,.40) !important; }
[data-theme="dark"] .chat-listing-type{ color: rgba(228,228,228,.50) !important; }
[data-theme="dark"] .chat-listing-like{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(228,228,228,.5) !important;
}
[data-theme="dark"] .chat-listing-like:hover{
  border-color: #22c55e !important;
  color: #22c55e !important;
}
[data-theme="dark"] .chat-listing-like.liked{
  background: rgba(34,197,94,.15) !important;
  border-color: #22c55e !important;
  color: #22c55e !important;
}
/* Chat building cards dark mode */
[data-theme="dark"] .chat-buildings-header{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .chat-buildings-icon{ fill: rgba(228,228,228,.45) !important; }
[data-theme="dark"] .chat-building-card{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .chat-building-img{ background-color: rgba(255,255,255,.06); }
[data-theme="dark"] .chat-building-name{ color: #e4e4e4 !important; }
[data-theme="dark"] .chat-building-addr{ color: rgba(228,228,228,.55) !important; }
[data-theme="dark"] .chat-building-price{ color: var(--brand) !important; }
[data-theme="dark"] .chat-building-stats{ color: rgba(228,228,228,.45) !important; }
[data-theme="dark"] .chat-building-badge{ background: rgba(255,255,255,.20) !important; }

[data-theme="dark"] .chat-stat-card{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.10) !important;
}
[data-theme="dark"] .chat-stat-label{ color: #e4e4e4 !important; }
[data-theme="dark"] .chat-stat-row{ color: rgba(228,228,228,.65) !important; }
[data-theme="dark"] .chat-stat-row span:last-child{ color: #e4e4e4 !important; }

/* Side CTA dark mode */
[data-theme="dark"] .side-cta{
  background: #e4e4e4 !important;
  color: #141414 !important;
}
[data-theme="dark"] .side-cta:hover{
  background: #d0d0d0 !important;
}

/* PDF overlay */
[data-theme="dark"] .pdf-spinner{
  background: #1c1c1c !important;
  border-color: rgba(255,255,255,.10) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .pdf-spinner-ring{
  border-color: rgba(228,228,228,.15) !important;
  border-top-color: #e4e4e4 !important;
}

/* Gold chat listings button in dark mode */
[data-theme="dark"] .btn-chat-listings{
  background:
    linear-gradient(135deg, rgba(242,195,74,.15), rgba(218,165,32,.15)) padding-box,
    linear-gradient(135deg, rgba(242,195,74,.50), rgba(218,165,32,.50)) border-box !important;
  border: 2px solid transparent !important;
  color: #f2c34a !important;
  box-shadow: 0 2px 14px rgba(242,195,74,.12) !important;
}
[data-theme="dark"] .btn-chat-listings:hover{
  box-shadow: 0 4px 20px rgba(242,195,74,.22) !important;
}
[data-theme="dark"] .btn-chat-listings svg{ stroke: #f2c34a !important; }

/* Hustle Mode dark overrides */
[data-theme="dark"] .hustle-toggle-row{
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .hustle-toggle-track{
  background: rgba(255,255,255,.12) !important;
}
[data-theme="dark"] .hustle-toggle input:checked + .hustle-toggle-track{
  background: #e4e4e4 !important;
}
[data-theme="dark"] .hustle-toggle-thumb{
  background: #1c1c1c !important;
}
[data-theme="dark"] .hustle-toggle input:checked + .hustle-toggle-track .hustle-toggle-thumb{
  background: #141414 !important;
}
[data-theme="dark"] .hustle-toast{
  background: #e4e4e4 !important;
  color: #141414 !important;
}

/* ─── EN/ES Language Toggle ─────────────────────────────────────── */
.chat-lang-toggle{
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 20px;
  padding: 2px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  line-height: 1;
  vertical-align: middle;
  margin-right: 2px;
}
.chat-lang-opt{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  color: rgba(15,23,42,.45);
  transition: background .2s, color .2s;
  user-select: none;
}
.chat-lang-opt.active{
  background: #111;
  color: #fff;
}
.chat-lang-toggle:hover .chat-lang-opt:not(.active){
  color: rgba(15,23,42,.7);
}

/* Dark mode */
[data-theme="dark"] .chat-lang-toggle{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
}
[data-theme="dark"] .chat-lang-opt{
  color: rgba(228,228,228,.40) !important;
}
[data-theme="dark"] .chat-lang-opt.active{
  background: #e4e4e4 !important;
  color: #141414 !important;
}
[data-theme="dark"] .chat-lang-toggle:hover .chat-lang-opt:not(.active){
  color: rgba(228,228,228,.65) !important;
}

/* ─── Inline Lead Capture Form ──────────────────────────────────── */
.chat-lead-form{
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 0;
}
.chat-lead-form label{
  font-size: 12px;
  font-weight: 600;
  color: rgba(15,23,42,.65);
  margin-bottom: -6px;
}
.chat-lead-input{
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(15,23,42,.15);
  border-radius: 8px;
  font-size: 16px;
  min-height: 44px;
  font-family: 'DM Sans', sans-serif;
  background: #fafafa;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.chat-lead-input:focus{
  border-color: rgba(15,23,42,.35);
}
.chat-lead-input::placeholder{
  color: rgba(15,23,42,.35);
}
.chat-lead-submit{
  padding: 10px 16px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background .2s;
  margin-top: 2px;
}
.chat-lead-submit:hover{
  background: #333;
}
.chat-lead-success{
  text-align: center;
  padding: 12px 8px;
  font-size: 14px;
  color: #16a34a;
  font-weight: 600;
}

/* Dark mode */
[data-theme="dark"] .chat-lead-form label{
  color: rgba(228,228,228,.55) !important;
}
[data-theme="dark"] .chat-lead-input{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #e4e4e4 !important;
}
[data-theme="dark"] .chat-lead-input:focus{
  border-color: rgba(255,255,255,.30) !important;
}
[data-theme="dark"] .chat-lead-input::placeholder{
  color: rgba(228,228,228,.30) !important;
}
[data-theme="dark"] .chat-lead-submit{
  background: #e4e4e4 !important;
  color: #141414 !important;
}
[data-theme="dark"] .chat-lead-submit:hover{
  background: #ccc !important;
}
[data-theme="dark"] .chat-lead-success{
  color: #4ade80 !important;
}

/* ── Phase 3: Amortization Embed + Payoff Embed ────────────────────── */
.milestone-row{ display:flex; gap:1rem; margin:1rem 0 1.5rem; flex-wrap:wrap; }
.milestone-card{ flex:1; min-width:200px; padding:1rem; border:1px solid var(--border); border-radius:8px; background:var(--card); display:flex; flex-direction:column; gap:0.25rem; }
.milestone-icon{ font-size:1.25rem; line-height:1; }
.milestone-card strong{ font-size:1.1rem; color:var(--text); }

.amort-preview-table td:first-child{ text-align:left; font-weight:500; }

.payoff-input-row{ display:flex; gap:1rem; align-items:flex-end; flex-wrap:wrap; margin:1rem 0; }
.payoff-input-row > div{ flex:1; min-width:180px; }
.payoff-input-row label{ display:block; font-size:0.85rem; font-weight:500; margin-bottom:0.25rem; color:var(--text-muted); }
.payoff-input-row input[type="number"]{ width:100%; padding:0.6rem 0.75rem; border:1px solid var(--border); border-radius:6px; font-size:1rem; background:var(--card); color:var(--text); }
.payoff-input-row input[type="number"]:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(15,95,255,.12); }
.toggle-label{ display:flex; align-items:center; gap:0.5rem; cursor:pointer; min-width:180px; padding-bottom:0.6rem; }
.toggle-label input[type="checkbox"]{ width:1rem; height:1rem; cursor:pointer; accent-color:var(--brand); }
.biweekly-equiv{ font-size:0.8rem; color:var(--text-muted); font-style:italic; }

.payoff-impact{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; margin:1rem 0; padding:1.25rem; background:var(--card); border:1px solid var(--border); border-radius:8px; }
.impact-stat{ display:flex; flex-direction:column; gap:0.25rem; text-align:center; }
.impact-label{ font-size:0.8rem; color:var(--text-muted); font-weight:500; text-transform:uppercase; letter-spacing:0.03em; }
.impact-value{ font-size:1.35rem; font-weight:700; color:var(--text); }

.link-cta{ display:inline-block; margin:1rem 0 1.5rem; padding:0.6rem 1.25rem; background:#111; color:#fff; text-decoration:none; border-radius:6px; font-size:0.9rem; font-weight:600; transition:background 0.2s,transform 0.15s; cursor:pointer; border:none; }
.link-cta:hover{ background:#333; transform:translateY(-1px); }
[data-theme="dark"] .link-cta{ background:#e4e4e4; color:#111; }
[data-theme="dark"] .link-cta:hover{ background:#fff; }

@media(max-width:600px){
  .milestone-row{ flex-direction:column; }
  .payoff-impact{ grid-template-columns:1fr; }
  .payoff-input-row{ flex-direction:column; }
}

/* ═══ Phase 3 Modals ═══ */
.phase3-modal{ display:none; position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,0.5); overflow-y:auto; padding:2rem 1rem; }
.phase3-modal.active{ display:flex; justify-content:center; align-items:flex-start; }
.phase3-modal__content{ background:var(--card); border-radius:12px; max-width:860px; width:100%; padding:2rem; box-shadow:0 20px 60px rgba(0,0,0,0.3); max-height:90vh; overflow-y:auto; position:relative; }
.phase3-modal__header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:1.5rem; border-bottom:1px solid var(--border); padding-bottom:1rem; }
.phase3-modal__header h2{ font-family:'DM Serif Display',serif; font-size:1.4rem; margin:0; color:var(--text); }
.phase3-modal__close{ background:none; border:none; font-size:2rem; cursor:pointer; color:var(--text-muted); line-height:1; padding:0 0.25rem; transition:color 0.15s; }
.phase3-modal__close:hover{ color:var(--text); }
.phase3-modal__summary{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; margin-bottom:1.5rem; }
.phase3-modal__summary-card{ background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:0.75rem 1rem; text-align:center; }
.phase3-modal__summary-card .label{ font-size:0.75rem; color:var(--text-muted); margin-bottom:0.25rem; }
.phase3-modal__summary-card .value{ font-size:1.1rem; font-weight:700; color:var(--text); }
.phase3-modal__milestones{ display:flex; gap:1rem; margin-bottom:1.5rem; flex-wrap:wrap; }
.phase3-modal__milestone{ display:flex; align-items:center; gap:0.5rem; background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:0.6rem 1rem; font-size:0.85rem; color:var(--text); }
.phase3-modal__milestone strong{ color:var(--text); }
.phase3-modal__comparison{ margin-bottom:1.5rem; }
.phase3-modal__comparison .compare-grid{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-bottom:1rem; }
.phase3-modal__comparison .compare-card{ background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:1rem; }
.phase3-modal__comparison .compare-card h3{ font-size:0.85rem; color:var(--text-muted); margin:0 0 0.75rem; font-weight:600; }
.phase3-modal__comparison .compare-card .stat-row{ display:flex; justify-content:space-between; margin-bottom:0.4rem; font-size:0.85rem; }
.phase3-modal__comparison .compare-card .stat-row .stat-label{ color:var(--text-muted); }
.phase3-modal__comparison .compare-card .stat-row .stat-value{ font-weight:600; color:var(--text); }
.phase3-modal__comparison .savings-banner{ background:#ecfdf5; border:1px solid #a7f3d0; border-radius:8px; padding:0.75rem 1rem; text-align:center; font-size:0.9rem; font-weight:600; color:#065f46; }
[data-theme="dark"] .phase3-modal__comparison .savings-banner{ background:#064e3b; border-color:#065f46; color:#a7f3d0; }
.phase3-modal__table-wrap{ overflow-x:auto; margin-bottom:1.5rem; max-height:400px; overflow-y:auto; }
.phase3-modal__table-wrap .rate-table{ font-size:0.82rem; }
.phase3-modal__table-wrap .rate-table td,.phase3-modal__table-wrap .rate-table th{ padding:0.45rem 0.7rem; white-space:nowrap; }
.phase3-modal__actions{ display:flex; gap:0.75rem; justify-content:center; border-top:1px solid var(--border); padding-top:1rem; }
.phase3-modal__btn{ display:inline-flex; align-items:center; gap:0.5rem; padding:0.6rem 1.25rem; background:#111; color:#fff; border:none; border-radius:6px; font-size:0.85rem; font-weight:600; cursor:pointer; transition:background 0.2s; }
.phase3-modal__btn:hover{ background:#333; }
[data-theme="dark"] .phase3-modal__btn{ background:#e4e4e4; color:#111; }
[data-theme="dark"] .phase3-modal__btn:hover{ background:#fff; }
.phase3-modal__inputs{ margin-bottom:1.5rem; }
.phase3-modal__inputs .payoff-input-row{ display:flex; gap:1.5rem; align-items:center; }
@media(max-width:600px){
  .phase3-modal{ padding:0.5rem; }
  .phase3-modal__content{ padding:1.25rem; max-height:95vh; border-radius:8px; }
  .phase3-modal__summary{ grid-template-columns:1fr; }
  .phase3-modal__milestones{ flex-direction:column; }
  .phase3-modal__actions{ flex-direction:column; }
  .phase3-modal__comparison .compare-grid{ grid-template-columns:1fr; }
  .phase3-modal__inputs .payoff-input-row{ flex-direction:column; }
}