/* ==========================================================================
   CALCULATOR LAYOUT - Extracted from demo/other-calcs.html + demo/slc-calc.html
   Two-panel app window matching the rebuild design system exactly
   ========================================================================== */

/* --- Attribution (page metadata footer; sits below SEO zone) --- */
.bf-attribution {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 32px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-light, #e5e7eb);
  text-align: center;
}
.bf-attribution-author {
  font-weight: 500;
}
.bf-attribution time {
  white-space: nowrap;
}

/* --- Page Wrapper --- */
.calculator-page {
  padding: 48px 0 64px;
  overflow-x: clip;
}

/* Hide number input spinners globally on calculator pages */
.calculator-page input[type='number']::-webkit-inner-spin-button,
.calculator-page input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calculator-page input[type='number'] {
  -moz-appearance: textfield;
}

/* --- Header --- */
/* --- Header --- */
.bf-calc-header {
  text-align: left;
  margin-bottom: 48px;
}
.bf-calc-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.1;
}
.bf-calc-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
}
/* Multi-paragraph header (AEO lede pattern: cost claim + instruction).
   First paragraph reads as a real lede (text-main, slightly larger,
   wider measure); subsequent paragraphs stay subdued for instructions.
   Falls back to the single-paragraph subtitle styling above for calcs
   that haven't adopted the AEO lede convention yet. */
.bf-calc-header p:not(:only-of-type):first-of-type {
  font-size: 1.0625rem;
  color: var(--text-main);
  max-width: 720px;
}
.bf-calc-header p + p {
  margin-top: 14px;
  font-size: 0.95rem;
}
.bf-calc-header p strong {
  color: var(--text-main);
  font-weight: 600;
}

/* --- App Window (Two-Panel Grid) --- */
.bf-app-window {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 80px;
  align-items: start;
  padding-bottom: 32px;
}

@media (max-width: 992px) {
  .bf-app-window {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* ==========================================================================
   LEFT PANEL: CONFIGURATION INPUTS
   ========================================================================== */
.bf-panel-config {
  background: var(--bg-base);
  padding: 0;
}

/* Config body wrapper (scrollable content area) */
.bf-config-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bf-config-section {
  margin-bottom: 48px;
  padding-bottom: 48px;
  position: relative;
}
.bf-config-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--border-light) 0%, transparent 100%);
}
.bf-config-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}
.bf-config-section:last-child::after {
  display: none;
}

/* --- Input groups and headers --- */
.bf-input-group {
  margin-bottom: 20px;
}
.bf-input-group:last-child {
  margin-bottom: 0;
}
.bf-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 0;
}
.bf-checkbox-label input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary, #2563eb);
  cursor: pointer;
}
.bf-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.bf-input-header label {
  margin-bottom: 0;
}
/* When tabs are inside the header, let them take full width below the label */
.bf-input-header .bf-tabs {
  flex: 1 1 100%;
  margin-bottom: 0;
}

/* --- Input method groups (show/hide based on tab selection) --- */
.input-method-group {
  margin-top: 8px;
}
.input-method-group.hidden {
  display: none;
}

/* --- Area summary row (SLC total area display) --- */
.bf-area-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}
.bf-area-summary-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.bf-area-summary-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}
.bf-area-summary-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Custom specs grid (SLC custom product fields) --- */
.bf-custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 600px) {
  .bf-custom-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Collapsible content (expandable sections) --- */
.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.collapsible-content.open {
  max-height: 500px;
}

/* --- Text button (add room, etc.) --- */
.bf-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--transition-base);
}
.bf-btn-text:hover {
  color: var(--accent-hover);
}

/* --- Slider value display --- */
.bf-slider-val {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 40px;
  text-align: right;
}

.bf-config-section-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-main);
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: none;
}

/* --- Input Groups ---
   Each input-group contains a label + input (or select).
   Tighter spacing keeps the form compact and scannable. */
.input-group {
  margin-bottom: 16px;
}
.input-group:last-child {
  margin-bottom: 0;
}

.input-group > label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.input-group small,
.helper-text,
.sub-label {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Selects --- */
.bf-select {
  width: 100%;
  height: 52px;
  padding: 0 40px 0 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  text-overflow: ellipsis;
  transition: all var(--transition-base);
}
.bf-select:focus {
  background-color: var(--bg-base);
  border-color: var(--text-main);
  box-shadow:
    0 0 0 1px var(--text-main),
    var(--shadow-subtle);
}

/* --- Side-by-side input split (2-column grid for Length + Width etc.) --- */
.input-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}
@media (max-width: 576px) {
  .input-row-split {
    grid-template-columns: 1fr;
  }
}

/* --- Inline Inputs & Rows ---
   .input-row is a flex container for multiple input-fields side by side.
   Each input-field keeps its own border. For the unified single-border
   look, use .bf-inline-input instead. */
.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.input-field {
  flex: 1 1 120px;
  min-width: 0;
  position: relative;
}
/* Sub-labels inside input-row fields */
.input-row .input-field > label,
.input-row > .input-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
/* Inputs inside .input-row are borderless */
.input-field input,
.input-group > input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-base);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}
.input-field:not(.input-row .input-field) input:focus,
.input-group > input:focus {
  background: var(--bg-base);
  border-color: var(--text-main);
  box-shadow:
    0 0 0 1px var(--text-main),
    var(--shadow-subtle);
}

/* Unit select inside .input-row - divider only, no own border */
.unit-select {
  flex-shrink: 0;
  min-width: 100px;
  align-self: flex-end;
}
.unit-select select {
  width: 100%;
  height: 52px;
  padding: 0 32px 0 16px;
  background-color: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  transition: var(--transition-base);
}
.unit-select select:hover {
  color: var(--text-main);
  background-color: var(--bg-inset);
}

/* --- Catch-all: Any input/select inside config panel that isn't already styled --- */
.bf-panel-config input[type='number'],
.bf-panel-config input[type='text'] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-base);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}
.bf-panel-config input[type='number']:focus,
.bf-panel-config input[type='text']:focus {
  background: var(--bg-base);
  border-color: var(--text-main);
  box-shadow:
    0 0 0 1px var(--text-main),
    var(--shadow-subtle);
}
.bf-panel-config select {
  width: 100%;
  height: 52px;
  padding: 0 40px 0 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: all var(--transition-base);
}
.bf-panel-config select:focus {
  background-color: var(--bg-base);
  border-color: var(--text-main);
  box-shadow:
    0 0 0 1px var(--text-main),
    var(--shadow-subtle);
}
.bf-panel-config label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  cursor: pointer;
}

/* (bf-inline-input rules moved to SLC-SPECIFIC section below) */

