/* =============================================
   InstaBoQ — Main Stylesheet
   Target: architects & contractors in India
   ============================================= */

:root {
  --teal:        #1D9E75;
  --teal-light:  #E1F5EE;
  --teal-dark:   #0F6E56;
  --teal-hover:  #18896A;
  --amber:       #9A6700;
  --text:        #1a1a1a;
  --text-sec:    #6b7280;
  --border:      #e5e7eb;
  --bg:          #ffffff;
  --surface:     #f9fafb;
  --radius:      6px;
  --shadow:      0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.09);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Navbar ---- */
.navbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  text-decoration: none;
}
.brand span { color: var(--teal); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
}
.nav-links a {
  color: var(--text-sec);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--teal);
  background: var(--teal-light);
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary  { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-hover); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--teal);
  color: var(--teal);
  padding: 7px 14px;
}
.btn-outline:hover { background: var(--teal-light); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-sec);
  padding: 7px 14px;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }

.btn-full { width: 100%; text-align: center; padding: 11px; }

/* ---- Hero ---- */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero-inner { text-align: center; }

.pill-badge {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.25;
}

.hero-sub {
  font-size: 15px;
  color: var(--text-sec);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* Mode cards */
.mode-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto 20px;
}

.mode-card {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mode-card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.mode-card.selected { border-color: var(--teal); background: var(--teal-light); }

.mode-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.mode-card-desc {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.5;
  margin-bottom: 10px;
}

.mode-badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-sec);
  padding: 2px 10px;
  font-weight: 500;
}
.mode-card.selected .mode-badge {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.cta-wrap { max-width: 480px; margin: 0 auto; }

/* ---- Page layout ---- */
.page-container { padding: 48px 0 60px; }
.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-header p { color: var(--text-sec); margin-top: 4px; }

/* ---- Estimator Quick ---- */
.estimator-wrap {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.results-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sample-note {
  font-size: 12px;
  color: var(--text-sec);
  font-style: italic;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.unit-hint { font-weight: 400; color: var(--text-sec); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--teal); }
.form-group input.invalid { border-color: #ef4444; }

.field-note { font-size: 11px; color: var(--text-sec); margin-top: 3px; display: block; }

/* Radio cards for foundation / project type */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.radio-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.radio-card input[type="radio"] { position: absolute; opacity: 0; }
.radio-card:hover { border-color: var(--teal); }
.radio-card.checked { border-color: var(--teal); background: var(--teal-light); }

.radio-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: block;
}
.radio-card-hint {
  font-size: 11px;
  color: var(--text-sec);
  margin-top: 2px;
  display: block;
}

/* ---- Results ---- */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.results-actions { display: flex; gap: 8px; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.summary-card .s-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sec);
  margin-bottom: 5px;
}
.summary-card .s-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  font-family: monospace;
}
.summary-card.highlight .s-value { color: var(--teal); }

/* ---- BOQ Table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--teal);
  color: #fff;
  padding: 9px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.data-table th.num, .data-table td.num { text-align: right; }

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--teal-light); }

.data-table tr.section-row td {
  background: var(--teal-light);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal-dark);
  padding: 6px 10px;
}

.data-table tr.total-row td {
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border: none;
}

.amount-cell { font-weight: 600; font-family: monospace; }
.dsr-code { font-family: monospace; font-size: 12px; color: var(--text-sec); }

/* ---- Material Rates Page ---- */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.tab-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-sec);
  transition: all 0.15s;
  font-family: inherit;
}
.tab-btn:hover { border-color: var(--teal); color: var(--teal); }
.tab-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.search-bar-row { margin-bottom: 16px; }
.search-input {
  width: 100%;
  max-width: 380px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--teal); }

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.loading-cell, .empty-cell {
  text-align: center !important;
  padding: 40px !important;
  color: var(--text-sec);
}

.rates-disclaimer {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-sec);
  text-align: center;
}

.results-disclaimer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-sec);
  font-family: monospace;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.7;
}

/* ---- Residential banner ---- */
.residential-banner {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--teal-light);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.residential-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--teal-dark);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.residential-sub {
  font-size: 13px;
  color: var(--teal-dark);
  opacity: 0.85;
}

/* ---- Foundation info strip ---- */
.foundation-info {
  font-size: 12px;
  color: var(--text-sec);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 16px;
}
.foundation-info-icon { margin-right: 4px; color: var(--teal); }

/* ---- Project summary chips ---- */
.project-summary { margin-bottom: 16px; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sec);
  padding: 3px 11px;
}

