/* Thulir Interior — base CSS shared across all pages */
:root {
  /* Thulir palette */
  --primary:      #2D6A2F;
  --vivid:        #3DD90A;
  --deep:         #1A3F1C;
  --bg:           #F2F5EE;
  --surface:      #E6EDE2;
  --sage:         #A8D5A2;
  --text-soft:    #5A7A5C;
  --border:       #C8D9C4;
  --ink:          #14241A;
  --paper:        #FBFBF6;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans:  "DM Sans", system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;

  --max: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

::selection { background: var(--primary); color: var(--paper); }

/* Type primitives */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
}

.h-display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(48px, 8.4vw, 132px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--deep);
  margin: 0;
}
.h-display em { font-style: italic; font-weight: 300; color: var(--primary); }

.h-section {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--deep);
  margin: 0;
}
.h-section em { font-style: italic; color: var(--primary); }

.lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.35;
  color: var(--primary);
}

/* ============================================================
   NUMERIC TYPOGRAPHY
   Metrics, ratings, timelines, phone numbers etc. render in
   DM Sans with tabular + lining numerals for crisp, premium,
   non-decorative legibility. Apply `.num` to any numeric run.
============================================================ */
.num {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.01em;
}
/* Big headline metrics — heavier, tighter, optically aligned */
.stat-num {
  font-family: var(--sans);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-feature-settings: "tnum" 1, "lnum" 1, "ss01" 1;
}
/* Phone / email / address numerals stay aligned */
a[href^="tel:"], .num-inline { font-variant-numeric: tabular-nums lining-nums; }

/* Layout helpers */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(80px, 10vw, 140px) 0; position: relative; }
.rule { height: 1px; background: var(--border); margin: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
  white-space: nowrap;
  min-width: 0; /* allow shrinking inside flex/grid */
  max-width: 100%; /* don't overflow parent */
  justify-content: center;
}
.btn-primary { background: var(--deep); color: var(--paper); }
.btn-primary:hover { background: var(--primary); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--deep);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--deep); background: var(--surface); }

/* Cards */
.card {
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
}

/* ============================================================
   MOTION — page enter, scroll reveals, smooth interactions
============================================================ */
html { scroll-behavior: smooth; }
body { animation: thuPageIn .65s cubic-bezier(.2,.7,.2,1) both; }
@keyframes thuPageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Note: this animation must stay opacity-only. A `transform` here (even one
   that ends at `none`) permanently turns <body> into the containing block
   for every position:fixed element on the page (WhatsApp button, chat
   widget, lead popup) — they'd position relative to full document height
   instead of the viewport. */

/* Anchor scroll offset under fixed nav */
section[id], header[id] { scroll-margin-top: 96px; }

/* Reveal-on-scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="slide-left"]  { transform: translateX(-28px); }
[data-reveal="slide-right"] { transform: translateX(28px); }
[data-reveal="scale"]       { transform: scale(.96); }
[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* Auto-revealed targets — headings, eyebrows, cards, figures */
.h-display, .h-section, .lead, .eyebrow,
.card, figure, article,
.btn-primary, .btn-ghost {
  /* These do NOT have data-reveal by default — the JS opts them in */
}

/* Staggered children helper — apply on grid parent */
.stagger > * { --reveal-delay: 0ms; }
.stagger > *:nth-child(2)  { --reveal-delay: 80ms; }
.stagger > *:nth-child(3)  { --reveal-delay: 160ms; }
.stagger > *:nth-child(4)  { --reveal-delay: 240ms; }
.stagger > *:nth-child(5)  { --reveal-delay: 320ms; }
.stagger > *:nth-child(6)  { --reveal-delay: 400ms; }
.stagger > *:nth-child(7)  { --reveal-delay: 480ms; }
.stagger > *:nth-child(8)  { --reveal-delay: 560ms; }
.stagger > *:nth-child(9)  { --reveal-delay: 640ms; }
.stagger > *:nth-child(10) { --reveal-delay: 720ms; }

/* Subtle image lift on card hover */
.card { transition: transform .35s ease, box-shadow .35s ease, border-color .25s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -30px rgba(20,36,26,.18); }
.card img, figure > img { transition: transform .7s cubic-bezier(.2,.7,.2,1); will-change: transform; }

/* Buttons get a slight lift */
.btn { will-change: transform; }
.btn:active { transform: translateY(0) scale(.98); }

/* Button status indicator (pulsing green dot) --------------------------------- */
.btn-primary { position: relative; }
.btn-primary::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(61,217,10,1); /* var(--vivid) */
  box-shadow: 0 0 0 0 rgba(61,217,10,0.6);
  pointer-events: none;
  animation: btnPulse 1.8s ease-out infinite;
}
@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(61,217,10,0.7); transform: translateY(-50%) scale(1); }
  50%  { box-shadow: 0 0 0 8px rgba(61,217,10,0); transform: translateY(-50%) scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(61,217,10,0); transform: translateY(-50%) scale(1); }
}