/* --- Segmented Radio Controls --- */
/* Radio group - card-style buttons matching bag-option/sheet-option */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}
.radio-group label {
  flex: 1;
  text-align: center;
  position: relative;
  cursor: pointer;
  padding: 14px 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radio-group label:hover {
  border-color: var(--text-light);
  background: var(--bg-subtle);
}
.radio-group input[type='radio'] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
/* Selected state */
.radio-group label:has(input[type='radio']:checked) {
  border-color: var(--text-main);
  font-weight: 600;
}
/* Fallback for browsers without :has() */
.radio-group input[type='radio']:checked ~ span {
  background: var(--bg-base);
  font-weight: 600;
}

/* --- Bag Size Options (Concrete calculator) --- */
.bag-size-row,
.sheet-size-row {
  display: flex;
  gap: 8px;
}
.bag-option,
.sheet-option {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}
.bag-option:hover,
.sheet-option:hover {
  border-color: #cbd5e1;
}
/* --- Unified selection state ---
   All clickable option cards share the same selected/active indicator:
   terracotta border + subtle outer glow. This covers:
   - .bag-option.selected (concrete bag sizes)
   - .sheet-option.selected (drywall sheet sizes)
   - .radio-option.selected (brick project type, pattern, mortar, etc.)
   - .brick-option.selected (brick size grid)
   - .bf-product-card.active / .product-card.active (SLC product selection)
*/
.bag-option.selected,
.sheet-option.selected,
.radio-option.selected,
.brick-option.selected,
.bf-product-card.active,
.product-card.active {
  background: var(--bg-base);
  border-color: var(--text-main);
  box-shadow: 0 0 0 1px var(--text-main);
}

/* --- Radio option cards (brick calculator, shared pattern) --- */
/* When a radio-group contains .radio-option cards, allow wrapping */
.radio-group:has(.radio-option) {
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.radio-option {
  flex: 1 1 auto;
  min-width: 120px;
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}
.radio-option:hover {
  border-color: #cbd5e1;
}
.radio-option input[type='radio'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.radio-option label {
  cursor: pointer;
  display: block;
}

/* --- Brick size grid + option cards --- */
.brick-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.brick-option {
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}
.brick-option:hover {
  border-color: #cbd5e1;
}

.bag-size,
.sheet-size {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}
.bag-weight,
.sheet-dimensions {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Brick option card details --- */
.brick-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}
.brick-dimensions {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.brick-coverage {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* --- Area cards (drywall rooms, mulch shapes) --- */
.areas-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.area-card {
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.area-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
@media (max-width: 480px) {
  .area-inputs {
    grid-template-columns: 1fr;
  }
}

/* --- Inline radio button pairs (Yes/No toggles) ---
   Compact segmented toggle for binary choices. Hides the radio dot
   and uses background color to indicate selection. */
.bf-panel-config label:has(> input[type='radio']) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  margin-right: 6px;
  margin-top: 6px;
}
.bf-panel-config label:has(> input[type='radio']:checked) {
  background: var(--bg-base);
  border-color: var(--accent-primary);
  color: var(--text-main);
  font-weight: 600;
}
.bf-panel-config label > input[type='radio'] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-primary);
  margin: 0;
}

/* --- Calculator results wrapper (shared across multiple calculators) --- */
.calculator-results {
  margin-top: 0;
}

/* --- Add opening button (brick calculator) --- */
.add-opening-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  margin-top: 8px;
  transition: all var(--transition-base);
}
.add-opening-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(224, 93, 54, 0.04);
}

/* --- Inline label (next to input on same line) --- */
.inline-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Tooltips --- */
.tooltip {
  position: relative;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.75rem;
  color: var(--text-light);
  vertical-align: middle;
  margin-left: 4px;
}
.tooltip:hover {
  color: var(--accent-primary);
}
.tooltiptext {
  visibility: hidden;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 0;
  background: var(--bg-dark);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  white-space: normal;
  width: 260px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* --- Diagram notes (asphalt calculator) --- */
.diagram-note {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 8px;
}

/* --- Sub labels and optional indicators --- */
.sub-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.optional-label {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 400;
}

/* --- Spacing utility for stacked inputs --- */
.mt-input {
  margin-top: 16px;
}

/* --- Checkbox Groups --- */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox-group input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}
.checkbox-group label {
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
}

/* --- Calculator Action Buttons ---
   Primary (Calculate) takes visual weight. Reset is subtle.
   Both are compact -- they're utility actions, not CTAs. */
.calculator-buttons {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-bottom: 16px;
}
.calculator-buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  height: 56px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
}
.calculator-buttons .btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  flex: 2;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 14px rgba(224, 93, 54, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.calculator-buttons .btn-primary:hover {
  background: #c94e2a;
  box-shadow: 0 6px 20px rgba(224, 93, 54, 0.4);
  transform: translateY(-1px);
}
.calculator-buttons .btn-primary:active {
  transform: scale(0.97);
}
.calculator-buttons .btn-outline,
.calculator-buttons .btn-lg:not(.btn-primary) {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  flex: 1;
}
.calculator-buttons .btn-outline:hover,
.calculator-buttons .btn-lg:not(.btn-primary):hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

/* --- Add/Remove Line Item Buttons (Project Estimate Builder) --- */
#add-line-item {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  height: 48px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-base);
  margin-top: 12px;
}
#add-line-item:hover {
  border-color: var(--text-light);
  color: var(--text-main);
  background: var(--bg-subtle);
}
.remove-line-item {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition-base);
  flex-shrink: 0;
  padding: 0;
}
.remove-line-item:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ==========================================================================
   RIGHT PANEL: DASHBOARD RESULTS
   ========================================================================== */
/* Right panel: sticky results card. min-width:0 prevents grid blowout. */
.bf-panel-dashboard {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  min-width: 0;
  padding: 0;
  scroll-margin-top: 120px;
}

.bf-panel-dashboard::-webkit-scrollbar {
  display: none;
}

/* Short viewports (laptops, split-screen, tablets in landscape with devtools)
   can't fit the full ledger inside calc(100vh - 104px). Drop the sticky
   constraint so the card flows with the page and the bottom rows stay
   reachable. Sticky scrolling only makes sense on tall screens. */
@media (max-height: 800px) {
  .bf-panel-dashboard {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* --- "Needs Calculation" placeholder state --- */
/* Desktop: dim results and show hint overlay.
   No position override -- sticky from .bf-panel-dashboard still applies,
   and sticky establishes a containing block for the ::after overlay. */
/* bf-needs-calc: no overlay or dimming - just show default values like the demo */
.bf-panel-dashboard.bf-needs-calc::after {
  display: none;
  white-space: nowrap;
}
/* ES overlay removed - no overlay in demo style */

/* h3 inside the doc-header - just text styling, header handles layout */
.bf-doc-header h3 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

/* --- Ledger card structure (demo-style right panel) --- */
.ledger-body {
  padding: 20px 24px 24px;
}
.primary-metric {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--bg-inset);
}
.primary-metric .value-wrapper {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
}
.primary-metric .value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.primary-metric .unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
}
.primary-metric .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 10px;
}
.ledger-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 20px 0 8px;
}
.ledger-section-title:first-child {
  margin-top: 0;
}
/* Single combined footnote replacing the old ledger-region-note +
   ledger-disclaimer stack. The dynamic regional sentence (drywall sets
   #region-line on ZIP entry) and the static disclaimer share one paragraph
   so the card has one footnote, not two. */
.ledger-footnote {
  font-size: 0.78rem;
  color: var(--text-light);
  margin: 18px 0 0;
  line-height: 1.5;
}
.ledger-footnote #region-line {
  display: block;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.bf-input-hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-left: 4px;
}
.ledger-list {
  margin-bottom: 16px;
}
.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-inset);
}
.ledger-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.ledger-row span:first-child {
  color: var(--text-light);
  font-weight: 500;
}
.ledger-row span:last-child {
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.ledger-row--cost span:last-child {
  font-size: 1.05rem;
  color: var(--accent-primary);
}

/* Property Assessment value-pitch modal (demolition calc).
   Reuses .bf-action-modal-* base styles for the overlay/card/close
   button. These additions style the inner value-pitch content:
   feature list, trust line, primary CTA, fine-print meta. */
/* Smooth open animation on the value-pitch modal. JS removes [hidden],
   forces a reflow, then adds .is-open — that two-step lets the browser
   commit the initial transform/opacity before transitioning. On close,
   .is-open is removed first, then [hidden] is set after the transition
   completes (matching duration, see demolition-cost-estimator.js). */
.bf-pa-modal {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.bf-pa-modal.is-open {
  opacity: 1;
}
/* Wider card than the default action-modal so personas and deliverables
   sit side-by-side without scroll. Extra padding gives the content room
   to breathe — premium-feeling whitespace, not cramped. */
.bf-pa-modal .bf-action-modal-card {
  max-width: 880px;
  padding: 36px 40px 28px;
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.34s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.22s ease-out;
}
@media (max-width: 768px) {
  .bf-pa-modal .bf-action-modal-card {
    padding: 24px 22px 20px;
  }
}
@media (max-width: 480px) {
  .bf-pa-modal .bf-action-modal-card {
    padding: 20px 16px 16px;
    border-radius: 10px;
  }
}
.bf-pa-modal.is-open .bf-action-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .bf-pa-modal,
  .bf-pa-modal .bf-action-modal-card {
    transition: none;
    transform: none;
  }
}
/* Header block — eyebrow + title + sub. Sits above the two-column
   grid so the value statement is read first, then the eye drops to
   the scannable content below. */
.bf-pa-header {
  margin: 0 0 22px;
}
@media (min-width: 769px) {
  .bf-pa-header {
    max-width: 640px;
  }
}

/* Two-column grid for the value-pitch sections. On desktop personas
   and deliverables sit side-by-side so visitors get the full pitch in
   one scan — no scroll required. A single hairline divider separates
   them; on mobile they stack with a horizontal divider instead. */
.bf-pa-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 0 0 22px;
  padding: 22px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
@media (min-width: 769px) {
  .bf-pa-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 26px 0;
  }
  .bf-pa-grid > .bf-pa-section + .bf-pa-section {
    padding-left: 40px;
    border-left: 1px solid var(--border-light);
  }
}

/* Section block — sits inside .bf-pa-grid. Margins are zeroed because
   the grid container handles spacing; leftover padding/border styles
   from the old single-column layout are reset here. */
.bf-pa-section {
  margin: 0;
  padding: 0;
  border: 0;
}
.bf-pa-section-label {
  margin: 0 0 14px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* Persona list — each ICP gets a clean two-line entry so visitors can
   self-identify on the first scan. Same shape as features. */
.bf-pa-personas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bf-pa-personas li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bf-pa-personas li strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.005em;
}
.bf-pa-personas li span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
/* Feature list — concrete deliverables in the report. Each row leads
   with a small accent check so the eye reads the list as "what you
   get" before parsing the words. Check sits at icon-baseline aligned
   with the strong label. */
