/* =========================================================
   THEME-NEUTRAL BASELINE
   Prepended to every theme's CSS. Covers behavior that must work
   regardless of theme (anchor-scroll to the quote form under a sticky
   topbar) and a plain fallback for arbitrary site-authored HTML inside
   CONFIG["cost_body"] (tables, lists) that a theme's own CSS doesn't
   otherwise style.
========================================================= */
*{ box-sizing: border-box; }

/* Browsers default <figure> to `margin: 1em 40px`, which throws off any
   grid/flex pairing it sits in (e.g. an image beside a quote-form box) —
   the sibling box ends up looking like it "sticks out" below the image. */
figure{ margin: 0; }

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

html, body{
  scroll-behavior: smooth;
  scroll-padding-top: calc(110px + env(safe-area-inset-top));
}

#quote-panel{
  scroll-margin-top: calc(110px + env(safe-area-inset-top));
}

@media (min-width: 900px){
  html, body{ scroll-padding-top: 80px; }
  #quote-panel{ scroll-margin-top: 80px; }
}

[hidden]{ display: none !important; }

.sr-only{
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Fallback styling for arbitrary CONFIG["cost_body"] markup (tables, lists)
   that a theme's own stylesheet doesn't specifically target. */
table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  overflow: hidden;
}
thead th{
  background: rgba(0,0,0,.04);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.12);
  white-space: nowrap;
  font-size: 13px;
}
td{
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid rgba(0,0,0,.10);
  font-size: 14px;
}
tbody tr:last-child td{ border-bottom: none; }
.table-scroll{ max-width: 100%; }
@media (max-width: 640px){
  .table-scroll{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table{ min-width: 720px; }
}

/* Heritage theme — Playfair Display + PT Serif, forest green + brass gold on cream. */
:root{
  --bg:#f6efe2; --surface:#fffcf5; --ink:#2b2418; --muted:#7a6c50; --line:#ddd0b0;
  --green:#1f4d3a; --gold:#b8894a;
}
body{ margin:0; font-family:'PT Serif',Georgia,serif; color:var(--ink); background:var(--bg); line-height:1.6; }
a{ color:inherit; text-decoration:none; }
h1,h2,.city-group__title{ font-family:'Playfair Display',Georgia,serif; }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:12px 22px; background:var(--green); color:var(--gold); border-radius:2px; font-weight:700; font-size:12px; letter-spacing:.12em; text-transform:uppercase; border:1px solid var(--gold); box-shadow:inset 0 1px 0 rgba(255,255,255,.15), 0 3px 0 #142f24; }
.btn:hover{ background:#173d2d; }
.topbar{ position:sticky; top:0; z-index:50; display:flex; align-items:center; justify-content:space-between; padding:20px 44px; border-bottom:2px solid var(--green); background:var(--bg); flex-wrap:wrap; gap:14px; }
.brand{ display:flex; align-items:center; gap:11px; font-family:'Playfair Display',Georgia,serif; font-weight:700; font-size:19px; letter-spacing:.01em; }
.nav{ display:flex; align-items:center; gap:26px; flex-wrap:wrap; }
.nav a:not(.btn){ font-size:12px; color:var(--muted); letter-spacing:.08em; text-transform:uppercase; font-family:'PT Serif',serif; }
.nav a:not(.btn)[aria-current="page"]{ color:var(--green); }
.hero{ text-align:center; padding:50px 40px 20px; }
.hero::before{ content:""; display:block; width:64px; height:2px; background:var(--gold); margin:0 auto 14px; }
.hero h1{ margin:0; font-size:34px; letter-spacing:-.01em; line-height:1.25; }
main{ max-width:900px; margin:0 auto; padding:20px 40px 50px; }
.card{ background:var(--surface); border:1px solid var(--line); padding:24px; box-shadow:0 1px 0 var(--gold) inset, 0 12px 28px rgba(43,36,24,.08); }
.weave{ display:grid; grid-template-columns:1.2fr .8fr; gap:22px; margin:-24px -24px 22px; padding:24px; border-bottom:1px solid var(--line); }
.weave--no-panel{ grid-template-columns:1fr; }
.weave--no-panel .weave-media{ max-width:62%; margin:0 auto; }
.weave-media{ border:6px solid var(--surface); outline:1px solid var(--line); aspect-ratio:4/3; overflow:hidden; }
.weave-media img{ display:block; width:100%; height:100%; object-fit:cover; filter:sepia(.35) saturate(1.05) contrast(1.02); }
.weave-panel{ border:1px solid var(--gold); background:#fbf6e9; padding:18px; display:flex; flex-direction:column; justify-content:center; gap:12px; }
.weave-title{ font-family:'Playfair Display',serif; font-weight:700; font-size:15px; text-align:center; margin:0; }
.weave-row{ display:flex; gap:8px; }
.weave-input{ flex:1; border:1px solid var(--line); border-radius:0; padding:10px; font-size:13px; background:#fff; font-family:'PT Serif',serif; }
h2{ margin:18px 0 8px; font-size:18px; }
p{ margin:0 0 6px; font-size:14px; }
ul{ margin:0 0 6px; padding-left:20px; }
li{ margin:0 0 4px; font-size:14px; }
hr{ border:0; border-top:1px solid var(--line); margin:22px 0; }
.muted{ color:var(--muted); font-size:13px; font-style:italic; }
.city-group__title{ margin:26px 0 8px; font-size:18px; padding-bottom:8px; border-bottom:2px solid var(--gold); }
.city-grid{ list-style:none; padding:0; margin:12px 0 0; display:grid; grid-template-columns:repeat(auto-fit, minmax(150px,1fr)); gap:2px; background:var(--line); border:1px solid var(--line); }
.city-grid a{ display:block; background:var(--surface); padding:12px; font-weight:700; font-size:13px; text-align:center; }
.city-grid a:hover{ background:var(--bg); color:var(--green); }
footer{ border-top:2px solid var(--green); background:var(--bg); }
.footer-inner{ max-width:900px; margin:0 auto; padding:30px 40px 26px; display:grid; gap:10px; justify-items:center; text-align:center; }
.footer-cta-text{ margin:0; font-size:14px; color:var(--muted); max-width:560px; font-style:italic; }
.footer-links{ display:flex; gap:12px; margin:4px 0 0; }
.footer-links a{ color:var(--muted); font-size:11px; letter-spacing:.06em; }
.footer-links a:hover{ text-decoration:underline; }
.footer-copy{ color:var(--muted); font-size:11px; letter-spacing:.04em; }
@media (max-width: 760px){
  .weave{ grid-template-columns:1fr; }
  .topbar{ justify-content:center; text-align:center; }
}

/* =========================================================
   QUOTE / ESTIMATE WIZARD
========================================================= */
.est-body{ height:100%; background:var(--bg); }
.est-page{ min-height:100vh; display:grid; grid-template-rows:auto 1fr auto; }
.topbar--estimate{ position:sticky; top:0; z-index:50; }
.topbar-inner--estimate{ justify-content:center; }
.brand--estimate{ gap:12px; }
.brand-logo--estimate{ width:40px; height:40px; }
.brand-name--estimate{ font-size:24px; letter-spacing:.01em; }
.est-main{ display:grid; place-items:center; padding:30px 20px 50px; }
.est-shell{ width:min(760px,100%); }
.est-title{ margin:0 0 14px; font-size:32px; letter-spacing:-.01em; line-height:1.2; }
.est-weave{ width:min(1080px,100%); display:grid; grid-template-columns:1fr 1fr; gap:24px; align-items:start; }
.est-weave-media{ border:6px solid var(--surface); outline:1px solid var(--line); aspect-ratio:4/3; overflow:hidden; align-self:start; }
.est-weave-media img{ display:block; width:100%; height:100%; object-fit:cover; filter:sepia(.35) saturate(1.05) contrast(1.02); }
@media (max-width:820px){ .est-weave{ grid-template-columns:1fr; } }
.est-form{ background:var(--surface); border:1px solid var(--line); padding:22px; box-shadow:0 1px 0 var(--gold) inset, 0 12px 28px rgba(43,36,24,.08); }
.est-header{ margin-bottom:12px; }
.est-progress{ height:6px; background:var(--line); overflow:hidden; }
.est-bar{ height:100%; width:25%; background:var(--green); }
.est-meta{ display:flex; justify-content:space-between; gap:10px; margin-top:10px; font-size:13px; color:var(--muted); }
.est-error{ margin:10px 0; padding:10px 12px; border:1px solid rgba(190,30,60,.3); background:rgba(190,30,60,.08); font-size:14px; }
.est-panel label{ display:block; margin:10px 0; font-size:13px; color:var(--muted); }
.est-panel input, .est-panel select, .est-panel textarea{ width:100%; border:1px solid var(--line); border-radius:0; padding:11px 12px; font-size:15px; background:#fff; color:var(--ink); font-family:'PT Serif',serif; }
.est-panel textarea{ resize:vertical; }
.est-tcpa{ margin-top:12px; font-size:10px; line-height:1.3; color:var(--muted); }
.est-tcpa a{ color:var(--green); text-decoration:underline; }
.est-row{ display:grid; grid-template-columns:1fr 120px 120px; gap:10px; }
@media (max-width:720px){ .est-row{ grid-template-columns:1fr; } }
.est-actions{ display:flex; justify-content:space-between; gap:10px; margin-top:16px; }
.btn.ghost{ background:transparent; color:var(--ink); border-color:var(--line); box-shadow:none; }
.btn.ghost:hover{ background:var(--surface); }
.est-page footer .footer-inner{ padding-top:20px; padding-bottom:20px; }