/* Optional blink variant: subtle background flash */
.btn-primary.blink {
  animation: btnFlashBg 2.4s ease-in-out infinite;
}
@keyframes btnFlashBg {
  0%, 80% { background: var(--deep); }
  85%     { background: color-mix(in srgb, var(--deep) 75%, white 25%); }
  100%    { background: var(--deep); }
}

/* Rotating text used inside CTAs (fades between phrases) */
.rotating-text {
  display: inline-block;
  vertical-align: middle;
  transition: opacity .28s ease;
  opacity: 1;
}
.rotating-text[data-fade="true"] { opacity: 0; }

/* Underline shimmer for nav links */
.nav-links a { position: relative; }
.nav-links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover::after { transform: scaleX(1); }

/* Soft gradient seam between adjacent sections of the same tone */
.section + .section { position: relative; }

/* Selection style refinement */
::selection { background: var(--primary); color: var(--paper); }

/* Focus visible — brand-coloured ring */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Ensure newly added CTA/indicator animations respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .btn-primary::after,
  .btn-primary.blink,
  .rotating-text {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    box-shadow: none !important;
  }
}

/* ============================================================
   COMPARISON TABLE — desktop grid, mobile stacked cards
============================================================ */
.cmp-tag { display: none; }
@media (max-width: 760px) {
  .comparison-table { border: none !important; background: transparent !important; border-radius: 0 !important; overflow: visible !important; }
  .comparison-table .cmp-head { display: none !important; }
  .comparison-table .cmp-row {
    display: block !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px;
    background: var(--paper);
    margin-bottom: 14px;
    overflow: hidden;
  }
  .comparison-table .cmp-row .cmp-feat {
    background: var(--surface);
    font-size: 15px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
  }
  .comparison-table .cmp-row .cmp-cell {
    border-left: none !important;
    padding: 15px 18px;
  }
  .comparison-table .cmp-row .cmp-thu { border-bottom: 1px solid var(--border); }
  .cmp-tag {
    display: block;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 4px;
  }
  .comparison-table .cmp-typ .cmp-tag { color: #B59A7A; }
}

/* ============================================================
   RESPONSIVE
   Inline styles win the cascade, so collapse rules use
   [style*="grid-template-columns"] + !important.
============================================================ */

/* Tablet — 1080px and below */
@media (max-width: 1080px) {
  :root { --gutter: clamp(24px, 5vw, 44px); }
  .section { padding: clamp(60px, 8vw, 100px) 0; }
  /* 4-col grids → 2-col */
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"],
  [style*="grid-template-columns: repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* 3-col grids → 2-col */
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(3,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Hero image 3-frame strip */
  [style*="1.4fr 1fr .9fr"] { grid-template-columns: 1fr 1fr !important; }

  /* Footer — collapse 4-col to 2x2 with breathing room */
  footer [style*="grid-template-columns: 1.4fr 1fr 1fr 1.1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 40px !important;
    padding-bottom: 40px !important;
  }
  footer .wrap {
    padding: 0 clamp(28px, 5vw, 48px) !important;
  }
  /* Neighbourhood chips row — ensure gutter */
  footer > div:first-child .wrap {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
  }

  /* Comparison table — tighter type so column titles fit */
  .comparison-table [style*="font-size:22px"],
  .comparison-table [style*="font-size: 22px"] {
    font-size: 17px !important;
    line-height: 1.2 !important;
  }
  .comparison-table > div > div {
    padding: 16px 18px !important;
  }
  .comparison-table > div:first-child > div {
    padding: 18px 18px !important;
  }
  .comparison-table { font-size: 13.5px; }
}

/* Tablet portrait / large phone — 880px and below */
@media (max-width: 880px) {
  /* Nav: hide desktop links + CTA, show burger */
  .nav-links, .nav-cta { display: none !important; }
  .nav-burger { display: inline-flex !important; }

  /* Collapse every multi-column inline grid to 1 column */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1.3fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns: 1.05fr 1fr"],
  [style*="grid-template-columns: 1fr 1.05fr"],
  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="grid-template-columns: 1fr 1.25fr"],
  [style*="grid-template-columns: 1fr 1.4fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns: 1.5fr 1fr"],
  [style*="grid-template-columns: 1.5fr 1"],
  [style*="grid-template-columns: 1fr auto"],
  [style*="grid-template-columns: auto 1fr"],
  [style*="grid-template-columns: 1.3fr 1.4fr 1.4fr"],
  [style*="grid-template-columns: 1.4fr 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1.05fr 1fr"],
  [style*="grid-template-columns:repeat(2, 1fr)"],
  [style*="grid-template-columns: repeat(2, 1fr)"],
  [style*="grid-template-columns: repeat(2,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns: repeat(5, 1fr)"],
  [style*="grid-template-columns:1.4fr 1fr .9fr"],
  [style*="1.4fr 1fr .9fr"],
  [style*="grid-template-columns: repeat(12, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* Sticky columns become non-sticky */
  [style*="position:sticky"], [style*="position: sticky"] {
    position: static !important;
  }
  /* Project featured grid items (gridColumn span) reset */
  [style*="grid-column:span"], [style*="gridColumn:span"], [style*="grid-column: span"] {
    grid-column: 1 / -1 !important;
  }
  /* Section padding */
  .section { padding: 60px 0; }

  /* PromiseStrip & comparison table — horizontal scroll */
  .scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Footer multi-col → stack */
  footer [style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 30px !important; }

  /* Hero min-height shorter */
  #top[data-dark-hero] { min-height: 88vh !important; }
  /* Hero trust strip → 2x2 */
  #top [style*="backdrop-filter"] { grid-template-columns: 1fr 1fr !important; max-width: 100% !important; }

  /* Stats borders cleanup */
  [style*="border-right"] { border-right: none !important; padding-right: 0 !important; }

  /* Hide marquee mask thinner */
  .wrap [style*="animation"] { animation-duration: 22s !important; }

  /* Page hero gutter */
  .h-display { font-size: clamp(48px, 13vw, 88px) !important; }
  .h-section { font-size: clamp(34px, 7vw, 52px) !important; }

  /* Comparison table — handled natively by the component now
     (switches to stacked cards below 760px). */
  .comparison-table { font-size: 13px; }

  /* WhyThulir 4-col table also gets scroll */
  .wrap .card[style*="padding:0"] > div[style*="grid-template-columns: 1.4fr 1fr 1fr 1fr"] {
    grid-template-columns: 1.4fr 1fr 1fr 1fr !important;
  }

  /* Footer legal links — left-align so they don't overflow right edge */
  footer [style*="justify-content: flex-end"] {
    justify-content: flex-start !important;
  }
  footer [style*="justify-content:flex-end"] {
    justify-content: flex-start !important;
  }

  /* Lead popup — stack columns, full height */
  .lead-popup {
    grid-template-columns: 1fr !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }

  /* Hide tweaks panel on mobile if open */
  .twk-panel { right: 8px !important; bottom: 80px !important; max-width: calc(100vw - 16px) !important; }
}

/* Small phone — 540px and below */
@media (max-width: 540px) {
  :root { --gutter: 18px; }
  body { font-size: 15px; }

  /* Section padding tighter */
  .section { padding: 50px 0; }

  /* Padding inside cards / surface blocks */
  .card { border-radius: 14px; }

  /* Buttons full-width when sitting in a column */
  .btn { padding: 13px 22px; font-size: 13.5px; display: flex; width: 100%; justify-content: center; }
  /* Reduce the status indicator size on small screens */
  .btn-primary::after { right: 12px; width: 8px; height: 8px; }

  /* Hero specific */
  #top[data-dark-hero] { min-height: 92vh !important; padding-top: 130px !important; }
  #top[data-dark-hero] .h-display { font-size: clamp(44px, 14vw, 72px) !important; }
  #top[data-dark-hero] .wrap > div > div:nth-child(4) { margin-top: 32px !important; padding: 14px 18px !important; }

  /* Hero side-by-side description + buttons stack */
  #top[data-dark-hero] [style*="grid-template-columns: 1.5fr 1fr"] {
    gap: 24px !important;
  }
  #top[data-dark-hero] [style*="justify-content: flex-end"] {
    justify-content: flex-start !important;
  }

  /* PageHero image hides on tiny phones (text-first) */
  .pagehero-image { display: none !important; }

  /* Floating WhatsApp tip is too wide — tighter */
  .wa-tip { max-width: 230px; font-size: 12px !important; }

  /* Comparison table — native stacked cards below 540, no scroll hack */
  .comparison-table-wrap { overflow: visible; }

  /* Lead popup form padding */
  .lead-popup-form { padding: 30px 22px !important; }
  .lead-popup-promise { padding: 30px 22px !important; }

  /* Footer neighbourhood chips wrap nicely */
  footer ul { gap: 6px !important; }
  footer ul li a { font-size: 12px !important; padding: 6px 10px !important; }

  /* SVG block decorations smaller */
  .h-display em { display: inline; }

  /* Stats counter band reduce */
  .stats-band { padding: 50px 0 !important; }
}

/* Hide horizontal scroll on body always */
html, body { max-width: 100vw; overflow-x: hidden; }

/* Make iframes responsive */
iframe { max-width: 100%; }

/* ============================================================
   PERFORMANCE — reserve media space to keep CLS ~0
============================================================ */
/* Every project/figure image declares an aspect-ratio via the
   component; this guards any stray <img> against layout shift. */
img { height: auto; }
figure > img, .card img { background: var(--surface); }

/* Skip rendering work for far-offscreen heavy blocks.
   contain-intrinsic-size reserves height so the scrollbar
   and anchors stay stable (no CLS). */
.cv-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

/* ============================================================
   HEADER — static top bar (scrolls away, not sticky)
============================================================ */
.thu-nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 50;
}