.bf-pa-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bf-pa-features li {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  column-gap: 12px;
}
.bf-pa-features li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bf-pa-features li strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.005em;
}
.bf-pa-features li span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.bf-pa-check {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: var(--accent-primary);
  flex-shrink: 0;
}
.bf-pa-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  background: var(--text-main);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 20px rgba(15, 23, 42, 0.18);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.bf-pa-cta:hover {
  background: #000;
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 12px 28px rgba(15, 23, 42, 0.28);
}
.bf-pa-cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.bf-pa-cta:hover svg {
  transform: translateX(3px);
}

/* Title scaled up for the wider card and tightened to feel
   editorial — this is the single line that has to land. */
.bf-pa-modal .bf-action-modal-title {
  margin: 0 0 10px;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.bf-pa-modal .bf-action-modal-sub {
  margin: 0 !important;
  font-size: 1rem !important;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .bf-pa-modal .bf-action-modal-title {
    font-size: 1.35rem;
  }
  .bf-pa-modal .bf-action-modal-sub {
    font-size: 0.95rem !important;
  }
}

/* Eyebrow gets a quiet visual split: muted product label on the left,
   a small dark price pill on the right. Establishes the price up-front
   so the rest of the modal is read as deliverables, not pitch. */
.bf-pa-modal .bf-action-modal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px !important;
  padding: 0;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
}
.bf-pa-eyebrow-label {
  color: var(--text-muted);
}
.bf-pa-eyebrow-price {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--text-main);
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
}

/* ──────────────────────────────────────────────────────────────────────
   Defense variant ($300 File-Defense Report) — Grand Slam offer styling.
   Builds on the base PA-modal layout but adds: 3-section value stack,
   numbered bonus list, total-value anchor row, triple-guarantee list,
   and founder's-pricing scarcity line. All scoped to the defense
   variant block; the control variant uses the simpler 2-column grid.
   ────────────────────────────────────────────────────────────────── */
.bf-pa-eyebrow-anchor {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 3px 8px;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.3);
  color: var(--accent-primary);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}
.bf-pa-header--defense {
  margin-bottom: 18px;
}

.bf-pa-stack {
  margin: 0 0 18px;
  padding: 22px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.bf-pa-stack-section {
  margin-bottom: 22px;
}
.bf-pa-stack-section:last-of-type {
  margin-bottom: 0;
}
.bf-pa-stack-section--bonuses {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--border-light);
}
.bf-pa-stack-section--bonuses .bf-pa-features li {
  grid-template-columns: 24px 1fr;
}
.bf-pa-bonus-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  background: var(--text-main);
  color: #fff;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}
.bf-pa-value {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: rgba(13, 148, 136, 0.08);
  color: var(--accent-primary);
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.01em;
  vertical-align: 1px;
}
.bf-pa-stack-anchor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--text-main);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
}
.bf-pa-stack-anchor-label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.bf-pa-stack-anchor-value {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.bf-pa-guarantee-list {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: rgba(13, 148, 136, 0.04);
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 10px;
}
.bf-pa-guarantee-list .bf-pa-section-label {
  margin: 0 0 10px !important;
  color: var(--accent-primary) !important;
}
.bf-pa-guarantee-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: guarantee;
}
.bf-pa-guarantee-list ol li {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.55;
  counter-increment: guarantee;
}
.bf-pa-guarantee-list ol li::before {
  content: counter(guarantee);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: var(--accent-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}
.bf-pa-guarantee-list ol li strong {
  font-weight: 700;
  color: var(--text-main);
}

.bf-pa-scarcity {
  margin: 0 0 12px !important;
  font-size: 0.86rem !important;
  color: var(--text-muted) !important;
  text-align: center;
  line-height: 1.5;
}
.bf-pa-scarcity strong {
  color: var(--text-main);
  font-weight: 700;
}

/* Closing block — refund promise paired visually with the CTA.
   No icon, no tinted callout box: those read as the SaaS-standard
   trust badge and felt boilerplate. Type-only with a tight gap to
   the CTA below makes the promise feel like an extension of the
   button itself, not a separate badge competing with it. */
.bf-pa-close {
  margin-top: 4px;
}
.bf-pa-promise {
  margin: 0 0 12px !important;
  font-size: 0.9rem !important;
  color: var(--text-muted) !important;
  line-height: 1.5;
  text-align: center;
}
.bf-pa-promise strong {
  font-weight: 600;
  color: var(--text-main);
}

/* Secondary CTA — quiet always-visible link below the ledger total.
   Used on demolition for the paid Property Cost Assessment funnel.
   Dashed border keeps it visually subordinate to the calc itself; the
   inline link with arrow is the conversion event. Wraps cleanly on
   mobile — no fixed widths, no grid that can squeeze it. */
/* The CTA element is a <button> so the entire card is one click target.
   Reset the browser button defaults and lay out as a card-shaped block. */
.bf-secondary-cta {
  display: block;
  width: 100%;
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--bg-base);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.bf-secondary-cta:hover {
  background: #fff;
  border-color: var(--accent-primary);
  border-style: solid;
}
.bf-secondary-cta:hover .bf-secondary-cta-link {
  text-decoration: underline;
}
.bf-secondary-cta:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.bf-secondary-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.bf-secondary-cta-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
/* In-panel variant (desktop) — sits at the bottom of the dashboard
   column, directly under the ledger total. Pairs with the
   --no-cap dashboard modifier so the panel grows to natural height
   (panel + CTA) instead of being capped at viewport height. The
   sticky panel then pins panel + CTA together at the top of the
   viewport during scroll. Hidden on mobile where the dashboard
   itself is display:none until Calculate runs — the standalone
   sibling-of-grid CTA covers that case. */
.bf-secondary-cta--in-panel {
  margin: 18px 0 0;
  padding: 14px 16px;
}
@media (max-width: 992px) {
  .bf-secondary-cta--in-panel {
    display: none;
  }
}

/* Standalone variant — sibling of .bf-app-window in the page flow.
   Mobile-only on demolition: hidden on desktop, where the in-panel
   variant lives at the bottom of the sticky dashboard column. */
.bf-secondary-cta--standalone {
  margin: 24px 0 16px;
}
@media (min-width: 993px) {
  .bf-secondary-cta--standalone {
    display: none;
  }
}
/* Mobile/tablet: with the breakdown gate removed, this CTA is the only
   conversion path on small screens — promote it from a quiet link to a
   real card with brand weight (tinted bg, accent border, button-like
   action row). Solid border, not dashed; readable copy size; larger
   touch target. */
@media (max-width: 992px) {
  .bf-secondary-cta--standalone {
    margin: 20px 16px 16px;
    padding: 16px 18px;
    background: rgba(13, 148, 136, 0.06);
    border: 1.5px solid var(--accent-primary);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  }
  .bf-secondary-cta--standalone:hover {
    background: rgba(13, 148, 136, 0.1);
  }
  .bf-secondary-cta--standalone [data-cta-prompt] {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
  }
  .bf-secondary-cta--standalone .bf-secondary-cta-link {
    display: inline-flex;
    margin-left: 0;
    padding: 10px 16px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: normal;
  }
  .bf-secondary-cta--standalone:hover .bf-secondary-cta-link {
    text-decoration: none;
    filter: brightness(1.05);
  }
}
@media (max-width: 480px) {
  .bf-secondary-cta--standalone {
    margin: 16px 12px 12px;
    padding: 14px 16px;
  }
}

/* Per-calc opt-out from the dashboard's max-height cap. Default
   .bf-panel-dashboard is sticky with max-height: calc(100vh - 104px)
   and overflow-y: auto — which means anything past the cap is
   reachable only by scrolling inside the panel. For calcs that put
   a CTA at the bottom of the panel (demolition), --no-cap removes
   the cap and overflow so the panel grows to fit panel + CTA, while
   keeping the sticky pin so the whole column travels with the page. */
.bf-panel-dashboard.bf-panel-dashboard--no-cap {
  max-height: none;
  overflow-y: visible;
}
/* Inline note shown when user tries to open the SLC pricing modal
   before running the calculator. */
.bf-secondary-cta-note {
  margin: 8px 0 0;
  padding: 10px 14px;
  background: rgba(185, 28, 28, 0.06);
  border: 1px solid rgba(185, 28, 28, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #b91c1c;
  line-height: 1.5;
}
.bf-secondary-cta-note[hidden] {
  display: none;
}

/* Action Engine — the post-unlock conversion surface on the SLC calculator.
   Two clean cards that beat a raw email receipt: source materials, or
   build a bulletproof bid. Visually meaningful (not a quiet link) — this
   is where the ICP turns the calculator into a real workflow tool. */
.bf-action-engine {
  margin: 18px 0 0;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, #fff, var(--bg-base));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
.bf-action-engine-headline {
  margin: 0 0 4px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.bf-action-engine-sub {
  margin: 0 0 14px !important;
  font-size: 0.875rem !important;
  color: var(--text-muted) !important;
  line-height: 1.5;
}
.bf-action-engine-grid {
  /* Always one column. The dashboard panel that hosts this is narrow,
     so two-column cards squeezed sideways looked cut off. Stacked
     cards run full-width and read clean at any panel size. */
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.bf-action-engine-card {
  display: grid;
  grid-template-columns: 40px 1fr 16px;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
  font-family: inherit;
}
.bf-action-engine-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.bf-action-engine-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(224, 93, 54, 0.08);
  color: var(--accent-primary);
}
.bf-action-engine-card-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.bf-action-engine-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.bf-action-engine-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.bf-action-engine-card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.bf-action-engine-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  margin-top: 12px;
  transition: color 0.15s ease;
}
.bf-action-engine-card-arrow svg {
  width: 16px;
  height: 16px;
}
.bf-action-engine-card:hover .bf-action-engine-card-arrow {
  color: var(--accent-primary);
}
/* Single-column at every breakpoint — the host panel is too narrow for
   two cards to read cleanly side-by-side. */
.ledger-total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 22px 24px;
  margin-top: 20px;
  background: #fff;
  border: 1px solid #000000;
  position: relative;
  z-index: 6;
}
.ledger-total span:first-child {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ledger-total span:last-child {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

/* --- Offer card (kit capture below the ledger) - hidden until flow is live --- */
.offer-card {
  display: none;
}
.offer-card-visible {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 24px;
}
.offer-card h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.offer-card h4 svg {
  color: var(--accent-primary);
  width: 18px;
  height: 18px;
}
.offer-card p {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.offer-kit-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.offer-kit-list li {
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 500;
  padding-left: 18px;
  position: relative;
  line-height: 1.4;
}
.offer-kit-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--success, #10b981);
  font-weight: 700;
}
.offer-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.email-input-wrap {
  position: relative;
}
.email-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 16px;
  height: 16px;
}
.email-input-wrap input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 16px 0 40px;
  font-size: 0.9rem;
  height: 44px;
  outline: none;
  transition: var(--transition-base);
  font-family: var(--font-sans);
  color: var(--text-main);
}
.email-input-wrap input:focus {
  border-color: var(--text-main);
  box-shadow: 0 0 0 1px var(--text-main);
}
.btn-offer-primary {
  background: var(--accent-primary);
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  height: 44px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  width: 100%;
}
.btn-offer-primary:hover {
  background: var(--accent-hover);
}
.trust-micro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 12px;
  font-weight: 500;
}

/* Results grid: 2 columns on wide panels, 1 column when tight */
.results-grid {
  display: flex;
  flex-direction: column;
  padding: 0 24px;
  margin-bottom: 24px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-inset);
  min-width: 0;
  overflow: hidden;
}
.result-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-label {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-light);
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-value {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
}
.total-cost-item .result-value {
  font-size: 2.2rem;
  color: var(--accent-primary);
}