/* ---- Cost breakdown bar ---- */
.breakdown-wrap {
  margin-bottom: 20px;
}
.breakdown-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.breakdown-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
  margin-bottom: 8px;
}
.bar-segment { transition: width 0.4s ease; }
.breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-sec);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- DSR description tooltip ---- */
.info-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--teal);
  padding: 0 3px;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.15s;
  font-family: inherit;
}
.info-btn:hover { opacity: 1; }
.item-name-wrap { display: inline-flex; align-items: center; gap: 2px; }

.dsr-tooltip {
  display: none;
  position: absolute;
  z-index: 500;
  max-width: 340px;
  background: #1a1a1a;
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 13px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.dsr-tooltip.visible { display: block; }

/* ---- Stats strip ---- */
.stats-strip {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-sec);
  font-family: monospace;
  letter-spacing: 0.3px;
}
.strip-sep { margin: 0 8px; color: var(--border); }

/* ---- How it works ---- */
.how-it-works {
  padding: 56px 0 64px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.hiw-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
  margin-bottom: 36px;
}
.hiw-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hiw-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 220px;
  text-align: left;
}
.hiw-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hiw-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.hiw-step-desc { font-size: 12px; color: var(--text-sec); line-height: 1.5; }
.hiw-arrow { font-size: 18px; color: var(--border); padding: 0 4px; }

/* ---- Formula note (one-liner below item name in BOQ table) ---- */
.formula-note {
  font-size: 11px;
  color: var(--text-sec);
  font-family: monospace;
  margin-top: 2px;
  line-height: 1.4;
}

/* ---- Error ---- */
.error-msg {
  margin-top: 0;
  margin-bottom: 16px;
  padding: 11px 14px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  color: #b91c1c;
  font-size: 13px;
}

/* ---- Detailed estimator ---- */
.detailed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.item-list { display: flex; flex-direction: column; gap: 12px; }

.item-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.item-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.item-card-title { font-size: 13px; font-weight: 600; }
.item-card-dsr { font-size: 11px; color: var(--text-sec); font-family: monospace; }

.item-card-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; }

.item-card-amount { font-size: 16px; font-weight: 600; color: var(--teal); font-family: monospace; }

.add-item-row { text-align: center; padding: 20px; }

.total-sidebar { position: sticky; top: 72px; }

.total-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.total-box h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.total-line { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.total-line .label { color: var(--text-sec); }
.total-line .value { font-weight: 600; font-family: monospace; }
.total-line.grand { font-size: 16px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.total-line.grand .value { color: var(--teal); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg);
  border-radius: 10px;
  padding: 24px;
  width: 480px;
  max-width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-close { float: right; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-sec); }

.dsr-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}
.dsr-option:hover { background: var(--teal-light); }
.dsr-option-name { font-size: 13px; font-weight: 500; }
.dsr-option-meta { font-size: 12px; color: var(--text-sec); }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-sec);
  margin-top: 40px;
}
.footer-brand {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.footer-brand span { color: var(--teal); }
.footer-tagline { font-size: 13px; color: var(--text-sec); margin-bottom: 12px; }
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 14px;
  font-size: 13px;
}
.footer-links a { color: var(--text-sec); }
.footer-links a:hover { color: var(--teal); }
.footer-note { font-size: 12px; margin-bottom: 12px; }
.footer-disclaimer {
  max-width: 720px;
  margin: 0 auto;
  font-size: 11px;
  color: var(--text-sec);
  opacity: 0.75;
  line-height: 1.6;
  font-family: monospace;
}

/* ---- Guides ---- */
/* Article column capped at 720px for a readable long-form measure. */
.guide-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.guide-breadcrumb {
  font-size: 12px;
  color: var(--text-sec);
  margin-bottom: 20px;
}
.guide-breadcrumb span { margin: 0 6px; }
.guide-breadcrumb-current { color: var(--text-sec); }