/* ============================================================
   LEAD POPUP — desktop modal / mobile bottom sheet
============================================================ */
.lead-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20,36,26,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: thuPopFade .25s ease;
}
.lead-popup {
  background: var(--paper); border-radius: 24px; overflow: hidden;
  max-width: 880px; width: 100%;
  display: grid; grid-template-columns: 1fr 1.2fr;
  grid-template-rows: minmax(0, 1fr);
  animation: thuPopRise .35s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.5);
  position: relative;
  max-height: 92vh;
}
/* Grid children must be allowed to shrink below content height, otherwise the
   form column expands past the clipped popup and the submit button is cut off. */
.lead-popup-promise, .lead-popup-form { min-height: 0; min-width: 0; }
.lead-popup-form { overflow-y: auto; }
@keyframes thuPopFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes thuPopRise { from { opacity:0; transform: translateY(20px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes thuSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Inline validation error text */
.field-error {
  color: #C0392B; font-size: 11.5px; margin-top: 5px;
  font-family: var(--sans); display: flex; align-items: center; gap: 5px;
}
.field-invalid { border-color: #C0392B !important; }

@media (max-width: 760px) {
  /* Modal becomes a bottom sheet */
  .lead-overlay { align-items: flex-end; padding: 0; }
  .lead-popup {
    grid-template-columns: 1fr !important;
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    max-height: 94vh;
    animation: thuSheetUp .35s cubic-bezier(.2,.7,.2,1);
  }
  /* Hide the promo panel on small sheets to keep the form reachable */
  .lead-popup-promise { display: none !important; }
  .lead-popup-form { padding: 30px 22px 26px !important; }
  /* Grab handle */
  .lead-popup::before {
    content: ""; position: absolute; top: 9px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 999px;
    background: var(--border); z-index: 6;
  }
}

/* ============================================================
   BUDGET ESTIMATOR
============================================================ */
.est-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
.est-block { margin-bottom: 30px; }
.est-block:last-child { margin-bottom: 0; }
.est-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-soft); margin-bottom: 14px;
}

/* ---- first-run guidance: highlight options while the result reads ₹00.0 ---- */
.est-controls { position: relative; }
.est-prompt {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 24px; padding: 13px 16px;
  background: rgba(61,217,10,.10);
  border: 1px solid rgba(61,217,10,.5);
  border-radius: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--primary); font-weight: 600;
  line-height: 1.3; animation: estPromptIn .45s ease both;
}
.est-prompt-pulse {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--vivid); position: relative;
}
.est-prompt-pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--vivid); animation: estPing 1.5s ease-out infinite;
}
@keyframes estPing { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes estPromptIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* pulsing halo around each option group until the visitor engages */
.est-controls.is-prompt .est-homes,
.est-controls.is-prompt .est-finish,
.est-controls.is-prompt .est-chips {
  border-radius: 16px; animation: estHalo 2.1s ease-in-out infinite;
}
.est-controls.is-prompt .est-finish { animation-delay: .25s; }
.est-controls.is-prompt .est-chips  { animation-delay: .5s; }
@keyframes estHalo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61,217,10,0); }
  50%      { box-shadow: 0 0 0 3px rgba(61,217,10,.2); }
}