/* Emphasize the total cost row */
.total-cost-item {
  grid-column: 1 / -1;
  background: var(--bg-subtle);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  border-bottom: none;
  margin-top: 8px;
}
.total-cost-item .result-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Calculator note/disclaimer */
.calculator-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 16px 24px;
  margin: 0;
  border-top: 1px solid var(--border-light);
}
.calculator-note strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Disclaimer section (building permit, etc.) */
.disclaimer-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.disclaimer-section h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}
.disclaimer-section p {
  margin-bottom: 8px;
}
.disclaimer-section p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   SLC-SPECIFIC STYLES (from slc-calc.html demo)
   ========================================================================== */

/* --- Inline input wrapper (input + select in one bordered box) --- */
.bf-inline-input {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-base);
  background: var(--bg-base);
  height: 52px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
  width: 100%;
}
.bf-inline-input:focus-within {
  border-color: var(--text-main);
  box-shadow:
    0 0 0 1px var(--text-main),
    var(--shadow-subtle);
}
/* Override catch-all .bf-panel-config rules inside inline wrappers */
.bf-inline-input input,
.bf-inline-input input[type='number'],
.bf-panel-config .bf-inline-input input,
.bf-panel-config .bf-inline-input input[type='number'] {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  padding: 0 16px;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  outline: none;
  background: transparent;
  color: var(--text-main);
  caret-color: var(--accent-primary);
  height: 100%;
  box-shadow: none;
}
.bf-inline-input input:focus,
.bf-panel-config .bf-inline-input input:focus {
  border: none;
  box-shadow: none;
  background: transparent;
}
.bf-inline-input input::placeholder {
  color: var(--text-light);
}
.bf-inline-input select,
.bf-panel-config .bf-inline-input select {
  width: auto;
  height: 100%;
  border: none;
  border-left: 1px solid var(--border-light);
  border-radius: 0;
  background-color: var(--bg-subtle);
  padding: 0 32px 0 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  outline: none;
  cursor: pointer;
  transition: var(--transition-base);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  min-width: 70px;
  box-shadow: none;
}
.bf-inline-input select:hover {
  color: var(--text-main);
  background-color: var(--bg-inset);
}
.bf-inline-input span {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-left: 1px solid var(--border-light);
  font-size: 0.95rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  white-space: nowrap;
}

/* --- Segmented control (tab switcher) --- */
.bf-tabs {
  display: flex;
  background: var(--bg-inset);
  padding: 4px;
  border-radius: var(--radius-lg);
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  scrollbar-width: none;
}
.bf-tabs::-webkit-scrollbar {
  display: none;
}
.bf-tab {
  flex: 1 0 auto;
  min-height: 40px;
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  font-family: var(--font-sans);
  text-align: center;
  white-space: nowrap;
}
.bf-tab:hover:not(.active) {
  color: var(--text-main);
}
.bf-tab.active {
  background: var(--bg-base);
  color: var(--text-main);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.08),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Thickness presets + input side-by-side wrapper */
.thickness-flex {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.bf-thickness-presets {
  display: flex;
  background: var(--bg-inset);
  padding: 4px;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  flex: 1.5;
}
.thickness-flex > .bf-inline-input {
  flex: 1;
}
/* .thickness-preset is a JS selector hook; styling via .bf-thickness-btn */
.thickness-preset,
.bf-thickness-btn {
  flex: 1 0 auto;
  min-height: 40px;
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  font-family: var(--font-sans);
  text-align: center;
  white-space: nowrap;
}
.bf-thickness-btn:hover:not(.active) {
  color: var(--text-main);
}
.bf-thickness-btn.active {
  background: var(--bg-base);
  color: var(--text-main);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.08),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Slider */
.bf-slider-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.bf-slider-group input[type='range'] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-light);
  outline: none;
  appearance: none;
  cursor: pointer;
}
.bf-slider-group input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(224, 93, 54, 0.3);
}

/* --- Range slider --- */
.bf-panel-config input[type='range'] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  padding: 16px 0;
  margin-top: 4px;
}
.bf-panel-config input[type='range']:focus {
  outline: none;
}
.bf-panel-config input[type='range']::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: var(--bg-inset);
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.bf-panel-config input[type='range']::-webkit-slider-thumb {
  height: 28px;
  width: 28px;
  border-radius: 50%;
  background: var(--text-main);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -12px;
  box-shadow:
    0 0 0 4px var(--bg-base),
    0 0 0 5px var(--border-light);
  transition: var(--transition-base);
}
.bf-panel-config input[type='range']:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 4px var(--bg-base),
    0 0 0 6px var(--accent-primary);
}

/* Toggle */
.bf-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 16px;
  cursor: pointer;
  transition: var(--transition-base);
  min-height: 72px;
  gap: 12px;
}
.bf-toggle-row:hover {
  border-color: var(--text-light);
  background: var(--bg-subtle);
}
.bf-toggle-row .toggle-info h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}
.bf-toggle-row .toggle-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.custom-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--text-light);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  position: relative;
  background: var(--bg-base);
  transition: var(--transition-base);
  flex-shrink: 0;
}
.bf-toggle-row:focus-within .custom-checkbox {
  box-shadow:
    0 0 0 2px var(--bg-base),
    0 0 0 4px var(--text-light);
}
.custom-checkbox:checked {
  background: var(--text-main);
  border-color: var(--text-main);
}
.custom-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.bf-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.bf-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.bf-toggle.active {
  background: var(--accent-primary);
}
.bf-toggle.active::after {
  transform: translateX(20px);
}