.guide-h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.guide-dates {
  font-size: 12px;
  color: var(--text-sec);
  font-family: monospace;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.guide-body { font-size: 15px; line-height: 1.75; }
.guide-body h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 40px 0 12px;
}
.guide-body h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
.guide-body p { margin-bottom: 16px; }
.guide-body ul, .guide-body ol { margin: 0 0 16px 20px; }
.guide-body li { margin-bottom: 6px; }
.guide-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}
.guide-body th, .guide-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.guide-body th { background: var(--surface); font-weight: 600; }
.guide-body code {
  font-family: monospace;
  font-size: 13px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Table wrapper — keeps wide BOQ tables scrollable instead of breaking the
   page layout on narrow screens. */
.guide-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.guide-table-wrap table { margin-bottom: 0; border: none; }
.guide-table-wrap th, .guide-table-wrap td { border: none; border-bottom: 1px solid var(--border); }
.guide-table-wrap tbody tr:last-child th,
.guide-table-wrap tbody tr:last-child td { border-bottom: none; }
.guide-table-wrap tbody th { font-weight: 500; background: transparent; }
.guide-table-wrap td { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* The 6-column worked-example BOQ needs a floor width, so it scrolls rather
   than squashing its description column. */
.guide-table-wide { min-width: 680px; }

.guide-table-missing {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-sec);
}
.guide-table-missing p { margin-bottom: 6px; }
.guide-table-missing p:last-child { margin-bottom: 0; }

.guide-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 20px;
}

.guide-faq { margin-top: 48px; }
.guide-faq-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.guide-faq-item:last-child { border-bottom: none; }
.guide-faq-q { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.guide-faq-a { font-size: 15px; color: var(--text-sec); margin-bottom: 0; }

.guide-cta {
  display: block;
  margin-top: 48px;
  padding: 24px;
  background: var(--teal-light);
  border-radius: var(--radius);
  text-align: center;
}
.guide-cta p { font-size: 14px; color: var(--teal-dark); margin-bottom: 14px; }

/* Guides listing */
.guides-intro { font-size: 15px; color: var(--text-sec); margin-bottom: 32px; }
.guide-cards { list-style: none; display: grid; gap: 14px; }
.guide-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.guide-card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
/* Padding lives on the anchor, not the card, so the whole card face — edges
   included — is a hit target rather than a dead ring around the link. */
.guide-card-link { display: block; padding: 20px; text-decoration: none; color: inherit; }
.guide-card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
  color: var(--text);
}
.guide-card-link:hover .guide-card-title { color: var(--teal); }
.guide-card-desc { font-size: 14px; color: var(--text-sec); margin-bottom: 8px; }
.guide-card-meta { font-size: 11px; color: var(--text-sec); font-family: monospace; }

@media (max-width: 560px) {
  .guide-inner { padding: 32px 16px 48px; }
  .guide-h1 { font-size: 25px; }
  .guide-body h2 { font-size: 19px; }
  /* Stack CTAs full-width rather than letting them wrap awkwardly. */
  .guide-cta-actions { flex-direction: column; }
  .guide-cta-actions .btn { width: 100%; text-align: center; }
}

/* ---- Print ---- */
@media print {
  .navbar, .form-panel, .btn, .footer, .results-actions { display: none !important; }
  .estimator-wrap { display: block; }
  .results-panel { border: none; box-shadow: none; padding: 0; }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .detailed-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .summary-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .mode-cards { flex-direction: column; }
  .summary-cards { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .radio-cards { grid-template-columns: 1fr; }
}

/* ── Drawing standards collapsible (step2_upload) ── */
.drawing-standards {
  margin: 16px 0;
  padding: 12px 16px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
}
.drawing-standards summary {
  cursor: pointer;
  color: #1D9E75;
  font-weight: 500;
}
.drawing-standards .standards-block {
  margin-top: 12px;
  color: #374151;
}
.drawing-standards h4 {
  margin: 16px 0 8px 0;
  font-size: 14px;
  color: #0F6E56;
}
.drawing-standards ul {
  margin: 4px 0 8px 20px;
  line-height: 1.6;
}
.drawing-standards .note {
  margin-top: 12px;
  padding: 8px 12px;
  background: #E1F5EE;
  border-radius: 6px;
  color: #0F6E56;
  font-style: italic;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #1a7a4a;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  width: fit-content;
}

.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.faq-section {
  padding: 64px 0;
  background: #f9fafb;
}

.faq-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 32px;
  text-align: center;
}

.faq-item {
  max-width: 720px;
  margin: 0 auto 24px auto;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 20px;
}