/* nil-indicator hint on the result card */
.est-nil-hint {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 14px;
  font-size: 12.5px; line-height: 1.4; color: var(--sage);
  animation: estPromptIn .45s ease both;
}
.est-nil-hint svg { flex-shrink: 0; margin-top: 1px; color: var(--vivid); }

@media (prefers-reduced-motion: reduce) {
  .est-prompt-pulse::after,
  .est-controls.is-prompt .est-homes,
  .est-controls.is-prompt .est-finish,
  .est-controls.is-prompt .est-chips { animation: none; }
}

/* home tiles */
.est-homes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.est-home {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 18px 10px 14px; border-radius: 16px;
  background: var(--paper); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s, box-shadow .25s, background .2s;
  text-align: center;
}
.est-home:hover { transform: translateY(-2px); border-color: var(--sage); }
.est-home.is-on {
  border-color: var(--primary); background: var(--paper);
  box-shadow: 0 0 0 1.5px var(--primary), 0 18px 30px -22px rgba(20,36,26,.4);
}
.est-ico { width: 46px; height: 38px; color: var(--text-soft); transition: color .2s, transform .35s cubic-bezier(.2,.7,.2,1); }
.est-ico svg { width: 100%; height: 100%; }
.est-home.is-on .est-ico { color: var(--primary); transform: translateY(-1px) scale(1.06); }
.est-home-label { font-size: 14px; font-weight: 600; color: var(--deep); }
.est-home-sqft { font-size: 11px; color: var(--text-soft); }