/* Product grid */
.bf-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.bf-product-card {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-base);
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  min-height: 84px;
  justify-content: center;
}
.bf-product-card > * {
  pointer-events: none;
}
.bf-product-card:hover {
  border-color: var(--text-light);
  background: var(--bg-subtle);
}
.bf-product-card.active {
  border-color: var(--text-main);
  box-shadow: 0 0 0 1px var(--text-main);
  background: var(--bg-base);
}
.bf-product-card h4 {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}
.bf-product-card p,
.bf-product-card .bf-product-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.bf-product-icon {
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.bf-product-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}
.bf-product-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Data grid (SLC results) */
.bf-data-grid {
  display: flex;
  flex-direction: column;
  padding: 0 24px;
  margin-bottom: 24px;
}
.bf-data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-inset);
}
.bf-data-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.bf-data-label {
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.bf-data-value {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.bf-data-subtext {
  display: none;
}
.bf-data-highlight {
  background: none;
  padding: 0;
  border-radius: 0;
  border: none;
}
.bf-data-highlight .bf-data-label {
  color: var(--text-muted);
}
.bf-data-highlight .bf-data-value {
  font-size: 0.9rem;
}

/* ==========================================================================
   INFO SECTION (Insulation calculator guide cards)
   ========================================================================== */
.bf-info-section {
  margin-bottom: 48px;
}
.bf-info-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  color: var(--text-main);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.info-card {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
}
.info-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}
.info-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   MATERIAL LINKS (Fence hub → sub-page links)
   ========================================================================== */
.bf-material-links {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.bf-material-links h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-main);
}
.bf-material-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bf-material-links li {
  margin-bottom: 8px;
}
.bf-material-links a {
  font-size: 0.9rem;
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}
.bf-material-links a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ==========================================================================
   RELATED RESOURCES (Bottom section)
   ========================================================================== */
.resources-section {
  padding: 80px 0 0;
  max-width: var(--container-max);
  margin: 0 auto;
}
.resources-header {
  text-align: center;
  margin-bottom: 40px;
}
.resources-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.related-resources-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .related-resources-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .related-resources-list {
    grid-template-columns: 1fr;
  }
}
.related-item a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
}
.related-item a:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}
.resource-tag {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  margin-bottom: 16px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 4px;
}
.related-item h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.4;
}
.related-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  flex-grow: 1;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.mt-input {
  margin-top: 1.25rem;
}
.optional-label {
  font-weight: normal;
  font-size: 0.85em;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@keyframes bf-results-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   SEO ARCHITECTURE ZONE - Article teaser + Silo widget below calculator
   ========================================================================== */
.seo-architecture-zone {
  padding: 0 0 80px;
  margin-top: 64px;
  border-top: 1px solid var(--border-light);
  overflow: hidden;
}

.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 80px;
  margin-top: 64px;
  align-items: start;
}

/* --- Article Teaser --- */
.seo-article-wrapper {
  position: relative;
  /* More room so the second intro paragraph reads cleanly above the fade. */
  max-height: 380px;
  overflow: hidden;
  min-width: 0;
}

/* Whole snippet is one link — the outer anchor wraps article + fade
   overlay so a click anywhere navigates. Reset anchor color/decoration
   so the inherited typography stays put; only show the affordance on
   hover/focus.

   NOTE: do NOT add position: relative here. The .seo-fade-overlay needs
   to anchor to .seo-article-wrapper (the 380px clipped container), not
   to the link (which spans the full article height). With overflow:
   hidden on the wrapper, anchoring to the link would push the button
   below the visible cut-off and the affordance disappears. */
.seo-article-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.seo-article-link:hover .seo-article h2,
.seo-article-link:focus-visible .seo-article h2 {
  color: var(--accent-primary);
}
.seo-article-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
  border-radius: 6px;
}
.seo-article-link:hover .btn-outline,
.seo-article-link:focus-visible .btn-outline {
  background: var(--accent-primary);
  color: #fff;
}

.silo-sidebar {
  min-width: 0;
}

.seo-fade-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--bg-base));
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding-bottom: 20px;
}

.seo-fade-overlay .btn-outline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
  border: 1.5px solid var(--accent-primary);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition:
    background var(--transition-base),
    color var(--transition-base);
  background: var(--bg-base);
}

.seo-fade-overlay .btn-outline:hover {
  background: var(--accent-primary);
  color: #fff;
}

.seo-article h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.seo-article p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 20px;
}

/* --- Silo Widget --- */
.silo-widget {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 0 16px;
  box-shadow:
    0 4px 24px -6px rgba(15, 23, 42, 0.04),
    0 1px 3px rgba(15, 23, 42, 0.02);
}

.silo-header {
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}
.silo-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.silo-header p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.4;
}
.silo-group-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 8px 24px 4px;
  display: block;
}
.silo-group-label:first-of-type {
  margin-top: 0;
}
.silo-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}
.silo-list:last-child {
  margin-bottom: 8px;
}

.silo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 8px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border: 1px solid transparent;
}
.silo-item:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-light);
}
.silo-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.silo-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.silo-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.silo-tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.silo-tag-template {
  background: var(--bg-inset);
  color: var(--text-muted);
}
.silo-arrow {
  flex-shrink: 0;
  color: var(--text-light);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.silo-item:hover .silo-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--text-main);
}
.silo-arrow svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.silo-item:hover .silo-arrow {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 992px) {
  .bf-panel-dashboard {
    position: static;
    /* Remove the desktop max-height so content isn't clipped on short mobile screens */
    max-height: none;
    overflow-y: visible;
    animation: bf-results-reveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    scroll-margin-top: 88px;
  }
  .bf-panel-config .input-group {
    scroll-margin-top: 88px;
  }
  /* Hide results panel entirely on mobile until Calculate is clicked */
  .bf-panel-dashboard.bf-needs-calc {
    display: none;
  }
  /* Remove the desktop ::after overlay hint on mobile (panel is hidden instead) */
  .bf-panel-dashboard.bf-needs-calc::after {
    display: none;
  }
  .bf-data-grid {
    padding: 0 16px;
  }
  .bf-product-grid {
    grid-template-columns: 1fr;
  }
  /* Sticky Calculate button so it's always reachable */
  .calculator-buttons {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: var(--bg-base);
    padding: 16px 20px;
    margin: 32px -20px 0;
    border-top: 2px solid var(--border-light);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.1);
  }
  /* SEO Architecture Zone - stack on mobile */
  .editorial-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    margin-top: 48px;
  }
  .seo-architecture-zone {
    padding: 0 0 64px;
  }
  .seo-article-wrapper {
    position: relative;
    top: 0;
    max-height: 240px;
  }
}

@media (max-width: 768px) {
  .calculator-page {
    padding: 32px 0 64px;
  }
  .bf-calc-header {
    margin-bottom: 32px;
  }
  .bf-calc-header p {
    font-size: 0.95rem;
  }
  .bf-panel-config {
    padding: 0;
  }
  .bf-panel-dashboard {
    padding: 0;
  }
}

@media (max-width: 640px) {
  .results-grid {
    padding: 0 16px;
  }
  .bf-calc-header h1 {
    font-size: 1.75rem;
  }
  .bf-panel-config {
    padding: 0;
  }
  .bf-panel-dashboard {
    padding: 0;
  }
  .calculator-buttons {
    flex-direction: column;
    gap: 10px;
    margin: 32px -16px 0;
    padding: 12px 16px;
  }
  .calculator-buttons .btn-primary {
    flex: unset;
    width: 100%;
    height: 60px;
    font-size: 1.15rem;
    order: 1;
  }
  .calculator-buttons .btn-lg:not(.btn-primary) {
    flex: unset;
    width: 100%;
    height: 44px;
    font-size: 0.9rem;
    order: 2;
  }
  /* Prevent iOS Safari auto-zoom on input focus */
  .input-field input,
  .input-group > input,
  .bf-select,
  .bf-inline-input input,
  .bf-inline-input select {
    min-height: 48px;
    font-size: 16px;
  }
  .bf-inline-input input {
    flex: 1;
    min-width: 0;
  }
  .calculator-buttons .btn {
    min-height: 52px;
    font-size: 1rem;
  }
  .result-value {
    font-size: 1.25rem;
  }
  .total-cost-item .result-value {
    font-size: 1.75rem;
  }
  .input-row {
    gap: 8px;
  }
  .input-field {
    flex: 1 1 100%;
  }
  .unit-select {
    width: 100%;
  }
  .bag-size-row,
  .sheet-size-row {
    flex-wrap: wrap;
  }
  .calculator-content {
    padding: 0;
  }
}

/* ==========================================================================
   ADDITIONAL RESULT STYLING
   ========================================================================== */