.faq-q {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.faq-a {
  font-size: 0.92rem;
  color: #4b5563;
  line-height: 1.65;
}

/* =============================================
   Material Rates by City (rates app)
   ============================================= */
.mr-page { padding: 40px 24px 72px; max-width: 1000px; }
.mr-narrow { max-width: 760px; }
.mr-breadcrumb { font-size: 13px; color: var(--text-sec); margin-bottom: 20px; }
.mr-breadcrumb a { color: var(--text-sec); }
.mr-breadcrumb a:hover { color: var(--teal-dark); }
.mr-bc-sep { margin: 0 8px; color: var(--border); }
.mr-header { margin-bottom: 28px; }
.mr-header h1 { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.mr-updated { font-family: monospace; font-size: 12px; color: var(--text-sec); margin-top: 6px; }
.mr-sub, .mr-intro { color: var(--text-sec); margin-top: 12px; max-width: 680px; }
.mr-h2 { font-size: 19px; font-weight: 500; margin: 40px 0 16px; }
.mr-city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mr-city-card { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.mr-city-card:hover { border-color: var(--teal); }
.mr-city-name { font-weight: 500; color: var(--text); font-size: 16px; }
.mr-city-state { font-size: 12px; color: var(--text-sec); }
.mr-cat-list { columns: 3; color: var(--text-sec); list-style: none; }
.mr-cat-list li { padding: 3px 0; }

/* Rate table — FIXED column widths to keep CLS at 0. */
.mr-table-wrap { overflow-x: auto; }
.mr-rate-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.mr-rate-table th, .mr-rate-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.mr-rate-table thead th { font-weight: 500; color: var(--text-sec); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface); }
.mr-rate-table .c-mat  { width: 34%; }
.mr-rate-table .c-unit { width: 16%; }
.mr-rate-table .c-rate { width: 16%; }
.mr-rate-table .c-note { width: 34%; }
.mr-rate-table tbody tr:nth-child(even) { background: var(--surface); }
.mr-spec { display: block; font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.mr-rate { font-family: monospace; font-weight: 600; white-space: nowrap; }
.mr-rate-verified { color: var(--teal-dark); }
/* Derived/indicative are never a firm figure — muted amber with a dashed
   underline, visually distinct from a verified (solid teal) rate. */
.mr-rate-derived,
.mr-rate-indicative { color: var(--amber); border-bottom: 1px dashed var(--amber); padding-bottom: 1px; }
.mr-rate-none { color: var(--text-sec); }
.mr-caption { display: block; font-size: 12px; color: var(--text-sec); line-height: 1.5; }
.mr-stale-note { color: #c0392b; margin-top: 4px; }
.mr-stale { opacity: 0.6; }
.mr-rate-hero { padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 28px; }
.mr-rate-figure { font-family: monospace; font-size: 34px; font-weight: 600; }
.mr-rate-unit { color: var(--text-sec); font-size: 14px; margin-bottom: 10px; }
.mr-body { margin-top: 32px; }
.mr-prose { color: var(--text); max-width: 720px; }
.mr-prose h2, .mr-prose h3 { margin: 20px 0 8px; font-weight: 500; }
.mr-prose p, .mr-prose ul { margin-bottom: 12px; }
.mr-prose ul { padding-left: 20px; }
.mr-faq { margin-top: 32px; }
.mr-faq-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.mr-faq-q { font-weight: 500; }
.mr-faq-a { color: var(--text-sec); margin-top: 4px; }
.mr-links { margin-top: 28px; }
.mr-link-list { list-style: none; }
.mr-link-list li { padding: 4px 0; }
.mr-inline { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.mr-lead { margin-top: 48px; padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mr-lead-title { font-size: 18px; font-weight: 500; margin-bottom: 18px; }
.mr-lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.mr-lead-grid label { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; gap: 6px; }
.mr-lead-grid input, .mr-lead-grid select, .mr-lead-details textarea { height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.mr-lead-details { margin: 14px 0; }
.mr-lead-details textarea { width: 100%; height: auto; }
.mr-lead .btn { margin-top: 16px; }
.mr-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* Persistent rates -> upload CTA, visible with no form submission needed. */
.mr-upload-cta {
  margin-top: 28px;
  padding: 20px 24px;
  border: 1px solid var(--teal);
  border-radius: 12px;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.mr-upload-copy { margin: 0; font-size: 14px; color: var(--teal-dark); font-weight: 500; }
.mr-upload-btn { white-space: nowrap; }

@media (max-width: 640px) {
  .mr-lead-grid { grid-template-columns: 1fr; }
  .mr-cat-list { columns: 2; }
  .mr-header h1 { font-size: 24px; }
  .mr-upload-cta { flex-direction: column; align-items: stretch; text-align: center; }
}

@media print {
  .navbar, .footer, .mr-lead, .mr-links, .mr-upload-cta { display: none; }
  .mr-rate-table { font-size: 12px; }
}

/* Lead form actions / states */
.mr-lead-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.mr-wa-btn { background: #25D366; color: #fff; border: none; }
.mr-wa-btn:hover { background: #1ebe5b; color: #fff; }
.mr-lead-error { color: #c0392b; margin-top: 12px; font-size: 13px; }
.mr-lead-thanks { padding: 20px 0; font-size: 15px; }