/* finish segmented cards */
.est-finish { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.est-fin {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 16px 16px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s, box-shadow .25s;
}
.est-fin:hover { transform: translateY(-2px); border-color: var(--sage); }
.est-fin.is-on { border-color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary); }
.est-fin-top { font-size: 15px; font-weight: 600; color: var(--deep); }
.est-fin-rate { font-size: 12px; color: var(--primary); font-weight: 500; }
.est-fin-blurb { font-size: 12px; color: var(--text-soft); line-height: 1.35; }

/* scope chips */
.est-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.est-chip {
  display: flex; align-items: center; gap: 10px; position: relative;
  padding: 13px 14px; border-radius: 13px; text-align: left;
  background: var(--paper); border: 1px solid var(--border);
  transition: border-color .2s, background .2s, box-shadow .2s, opacity .2s;
}
.est-chip:hover { border-color: var(--sage); }
.est-chip.is-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.est-chip:not(.is-on) { opacity: .62; }
.est-chip-ic { width: 22px; height: 22px; flex-shrink: 0; color: var(--primary); }
.est-chip:not(.is-on) .est-chip-ic { color: var(--text-soft); }
.est-chip-label { font-size: 13.5px; font-weight: 500; color: var(--deep); line-height: 1.2; flex: 1; }
.est-chip-note { font-size: 11px; color: var(--text-soft); white-space: nowrap; }
.est-chip-tick {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--paper);
  transform: scale(0); transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.est-chip.is-on .est-chip-tick { transform: scale(1); }
.est-chip:not(.is-on) .est-chip-note { display: none; }

/* wardrobe stepper chip */
.est-chip-counter { cursor: default; }
.est-stepper { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.est-stepper button {
  width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--deep); font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.est-stepper button:hover { background: var(--sage); border-color: var(--primary); }
.est-stepper .num { min-width: 14px; text-align: center; font-weight: 600; color: var(--deep); }

.est-fineprint { font-size: 12px; color: var(--text-soft); margin: 14px 0 0; font-style: italic; }

/* result card */
.est-result { position: sticky; top: 96px; }
.est-result-inner {
  background: var(--deep); color: var(--paper);
  border-radius: 22px; padding: 30px 30px 26px;
  background-image: radial-gradient(ellipse at top right, rgba(61,217,10,.16), transparent 62%);
}

/* animated interior preview — crossfades on finish change + slow Ken-Burns zoom */
.est-preview {
  position: relative; border-radius: 16px; overflow: hidden;
  aspect-ratio: 16 / 10; background: #0d1d12; margin-bottom: 22px;
}
.est-preview-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .8s ease; will-change: opacity, transform;
}
.est-preview-img.is-active { opacity: 1; animation: estKen 16s ease-in-out infinite alternate; }
@keyframes estKen {
  from { transform: scale(1.02) translate(0, 0); }
  to   { transform: scale(1.14) translate(-1.5%, -1.5%); }
}
.est-preview::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(13,29,18,.82), rgba(13,29,18,.12) 52%, transparent 78%);
}
.est-preview-cap {
  position: absolute; left: 16px; right: 16px; bottom: 13px; z-index: 2;
  display: flex; flex-direction: column; gap: 2px;
}
.est-preview-finish {
  font-family: var(--serif); font-size: 21px; color: var(--paper);
  text-transform: capitalize; line-height: 1.1;
}
.est-preview-home { font-size: 12px; color: var(--sage); letter-spacing: .01em; }
@media (prefers-reduced-motion: reduce) {
  .est-preview-img.is-active { animation: none; }
}

.est-result-eyebrow {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--sage);
}