/* Change order subtotal/final emphasis */
.subtotal-item {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}
.final-price-item {
  background: var(--bg-subtle);
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-light);
  margin-top: 8px;
}
.final-price-item .result-label {
  color: var(--accent-primary);
}
.final-price-item .result-value {
  font-size: 2.75rem;
}

/* ==========================================================================
   DOCUMENT-STYLE RESULTS HEADER (SLC and future document-style calculators)
   Used by calculators that show a formal estimate document layout.
   ========================================================================== */

/* Header area - styled as ledger header bar */
.bf-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

/* Title + subtitle group */
.bf-doc-title-group h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

/* Icon next to the title */
.bf-doc-title-icon {
  flex-shrink: 0;
  color: var(--accent-primary);
  width: 18px;
  height: 18px;
}

/* Subtitle - hide it, demo doesn't have one */
.bf-doc-subtitle {
  display: none;
}

/* Date meta tag */
.bf-doc-meta {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-light);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* Dashboard content wrapper */
.bf-dashboard-content {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 0;
  box-shadow:
    0 10px 25px -5px rgba(15, 23, 42, 0.03),
    0 4px 10px -2px rgba(15, 23, 42, 0.02);
  padding: 0;
  overflow: hidden;
}

.bf-panel-config .input-group {
  scroll-margin-top: 120px;
}

/* Flash highlight after Calculate - briefly pulses the estimate card green */
@keyframes bf-calc-flash-anim {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35);
    border-color: rgba(16, 185, 129, 0.6);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.6);
  }
  100% {
    box-shadow:
      0 10px 25px -5px rgba(15, 23, 42, 0.03),
      0 4px 10px -2px rgba(15, 23, 42, 0.02);
    border-color: var(--border-light);
  }
}
.bf-dashboard-content.bf-calc-flash {
  animation: bf-calc-flash-anim 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   TOGGLE ROW LABELS (primer checkboxes, optional add-ons)
   Shared across any calculator that uses checkbox + label + hint pattern.
   ========================================================================== */
.bf-toggle-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.bf-toggle-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 1px;
}

/* Style the raw checkbox to look more intentional */
.bf-toggle-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

/* ==========================================================================
   COST BREAKDOWN SECTION
   ========================================================================== */
.bf-cost-section {
  margin: 0;
  padding: 0 24px 24px;
  background: none;
  border-radius: 0;
}
.bf-cost-section h3 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
}
.bf-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
}
.bf-cost-row:last-child {
  border-bottom: none;
}
.bf-cost-row-value {
  font-weight: 600;
  font-family: var(--font-display);
}
.bf-cost-total {
  font-weight: 700;
  border-top: 2px dashed var(--border-light);
  border-bottom: none;
  padding-top: 20px;
  margin-top: 4px;
  font-size: 1.1rem;
}
.bf-cost-total .bf-cost-row-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   ACTION BUTTONS (Share, Print)
   ========================================================================== */
.bf-dash-actions {
  display: flex;
  gap: 12px;
  margin: 0 24px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}
.bf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-primary);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  min-height: 48px;
  flex: 1;
  transition: all var(--transition-base);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 2px 4px rgba(224, 93, 54, 0.2);
}
.bf-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(224, 93, 54, 0.3);
}
.bf-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  min-height: 48px;
  flex: 1;
  transition: all var(--transition-base);
}
.bf-btn-secondary:hover {
  border-color: var(--text-main);
  background: var(--bg-subtle);
}

/* Copy feedback toast */
#copy-feedback {
  text-align: center;
  font-size: 0.8rem;
  color: #16a34a;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  body {
    padding-top: 0;
  }
  .site-header,
  .site-footer,
  .breadcrumb-container,
  .no-print,
  #bf-bridge-bar {
    display: none !important;
  }
  .bf-app-window {
    grid-template-columns: 1fr;
  }
  .bf-panel-config {
    display: none;
  }
  .bf-panel-dashboard {
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .calculator-page {
    padding: 0;
  }
}

/* SLC area badge */
.text-green-600 {
  color: #16a34a;
}
.text-xs {
  font-size: 0.75rem;
}
.font-bold {
  font-weight: 700;
}
.opacity-0 {
  opacity: 0;
}
.transition-opacity {
  transition: opacity 0.2s ease;
}

/* Calculator content wrapper (SLC) */
.calculator-content {
  padding: 0;
}

/* Input unit suffix ($ sign, %, etc.)
   Positioned absolutely inside the input field, vertically centered.
   The parent input-group gets position:relative so the suffix aligns
   to the input's bottom edge, not the label above it. */
.input-unit {
  position: absolute;
  right: 12px;
  bottom: 12px; /* align to input's vertical center from bottom */
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  line-height: 1;
}

/* Make parent relative for absolute positioning of .input-unit */
.input-group {
  position: relative;
}
.input-field {
  position: relative;
}

/* Add right padding to inputs that have a unit suffix so text doesn't overlap */
.input-group:has(.input-unit) input,
.input-field:has(.input-unit) input,
.bf-panel-config div:has(> input + .input-unit) input {
  padding-right: 32px;
}

/* ─── CRO Components ─── */