/* locked teaser — price hidden until details submitted */
.est-locked { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.est-locked-num {
  font-size: clamp(26px, 3vw, 38px); font-weight: 600; color: var(--paper);
  letter-spacing: -.02em; line-height: 1; filter: blur(8px); user-select: none;
  -webkit-user-select: none; opacity: .85;
}
.est-lock-badge {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--deep); background: var(--vivid); padding: 6px 11px; border-radius: 999px; font-weight: 600;
}
.est-config { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.13); }
.est-config-head { font-family: var(--serif); font-size: 19px; color: var(--paper); }
.est-config-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px; }
.est-config-list li {
  font-size: 13px; color: var(--sage); display: flex; align-items: center; gap: 9px;
}
.est-config-list li::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M1.6 5.2 4 7.5 8.4 2.6' stroke='%23FBFBF6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/9px no-repeat;
}
.est-unlock-msg { font-size: 13px; color: var(--sage); line-height: 1.5; margin: 18px 0 0; }

.est-range {
  font-size: clamp(30px, 3.4vw, 44px); font-weight: 600; color: var(--paper);
  letter-spacing: -.02em; line-height: 1.04; margin-top: 10px;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px;
}
.est-dash { color: var(--vivid); padding: 0 6px; font-weight: 300; }
.est-persqft { font-size: 13px; color: var(--sage); margin-top: 8px; }

.est-bars { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.13); display: flex; flex-direction: column; gap: 13px; }
.est-bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.est-bar-label { font-size: 12.5px; color: var(--paper); }
.est-bar-val { font-size: 12.5px; color: var(--sage); font-weight: 500; }
.est-bar-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.est-bar-fill {
  display: block; height: 100%; border-radius: 999px;
  transition: width .6s cubic-bezier(.2,.7,.2,1);
}

.est-cta { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.est-cta-main {
  width: 100%; justify-content: center; padding: 16px;
  background: var(--vivid); color: var(--deep); font-weight: 600; font-size: 15px;
}
.est-cta-main:hover { background: var(--vivid); filter: brightness(1.05); transform: translateY(-1px); }
.est-cta-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13.5px; color: var(--sage); transition: color .2s;
}
.est-cta-wa:hover { color: var(--paper); }
.est-wa-dot { width: 8px; height: 8px; border-radius: 50%; background: #25D366; box-shadow: 0 0 0 0 rgba(37,211,102,.6); animation: estPulse 2.2s infinite; }
@keyframes estPulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.5);} 70% { box-shadow: 0 0 0 7px rgba(37,211,102,0);} 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0);} }
.est-disclaimer { font-size: 11px; color: var(--sage); opacity: .8; margin: 16px 0 0; line-height: 1.5; }

/* ============================================================
   DETAILED ESTIMATOR — precise ft/in calculators
   (detailed-estimate.jsx)
============================================================ */
.de-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.de-calcs { display: flex; flex-direction: column; gap: 22px; }
.de-card { padding: 26px 28px; }
.de-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.de-card-title { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--deep); }
.de-card-sub { font-size: 13px; color: var(--text-soft); margin-top: 4px; line-height: 1.45; max-width: 420px; }

.de-switch { position: relative; display: inline-block; width: 42px; height: 25px; flex-shrink: 0; }
.de-switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.de-switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--border);
  transition: background .2s ease;
}
.de-switch span::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--paper); transition: transform .2s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 1px 3px rgba(20,36,26,.3);
}
.de-switch input:checked + span { background: var(--primary); }
.de-switch input:checked + span::before { transform: translateX(17px); }

.de-dims { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; }
.dim-field-label { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
.dim-field-row { display: flex; gap: 8px; align-items: center; }
.dim-x { font-size: 13px; color: var(--text-soft); flex-shrink: 0; }
.dim-input-wrap {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--paper);
  padding: 9px 12px;
}
.dim-input-wrap input {
  width: 34px; min-width: 0; border: none; background: transparent; font-family: var(--mono);
  font-size: 15px; font-weight: 600; color: var(--deep); outline: none;
  -moz-appearance: textfield; appearance: textfield;
}
.dim-input-wrap input::-webkit-outer-spin-button,
.dim-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.dim-input-wrap span { font-size: 12px; color: var(--text-soft); flex-shrink: 0; }

.de-others { display: flex; flex-direction: column; gap: 20px; margin-top: 18px; }
.de-other-row { padding-top: 18px; border-top: 1px solid var(--border); }
.de-other-row:first-child { padding-top: 0; border-top: none; }

.de-result-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.13);
}
.de-result-row:last-child { border-bottom: none; }
.de-result-row.is-muted { opacity: .4; }
.de-result-label { font-size: 13.5px; font-weight: 500; color: var(--paper); }
.de-result-sub { font-size: 11.5px; color: var(--sage); margin-top: 2px; }
.de-result-val { font-size: 13px; color: var(--vivid); font-weight: 600; white-space: nowrap; }

@media (max-width: 920px) {
  .de-grid { grid-template-columns: 1fr; }
  .est-result { position: static; }
}

/* ============================================================
   KITCHEN CALCULATOR — 2D shape diagram cards
   (kitchen-calculator.jsx)
============================================================ */
.kc-shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.kc-shape {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--paper); cursor: pointer; transition: all .2s ease;
}
.kc-shape:hover { transform: translateY(-2px); border-color: var(--sage); }
.kc-shape.is-on { border-color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary); }
.kc-shape-diagram { width: 64px; height: 64px; }
.kc-shape-label { font-size: 13.5px; font-weight: 600; color: var(--deep); }
.kc-shape-blurb { font-size: 10.5px; color: var(--text-soft); text-align: center; line-height: 1.3; }

@media (max-width: 640px) {
  .kc-shapes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kc-shapes { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kc-shape { padding: 14px 8px; }
  .kc-shape-diagram { width: 44px; height: 44px; }
}

/* ============================================================
   PRICE GUIDE — woodwork finish + cot rate card
   (estimate.jsx, PriceGuide component)
============================================================ */
.pg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pg-card { padding: 22px 20px; display: flex; flex-direction: column; align-items: flex-start; }
.pg-card-highlight { border-color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary); }
.pg-ic {
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pg-ic svg { width: 20px; height: 20px; flex-shrink: 0; }
.pg-card-highlight .pg-ic { background: var(--primary); color: var(--paper); }
.pg-card-label { font-size: 14.5px; font-weight: 600; color: var(--deep); margin-top: 14px; line-height: 1.3; min-height: 38px; }
.pg-card-prices {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.pg-price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pg-price-tag { font-size: 11.5px; color: var(--text-soft); white-space: nowrap; }
.pg-price { font-size: 13.5px; font-weight: 700; color: var(--primary); white-space: nowrap; }

.pg-cot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pg-cot-card { padding: 24px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.pg-cot-label { font-size: 13.5px; font-weight: 600; color: var(--deep); line-height: 1.35; min-height: 36px; }
.pg-cot-price { font-size: 21px; font-weight: 700; color: var(--primary); }
.pg-cot-prefix { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-soft); margin-bottom: 2px; }

.pg-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-top: 70px; align-items: stretch; }
.pg-promise {
  background: var(--deep); color: var(--paper); border-radius: 22px; padding: 34px 32px;
  display: flex; flex-direction: column; justify-content: center;
  background-image: radial-gradient(ellipse at top right, rgba(61,217,10,.14), transparent 62%);
}

@media (max-width: 920px) {
  .pg-grid, .pg-cot-grid { grid-template-columns: repeat(2, 1fr); }
  .pg-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pg-grid, .pg-cot-grid { grid-template-columns: 1fr; }
}

/* quote reveal inside the lead-popup "sent" screen (light bg) */
.quote-reveal { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); text-align: left; }
.quote-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-soft); }
.quote-range { font-size: clamp(28px, 4vw, 40px); font-weight: 600; color: var(--deep); letter-spacing: -.02em; line-height: 1.04; margin-top: 8px; }
.quote-sub { font-size: 13px; color: var(--text-soft); margin-top: 5px; }
.quote-bars { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.quote-bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.quote-bar-top .ql { font-size: 12.5px; color: var(--deep); }
.quote-bar-top .qv { font-size: 12.5px; color: var(--primary); font-weight: 600; }
.quote-bar-track { height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.quote-bar-fill { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: quoteGrow .65s cubic-bezier(.2,.7,.2,1) both; }
@keyframes quoteGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.quote-note { font-size: 11.5px; color: var(--text-soft); font-style: italic; line-height: 1.5; margin: 18px 0 0; }

/* Floating WhatsApp FAB — continuous live ring + gentle bob + periodic attention blink */
.wa-fab { position: relative; transition: transform .2s ease; animation: waFloat 2.6s ease-in-out infinite; }
.wa-fab:hover { animation-play-state: paused; transform: scale(1.08); }
.wa-fab::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(37,211,102,.5);
  animation: waRing 2.8s ease-out infinite;
}
@keyframes waRing {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.5); }
  70%  { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
@keyframes waFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.wa-badge {
  position: absolute; top: -4px; right: -4px; z-index: 1;
  width: 20px; height: 20px; border-radius: 50%;
  background: #FF3B30; color: #fff; border: 2px solid var(--paper);
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.wa-fab.wa-blink { animation: waBlink 1.2s ease; }
@keyframes waBlink {
  0%, 100% { transform: scale(1) rotate(0deg); }
  12%      { transform: scale(1.16) rotate(-12deg); }
  28%      { transform: scale(1.16) rotate(12deg); }
  44%      { transform: scale(1.12) rotate(-9deg); }
  60%      { transform: scale(1.1)  rotate(7deg); }
  78%      { transform: scale(1.05) rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wa-fab { animation: none; }
  .wa-fab::after { animation: none; }
  .wa-fab.wa-blink { animation: none; }
}

/* ============================================================
   CHAT BOT — floating FAQ assistant, bottom-left (mirrors the
   WhatsApp FAB on the right so the two never collide)
============================================================ */
.chatbot-fab {
  position: fixed; left: 24px; bottom: 24px; z-index: 80;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--deep); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 40px -10px rgba(20,36,26,.55);
  transition: transform .2s ease, background .2s ease;
}
.chatbot-fab:hover { transform: scale(1.08); background: var(--primary); }

.chatbot-panel {
  position: fixed; left: 24px; bottom: 92px; z-index: 85;
  width: 360px; max-width: calc(100vw - 32px);
  height: min(70vh, 560px);
  background: var(--paper); border-radius: 22px;
  box-shadow: 0 30px 70px -20px rgba(20,36,26,.5);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  animation: chatbotRise .3s cubic-bezier(.2,.7,.2,1);
}
@keyframes chatbotRise { from { opacity:0; transform: translateY(16px) scale(.97); } to { opacity:1; transform:none; } }

.chatbot-head {
  flex-shrink: 0; padding: 18px 18px; background: var(--deep); color: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  background-image: radial-gradient(ellipse at top left, rgba(61,217,10,.16), transparent 62%);
}
.chatbot-head-title { font-family: var(--serif); font-size: 18px; }
.chatbot-head-sub { font-size: 11.5px; color: var(--sage); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.chatbot-dot { width: 7px; height: 7px; border-radius: 50%; background: #25D366; flex-shrink: 0; }
.chatbot-close {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper); font-size: 20px; line-height: 1; opacity: .8;
}
.chatbot-close:hover { opacity: 1; background: rgba(255,255,255,.1); }

.chatbot-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 6px; display: flex; flex-direction: column; gap: 12px; }
.chatbot-msg { max-width: 86%; }
.chatbot-msg p {
  margin: 0; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5;
}
.chatbot-msg-bot { align-self: flex-start; }
.chatbot-msg-bot p { background: var(--surface); color: var(--deep); border-bottom-left-radius: 4px; }
.chatbot-msg-user { align-self: flex-end; }
.chatbot-msg-user p { background: var(--primary); color: var(--paper); border-bottom-right-radius: 4px; }
.chatbot-msg-link {
  display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--primary);
}
.chatbot-msg-link:hover { color: var(--vivid); }

.chatbot-typing { display: flex; gap: 4px; padding: 12px 13px; background: var(--surface); border-radius: 14px; border-bottom-left-radius: 4px; width: fit-content; }
.chatbot-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-soft);
  animation: chatbotTyping 1.1s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: .15s; }