/* Social Proof Strip - hidden to match demo treatment */
.bf-social-proof {
  display: none;
}
.bf-social-dot {
  margin: 0 0.4rem;
  color: var(--text-tertiary, #9ca3af);
}

/* Template Cross-Sell */
.bf-template-xsell {
  max-width: var(--container-max);
  margin: 2rem auto 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 8px;
  transition: border-color 0.15s;
}
.bf-template-xsell:hover {
  border-color: var(--accent-primary, #e05d36);
}
.bf-template-xsell-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
  color: var(--accent-primary, #e05d36);
}
.bf-template-xsell-icon svg {
  width: 20px;
  height: 20px;
}
.bf-template-xsell-text {
  flex: 1;
  min-width: 0;
}
.bf-template-xsell-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.bf-template-xsell-pitch {
  margin: 0.125rem 0 0;
  color: var(--text-muted, #6b7280);
  font-size: 0.8rem;
}
.bf-template-xsell-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0 1.25rem;
  background: var(--accent-primary, #e05d36);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.bf-template-xsell-btn:hover {
  opacity: 0.9;
}
@media (max-width: 640px) {
  .bf-template-xsell {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
  .bf-template-xsell-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Cross-Sell Workflow Prompts */
.bf-xsell-section {
  max-width: var(--container-max);
  margin: 3rem auto 0;
  padding: 2rem 0;
}
.bf-xsell-section h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}
.bf-xsell-section > p {
  margin: 0 0 1rem;
  color: var(--text-secondary, #6b7280);
}
.bf-xsell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.bf-xsell-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.bf-xsell-card:hover {
  border-color: var(--accent-primary, #e05d36);
}
.bf-xsell-title {
  font-weight: 600;
}
.bf-xsell-desc {
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
}

/* One-Click Bar */
#bf-oneclick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 8px;
  font-size: 0.9rem;
}
.bf-oneclick-label {
  color: var(--text-secondary, #6b7280);
}
.bf-oneclick-btn {
  padding: 0 1rem;
  background: var(--accent-primary, #e05d36);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  min-height: 48px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.bf-oneclick-btn:hover {
  opacity: 0.9;
}
.bf-oneclick-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Calculator Abandonment Pulse */
.bf-calc-pulse {
  animation: bf-pulse 1.5s ease-in-out infinite;
}
@keyframes bf-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 93, 54, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 8px rgba(224, 93, 54, 0);
  }
}

@media (max-width: 640px) {
  .bf-social-proof {
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 24px;
  }
  .bf-xsell-grid {
    grid-template-columns: 1fr;
  }
  #bf-oneclick-bar {
    flex-direction: column;
    text-align: center;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Required-field validation
   ───────────────────────────────────────────────────────────────────────── */
.bf-panel-config .bf-input-error,
.bf-panel-config .bf-input-error.bf-select {
  border: 2px solid var(--color-terracotta, #c14b2c) !important;
  box-shadow: 0 0 0 4px rgba(193, 75, 44, 0.2) !important;
  background: rgba(193, 75, 44, 0.04);
  animation: bf-shake 0.45s ease;
}
.bf-error-msg {
  display: block;
  color: var(--color-terracotta, #c14b2c);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.375rem;
  line-height: 1.3;
}
.bf-error-banner {
  display: block;
  background: var(--color-terracotta, #c14b2c);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(193, 75, 44, 0.25);
  /* Ensure sticky header doesn't overlap the banner when scrolled into view */
  scroll-margin-top: 100px;
}
@keyframes bf-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bf-panel-config .bf-input-error {
    animation: none;
  }
}

/* Calculator banner styles moved to components.css so permit pages can reuse. */

/* ==========================================================================
   INLINE EMAIL GATE - Quantity/breakdown rows gated behind email capture.
   Blurs the rows, overlays a single-field email form. Grand total stays
   visible. Returning visitors see unblurred values plus a subtle
   "email a copy" bar below the total.
   ========================================================================== */

/* Blurred rows (gated values) - heavy blur so digits aren't legible */
.bf-gate-blur {
  filter: blur(10px);
  user-select: none;
  pointer-events: none;
  transition:
    filter 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.45s ease;
  opacity: 0.55;
}

/* Reveal animation when unlocked */
@keyframes bf-gate-reveal {
  from {
    filter: blur(10px);
    opacity: 0.55;
  }
  to {
    filter: blur(0);
    opacity: 1;
  }
}
.bf-gate-reveal {
  animation: bf-gate-reveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Inline gate card - sits at the top of the ledger-list as a normal block.
   No overlay, no absolute positioning. Blurred rows sit below it. */
@keyframes bf-gate-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bf-gate-card {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 18px 20px 16px;
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  animation: bf-gate-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.bf-gate-headline {
  font-family: var(--font-display, var(--font-sans));
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.bf-gate-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 14px;
}

.bf-gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bf-gate-form--with-zip {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
}
.bf-gate-form--with-zip .bf-gate-btn {
  grid-column: 1 / -1;
}
@media (max-width: 520px) {
  .bf-gate-form--with-zip {
    grid-template-columns: 1fr;
  }
}
.bf-gate-input-zip {
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.bf-gate-regional-note {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.bf-gate-regional-note strong {
  color: var(--text-main);
  font-weight: 600;
}
.bf-gate-card-with-zip {
  /* Zip-enabled gate is taller; loosen vertical rhythm. */
  padding-bottom: 16px;
}

.bf-gate-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.bf-gate-input::placeholder {
  color: var(--text-light);
}
.bf-gate-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(224, 93, 54, 0.12);
}

.bf-gate-btn {
  position: relative;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
  overflow: hidden;
}
.bf-gate-btn:hover {
  background: #c94e2a;
}
.bf-gate-btn:active {
  transform: translateY(1px);
}

.bf-gate-btn-text {
  transition: opacity 0.15s ease;
}

.bf-gate-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: bf-gate-spin 0.8s linear infinite;
}
.bf-gate-btn.is-loading {
  pointer-events: none;
  background: #c94e2a;
}
.bf-gate-btn.is-loading .bf-gate-btn-text {
  opacity: 0;
}
.bf-gate-btn.is-loading .bf-gate-spinner {
  opacity: 1;
}
@keyframes bf-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

.bf-gate-err {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #dc2626;
}

/* Card transforms into success state after email submit */
.bf-gate-card.bf-gate-card-sent {
  background: #ecfdf5;
  border-color: #a7f3d0;
  padding: 14px 20px;
  box-shadow: none;
  animation: none;
}
.bf-gate-sent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #059669;
  letter-spacing: 0.01em;
}
.bf-gate-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #059669;
  color: #fff;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ── Returning visitor bar ────────────────────────────────────────────────── */

#bf-returning-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  animation: bf-gate-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bf-returning-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
.bf-returning-text strong {
  color: var(--text-main);
  font-weight: 600;
}

.bf-returning-btn {
  position: relative;
  flex-shrink: 0;
  padding: 8px 18px;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--accent-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
  overflow: hidden;
  min-width: 72px;
}
.bf-returning-btn:hover {
  background: var(--accent-primary);
  color: #fff;
}
.bf-returning-btn-text {
  transition: opacity 0.15s ease;
}
.bf-returning-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(224, 93, 54, 0.3);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  opacity: 0;
  animation: bf-gate-spin 0.8s linear infinite;
}
.bf-returning-btn.is-loading .bf-returning-btn-text {
  opacity: 0;
}
.bf-returning-btn.is-loading .bf-returning-spinner {
  opacity: 1;
}
#bf-returning-bar.bf-returning-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
  justify-content: center;
}
#bf-returning-bar.bf-returning-success .bf-returning-text {
  color: #059669;
  font-weight: 600;
  text-align: center;
}

/* ── Soft email bar (new visitor, ungated calcs) ──────────────────────────
   Mirrors the returning-bar's slim chrome but with an <input> instead of
   a fixed masked email. Prompt stacks above the input + button so the
   copy never competes with the field for horizontal space. Same
   .bf-returning-btn styling so the affordance is visually consistent
   across the two states. */
#bf-inline-email-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  animation: bf-gate-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#bf-inline-email-bar .bf-returning-text {
  flex: none;
}
.bf-inline-email-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bf-inline-email-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.bf-inline-email-form .bf-returning-btn {
  flex-shrink: 0;
}
.bf-inline-email-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(224, 93, 54, 0.12);
}
.bf-inline-email-input.is-invalid {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}
.bf-inline-email-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#bf-inline-email-bar.bf-returning-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
  justify-content: center;
}
#bf-inline-email-bar.bf-returning-success .bf-returning-text {
  color: #059669;
  font-weight: 600;
  text-align: center;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .bf-gate-card {
    max-width: 100%;
    padding: 18px 16px 16px;
  }
  .bf-gate-headline {
    font-size: 1rem;
  }
  .bf-gate-sub {
    font-size: 0.82rem;
  }
  .bf-gate-input {
    height: 48px;
    font-size: 16px;
  }
  .bf-gate-btn {
    height: 48px;
  }
  #bf-returning-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .bf-returning-text {
    text-align: center;
  }
  .bf-returning-btn {
    width: 100%;
  }
  #bf-inline-email-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .bf-inline-email-form {
    width: 100%;
    gap: 8px;
  }
  .bf-inline-email-input {
    flex: 1;
    width: auto;
    height: 44px;
    font-size: 16px;
  }
  .bf-inline-email-form .bf-returning-btn {
    width: auto;
    flex-shrink: 0;
    height: 44px;
  }
}

/* ── Post-calc article + related-links sections ────────────────────────────
   These sit AFTER .bf-app-window inside the page container so they inherit
   the container's full width and align flush with the calc card above.
   Inner paragraphs/lists get capped at a comfortable reading width via
   max-inline-size while headings span the full column for hierarchy. */
.calc-content {
  margin-top: 48px;
}
.calc-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}
.calc-content h2:not(:first-child) {
  margin-top: 28px;
}
.calc-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-main);
}
.calc-content p,
.calc-content ul {
  max-width: 72ch;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}
.calc-content ul {
  padding-left: 1.4em;
}
.calc-content li {
  margin-bottom: 4px;
}

.calc-related {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md, 8px);
}
.calc-related h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary, #1a202c);
}
.calc-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.calc-related a {
  display: inline-block;
  padding: 6px 12px;
  background: var(--color-white, #fff);
  border: 1px solid var(--neutral-300, #cbd5e1);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--color-primary, #0d9488);
  text-decoration: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.calc-related a:hover {
  border-color: var(--color-primary, #0d9488);
  background: var(--teal-50, #f0fdfa);
}

/* (Related Calculators Rail removed — superseded by SEO Architecture Zone /
   silo widget which already shows related resources. Kept this comment as
   a breadcrumb for the next maintainer.) */

/* ── Calculator-to-Trial CTA (post-result handoff) ─────────────────── */
/* Quiet, sharp invitation rather than a SaaS-style conversion block.
   Sits below the ledger total inside .bf-panel-dashboard which has a
   max-height + overflow-y; this card is intentionally short so the full
   panel fits within calc(100vh - 104px) on typical viewports. */
/* .bf-trial-cta (top trial CTA) moved to components.css — it is injected on
   calculators AND permit pages, so its styles must load site-wide (permit pages
   do not load this calculator-only stylesheet). */

/* Pricing modal — multi-step: chooser → form → success. */
.bf-action-modal[hidden] {
  display: none;
}
.bf-action-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
@media (max-width: 480px) {
  .bf-action-modal {
    padding: 12px;
    align-items: flex-start;
  }
}
.bf-action-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.bf-action-modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  /* dvh accounts for mobile browser chrome (iOS Safari URL bar) so the
     card never extends past the visible viewport on phones. */
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 28px 28px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
}
@media (max-width: 480px) {
  .bf-action-modal-card {
    max-height: calc(100dvh - 24px);
  }
}
.bf-action-modal-step[hidden] {
  display: none !important;
}
.bf-action-modal-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.bf-action-modal-back:hover {
  color: var(--text-main);
  background: var(--bg-base);
}
.bf-action-modal-back svg {
  width: 14px;
  height: 14px;
}

/* Chooser cards inside the modal */
.bf-action-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.bf-action-choice {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr 16px;
  align-items: start;
  gap: 14px;
  padding: 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}
.bf-action-choice:hover,
.bf-action-choice:focus-visible {
  outline: none;
  border-color: var(--accent-primary);
  background: #fff;
  transform: translateY(-1px);
}
.bf-action-choice.is-recommended {
  border-color: var(--accent-primary);
  background: #fff;
  box-shadow: 0 4px 14px rgba(224, 93, 54, 0.08);
}
.bf-action-choice-badge {
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 3px 10px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 999px;
}
.bf-action-choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(224, 93, 54, 0.08);
  color: var(--accent-primary);
}
.bf-action-choice-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.bf-action-choice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.bf-action-choice-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.bf-action-choice-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 2px;
}
.bf-action-choice-meta {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: 0;
}
.bf-action-choice-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-top: 12px;
}
.bf-action-choice-arrow svg {
  width: 16px;
  height: 16px;
}

/* Form step */
.bf-action-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.bf-action-modal-field[hidden] {
  display: none;
}
.bf-action-modal-field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0;
}
.bf-action-modal-field-optional {
  font-weight: 400;
  color: var(--text-light);
}
.bf-action-modal-input.is-invalid {
  border-color: #b91c1c;
}
.bf-action-modal-btn-full {
  width: 100%;
  margin-top: 4px;
}