.chatbot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatbotTyping { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chatbot-chips {
  flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 7px;
  padding: 10px 16px; border-top: 1px solid var(--border);
  max-height: 84px; overflow-y: auto;
}
.chatbot-chip {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--paper); font-size: 11.5px; color: var(--deep); white-space: nowrap;
  transition: border-color .2s, background .2s;
}
.chatbot-chip:hover { border-color: var(--primary); background: var(--surface); }

.chatbot-input-row {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.chatbot-input-row input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 16px; font-size: 13px; font-family: var(--sans); background: var(--bg); outline: none;
}
.chatbot-input-row input:focus { border-color: var(--primary); }
.chatbot-input-row button {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, opacity .2s;
}
.chatbot-input-row button:disabled { opacity: .4; }
.chatbot-input-row button:not(:disabled):hover { background: var(--deep); }

@media (max-width: 640px) {
  .chatbot-panel {
    left: 16px; right: 16px; bottom: 88px; width: auto; max-width: none;
    height: min(72vh, 520px);
  }
  .chatbot-fab { left: 16px; bottom: 16px; }
}

@media (max-width: 920px) {
  .est-grid { grid-template-columns: 1fr; }
  .est-result { position: static; }
}
@media (max-width: 560px) {
  .est-homes { grid-template-columns: repeat(2, 1fr); }
  .est-finish { grid-template-columns: 1fr; }
  .est-chips { grid-template-columns: 1fr; }
}

/* article intro drop-cap — works regardless of inline formatting in the first line */
.dropcap-p::first-letter {
  float: left;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 5.4em;
  line-height: 0.78;
  color: var(--primary);
  margin: 6px 14px -6px 0;
}