/* Success step */
.bf-action-modal-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: rgba(21, 128, 61, 0.1);
  color: #15803d;
}
.bf-action-modal-success-icon svg {
  width: 24px;
  height: 24px;
}
.bf-action-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
}
.bf-action-modal-close:hover {
  background: var(--bg-base);
  color: var(--text-main);
}
.bf-action-modal-close svg {
  width: 18px;
  height: 18px;
}
.bf-action-modal-eyebrow {
  margin: 0 0 6px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: var(--accent-primary) !important;
  letter-spacing: 0;
}

/* ──────────────────────────────────────────────────────────────────────
   SLC Action Engine modal — same polish bar as the PA modal: wider
   card, editorial header, two clean chooser cards. Scoped under
   .bf-slc-modal so the default action-modal sizing keeps working for
   any other page that uses the base modal at narrower widths.
   ────────────────────────────────────────────────────────────────── */
.bf-slc-modal .bf-action-modal-card {
  max-width: 720px;
  padding: 36px 40px 28px;
}
@media (max-width: 768px) {
  .bf-slc-modal .bf-action-modal-card {
    padding: 24px 22px 20px;
  }
}
.bf-slc-header {
  margin: 0 0 22px;
}
.bf-slc-modal .bf-action-modal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px !important;
  padding: 0;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
}
.bf-slc-eyebrow-label {
  color: var(--text-muted);
}
.bf-slc-eyebrow-time {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--text-main);
  color: #fff;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
}
.bf-slc-modal .bf-action-modal-title {
  margin: 0 0 10px;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.bf-slc-modal .bf-action-modal-sub {
  margin: 0 !important;
  font-size: 1rem !important;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .bf-slc-modal .bf-action-modal-title {
    font-size: 1.35rem;
  }
  .bf-slc-modal .bf-action-modal-sub {
    font-size: 0.95rem !important;
  }
}

/* Chooser cards — no icon column (the icon felt decorative). Each
   card leads with a small uppercase eyebrow ("Source materials" /
   "Build a bid") so the eye registers the category before the title.
   Right-side arrow nudges on hover. */
.bf-slc-modal .bf-action-choice-list {
  margin-top: 20px;
  gap: 12px;
}
.bf-slc-modal .bf-action-choice {
  grid-template-columns: 1fr 18px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.bf-slc-modal .bf-action-choice:hover,
.bf-slc-modal .bf-action-choice:focus-visible {
  border-color: var(--text-main);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: none;
}
.bf-slc-modal .bf-action-choice-eyebrow {
  display: block;
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bf-slc-modal .bf-action-choice-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.bf-slc-modal .bf-action-choice-sub {
  margin-top: 4px;
  font-size: 0.9rem;
}
.bf-slc-modal .bf-action-choice-arrow {
  margin-top: 6px;
  color: var(--text-main);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.bf-slc-modal .bf-action-choice:hover .bf-action-choice-arrow {
  transform: translateX(3px);
}
.bf-action-modal-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.bf-action-modal-sub {
  margin: 0 0 18px !important;
  font-size: 0.95rem !important;
  color: var(--text-muted) !important;
  line-height: 1.55;
}
.bf-action-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.bf-action-modal-input {
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  outline: none;
  min-width: 0;
  transition: border-color 0.16s ease;
}
.bf-action-modal-input:focus {
  border-color: var(--accent-primary);
}
.bf-action-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.16s ease,
    transform 0.16s ease,
    opacity 0.16s ease;
}
.bf-action-modal-btn:hover:not(:disabled) {
  background: #c24a26;
  transform: translateY(-1px);
}
.bf-action-modal-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.bf-action-modal-btn.is-loading .bf-action-modal-btn-text {
  opacity: 0.7;
}
.bf-action-modal-spinner {
  display: none;
}
.bf-action-modal-btn.is-loading .bf-action-modal-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bf-spin 0.7s linear infinite;
}
@keyframes bf-spin {
  to {
    transform: rotate(360deg);
  }
}
.bf-action-modal-err {
  margin: 10px 0 0 !important;
  font-size: 0.8rem !important;
  color: #b91c1c !important;
}
.bf-action-modal-success {
  margin: 6px 0 0;
}
.bf-action-modal-success-title {
  margin: 0 0 6px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
}
.bf-action-modal-success-body {
  margin: 0 !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  line-height: 1.55;
}
@media (max-width: 600px) {
  .bf-action-modal {
    padding: 0;
    align-items: flex-end;
  }
  .bf-action-modal-card {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: 22px 18px 18px;
  }
  .bf-action-modal-title {
    font-size: 1.2rem;
  }
  .bf-action-modal-sub {
    font-size: 0.9rem !important;
  }
  .bf-action-choice {
    grid-template-columns: 36px 1fr;
    padding: 12px 14px;
  }
  .bf-action-choice-arrow {
    display: none;
  }
  .bf-action-engine {
    padding: 16px;
  }
  .bf-action-engine-card {
    grid-template-columns: 36px 1fr;
    padding: 12px 14px;
  }
  .bf-action-engine-card-arrow {
    display: none;
  }
  .bf-action-modal-input {
    font-size: 1rem; /* prevents iOS zoom on focus */
  }
  .bf-action-modal-btn {
    min-height: 48px;
  }
}

/* Embed button + snippet modal */
.bf-embed-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1.25rem 0;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: #fff;
  color: var(--accent-primary, #104a46);
  border: 1px solid var(--accent-primary, #104a46);
  border-radius: 8px;
  cursor: pointer;
}
.bf-embed-btn:hover {
  background: var(--accent-subtle, #f0f5f4);
}
.bf-embed-modal[hidden] {
  display: none;
}
.bf-embed-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}
.bf-embed-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}
.bf-embed-modal-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: min(560px, 92vw);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.bf-embed-modal-x {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.bf-embed-snippet {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  resize: vertical;
}
.bf-embed-copy {
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  font-weight: 600;
  background: var(--accent-primary, #104a46);
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.bf-embed-poweredby {
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  padding: 0.75rem 0;
}

/* ── Report CTA (demolition → appraiser/insurance offer) ──────────────── */
.bf-report-cta {
  margin: 16px 0 0;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  animation: bf-gate-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.bf-report-cta-headline {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.bf-report-cta-sub {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.bf-report-cta-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.bf-report-cta-btn:hover {
  background: var(--accent-subtle, #c74e2b);
}
.bf-report-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bf-report-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.bf-report-field input,
.bf-report-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.bf-report-field input:focus,
.bf-report-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(224, 93, 54, 0.12);
}
.bf-report-field textarea {
  resize: vertical;
  min-height: 60px;
}
.bf-report-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 4px;
}
.bf-report-submit-btn:hover {
  background: var(--accent-subtle, #c74e2b);
}
.bf-report-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.bf-report-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bf-spin 0.6s linear infinite;
}
.bf-report-submit-btn.is-loading .bf-report-submit-text {
  display: none;
}
.bf-report-submit-btn.is-loading .bf-report-spinner {
  display: inline-block;
}
.bf-report-fine {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.bf-report-success {
  text-align: center;
  padding: 8px 0;
}
.bf-report-success p {
  margin: 0;
  color: #059669;
  font-weight: 600;
  font-size: 0.9rem;
}
@keyframes bf-spin {
  to {
    transform: rotate(360deg);
  }
}
.bf-report-form[hidden] {
  display: none;
}
.bf-report-cta-prompt[hidden] {
  display: none;
}
.bf-report-success[hidden] {
  display: none;
}
