/* ==========================================================================
   Roof Replacement Cost Calculator - Production Stylesheet
   Modern, SEO-friendly, mobile-first, high contrast, clean typography.
   ========================================================================== */

:root {
  /* Brand & Neutral Palette */
  --color-primary: #0f2b48;
  --color-primary-dark: #0a1c30;
  --color-primary-light: #1e4570;
  --color-accent: #e07a1e;
  --color-accent-hover: #c66613;
  --color-accent-soft: #fff6ee;
  
  --color-success: #15803d;
  --color-success-soft: #ecfdf5;
  --color-warning: #b45309;
  --color-danger: #b91c1c;

  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-muted: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-text-main: #0f172a;
  --color-text-muted: #475569;
  --color-text-light: #64748b;
  --color-text-inverse: #ffffff;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  
  /* Shadows & Radii */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --container-max: 1200px;
  --header-height: 72px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-main);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Layout Utilities */
.site-wrapper {
  flex: 1 0 auto;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ==========================================================================
   Sticky Header & Navigation Mega-Menu
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease;
  height: var(--header-height);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand-logo span {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo:hover {
  text-decoration: none;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 220px;
  display: block;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.02);
}

.footer-brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 230px;
  display: block;
  object-fit: contain;
  margin-bottom: 0.85rem;
  transition: opacity 0.15s ease;
}

.footer-brand a:hover .footer-brand-logo-img {
  opacity: 0.9;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--color-primary);
  color: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: none;
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--color-accent);
  text-decoration: none;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.nav-item:hover .nav-chevron,
.nav-item:focus-within .nav-chevron {
  transform: rotate(180deg);
}

/* Mega Menu Dropdown */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 580px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1010;
}

.nav-item:hover .mega-menu,
.nav-item:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-border);
}

.mega-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mega-link {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
  transition: all 0.15s ease;
}

.mega-link:hover {
  background: var(--color-surface-muted);
  color: var(--color-accent);
  text-decoration: none;
  transform: translateX(3px);
}

.mega-link-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.mega-link-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-header-cta {
  background: #ff9800;
  color: #000000;
  padding: 0.5rem 1.15rem;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.25;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 3px 10px rgba(255, 152, 0, 0.28);
  transition: all 0.18s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-header-cta:hover {
  background: #f57c00;
  color: #000000;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(255, 152, 0, 0.42);
}

.btn-header-cta:active {
  transform: translateY(0);
}

.mobile-nav-toggle {
  display: none;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: var(--color-text-main);
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.mobile-nav-toggle:active {
  background: #e2e8f0;
}

html.mobile-nav-active,
body.mobile-nav-active {
  overflow: hidden !important;
  touch-action: none;
}

body.mobile-nav-active .mobile-floating-bar {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 860px) {
  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important;
    z-index: 10000 !important;
  }

  body.mobile-nav-active .site-header {
    z-index: 100000 !important;
  }

  .header-container {
    padding: 0 0.85rem;
    position: relative;
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 10px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    z-index: 100001;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .mobile-nav-toggle:active,
  .mobile-nav-toggle.is-active {
    background: #e2e8f0;
    border-color: #ff9800;
    color: #000000;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .header-actions .btn-header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.15;
    border-radius: 8px;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.25);
  }

  .nav-menu {
    position: fixed !important;
    top: var(--header-height, 72px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    width: 100vw !important;
    height: calc(100vh - var(--header-height, 72px)) !important;
    height: calc(100dvh - var(--header-height, 72px)) !important;
    max-height: calc(100dvh - var(--header-height, 72px)) !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0.75rem 1rem 4rem !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2) !important;
    display: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    z-index: 99999 !important;
  }

  .nav-menu.mobile-open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .nav-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.25rem 0;
  }

  .nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .nav-link:active,
  .nav-link:hover {
    background-color: #f8fafc;
    color: #ff9800;
  }

  .nav-chevron {
    transition: transform 0.2s ease;
  }

  .nav-item.active .nav-chevron {
    transform: rotate(180deg);
  }

  .mega-menu {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
    padding: 0.75rem !important;
    grid-template-columns: 1fr !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: none !important;
    background: #f8fafc !important;
    border-radius: 10px !important;
    margin: 0.25rem 0 0.65rem !important;
  }

  .nav-item.active .mega-menu {
    display: grid !important;
  }

  .mega-menu-list {
    gap: 0.45rem;
  }

  .mega-link {
    display: block !important;
    padding: 0.65rem 0.75rem !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    margin-bottom: 0.4rem !important;
    text-decoration: none !important;
  }

  .mega-link:active,
  .mega-link:hover {
    background: #fff8f0 !important;
    border-color: #ffb74d !important;
  }

  .mega-link-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }

  .mega-link-desc {
    font-size: 0.78rem !important;
    color: #64748b !important;
    margin-top: 0.15rem !important;
    line-height: 1.35 !important;
  }
}

@media (max-width: 540px) {
  .header-actions {
    gap: 0.4rem;
  }

  .header-actions .btn-header-cta {
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .brand-logo-img {
    max-width: 128px;
    height: auto;
  }

  .header-actions .btn-header-cta {
    font-size: 0.7rem;
    padding: 0.38rem 0.55rem;
  }

  .mobile-nav-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* ==========================================================================
   Breadcrumb Bar
   ========================================================================== */
.breadcrumb-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.65rem 0;
  font-size: 0.85rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
}

.breadcrumb-item a {
  color: var(--color-text-muted);
}

.breadcrumb-item a:hover {
  color: var(--color-accent);
}

.breadcrumb-separator {
  margin-left: 0.5rem;
  color: var(--color-border-strong);
}

.breadcrumb-current {
  color: var(--color-text-main);
  font-weight: 600;
}

/* ==========================================================================
   Hero & Tool Section (Above the Fold Focus)
   ========================================================================== */
.hero-tool-section {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  padding: 2.25rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
}

.hero-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(224, 122, 30, 0.2);
}

.hero-title {
  font-size: 2.35rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 720px;
  margin: 0 auto;
}

/* Tool Container Grid */
.calculator-card-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 0;
}

@media (max-width: 1024px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

/* Calculator Inputs Column */
.calculator-inputs-pane {
  padding: 2rem;
  border-right: 1px solid var(--color-border);
  background: #ffffff;
}

@media (max-width: 1024px) {
  .calculator-inputs-pane {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}

.input-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--color-border);
}

.input-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f2b48;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preset-chips-row {
  margin-bottom: 1.5rem;
}

.preset-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-btn {
  background: var(--color-surface-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chip-btn:hover {
  background: #e2e8f0;
  border-color: var(--color-border-strong);
  color: #0f2b48;
}

.chip-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  font-weight: 700;
}

/* Form Groups */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.15rem;
}

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-surface-muted);
  color: var(--color-text-light);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--color-border-strong);
  cursor: help;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
}

.tooltip-trigger:hover .tooltip-box,
.tooltip-trigger:focus .tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip-box {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 220px;
  max-width: calc(100vw - 3rem);
  background: #1e293b;
  color: #f8fafc;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 400;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 100;
  pointer-events: none;
  text-align: left;
}

.tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.input-with-addon {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1.05rem;
  font-family: inherit;
  color: #0f2b48;
  font-weight: 700;
  background: #ffffff;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  outline: none;
}

.form-select {
  font-weight: 600;
  font-size: 0.98rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #ffffff;
  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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px 16px;
  padding-left: 0.85rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-input:focus, .form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(224, 122, 30, 0.15);
}

.form-input.input-error {
  border-color: var(--color-danger);
  background: #fef2f2;
}

.input-addon {
  position: absolute;
  right: 0.85rem;
  font-size: 0.92rem;
  color: #64748b;
  font-weight: 600;
  pointer-events: none;
}

.form-helper {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 400;
  line-height: 1.35;
}

.form-error-msg {
  font-size: 0.78rem;
  color: var(--color-danger);
  font-weight: 600;
  display: none;
}

.form-error-msg.visible {
  display: block;
}

/* Slider Component */
.range-slider-wrap {
  margin-top: 0.35rem;
}

.range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  outline: none;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* Primary Action Bar */
.calculator-actions {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-calculate {
  flex: 1;
  background: var(--color-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(224, 122, 30, 0.2);
}

.btn-calculate:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(224, 122, 30, 0.25);
}

.btn-calculate:active {
  transform: translateY(0);
}

.btn-reset {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-reset:hover {
  background: var(--color-surface-muted);
  color: var(--color-text-main);
}

/* ==========================================================================
   Calculator Output & Live Preview Column
   ========================================================================== */
.calculator-results-pane {
  padding: 2rem;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Interactive SVG Diagram Preview */
.diagram-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.calculator-inputs-pane .diagram-card {
  margin-top: 1.5rem;
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.diagram-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.diagram-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background: #e2e8f0;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  color: #334155;
}

.diagram-live-badge,
.diagram-live-overlay {
  background: #0f2b48;
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(15, 43, 72, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.diagram-live-badge .overlay-divider,
.diagram-live-overlay .overlay-divider {
  opacity: 0.6;
}

.diagram-live-badge .overlay-price,
.diagram-live-overlay .overlay-price {
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.92rem;
}

.schematic-canvas-box {
  width: 100%;
  min-height: 220px;
  height: 220px;
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.schematic-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Results Summary Hero */
.results-summary-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.results-eyebrow {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.results-headline-range {
  font-size: clamp(1.95rem, 4vw, 2.35rem);
  font-weight: 800;
  color: #0f2b48;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.results-avg-highlight {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.4rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.results-avg-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: #475569;
}

.results-avg-val {
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  font-weight: 800;
  color: #b45309;
  letter-spacing: -0.015em;
}

.results-sqft-val {
  font-size: 1.05rem;
  color: #0f2b48;
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Range Cards: Low - Avg - High */
.range-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  .range-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.range-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.9rem 0.6rem;
  text-align: center;
}

.range-card.featured {
  background: #fffbeb;
  border-color: #fde68a;
  box-shadow: 0 2px 4px rgba(180, 83, 9, 0.08);
}

.range-card-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.3rem;
}

.range-card.featured .range-card-label {
  color: #92400e;
  font-weight: 700;
}

.range-card-price {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 800;
  color: #0f2b48;
  letter-spacing: -0.015em;
}

.range-card.featured .range-card-price {
  color: #92400e;
  font-size: clamp(1.35rem, 2.8vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Visual Breakdown Bar */
.breakdown-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f2b48;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.breakdown-bar {
  display: flex;
  height: 14px;
  width: 100%;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.85rem;
  background: var(--color-border);
}

.bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.bar-materials { background: #0f2b48; }
.bar-labor { background: #e07a1e; }
.bar-tearoff { background: #0284c7; }
.bar-disposal { background: #10b981; }
.bar-other { background: #8b5cf6; }

/* Itemized Cost Breakdown Rows */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--color-border);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-key {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #334155;
  font-weight: 500;
  font-size: 0.95rem;
}

.breakdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.breakdown-value {
  font-weight: 800;
  font-size: 1.1rem;
  color: #0f2b48;
  letter-spacing: -0.01em;
}

/* Action Strip & Pro Tip */
.results-secondary-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-action-outline {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-action-outline:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-text-muted);
}

.pro-tip-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: #166534;
  line-height: 1.4;
}

.pro-tip-icon {
  flex-shrink: 0;
  color: #15803d;
}

.contractor-cta-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cta-text-wrap h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.cta-text-wrap p {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.3;
}

.btn-cta-gold {
  background: var(--color-accent);
  color: #ffffff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-cta-gold:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
}

.calculator-disclaimer {
  font-size: 0.75rem;
  color: var(--color-text-light);
  line-height: 1.4;
  font-style: italic;
  text-align: center;
}

/* ==========================================================================
   Content Sections (SEO, Tables, Educational Guides)
   ========================================================================== */
.content-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--color-border);
}

.content-section:nth-child(even) {
  background: #ffffff;
}

.section-intro-block {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2.5rem;
  text-align: center;
}

.section-tag {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
  text-align: center;
}

.section-title,
h1.section-title,
h2.section-title {
  font-size: 1.95rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  text-align: center;
}

h3.subsection-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

p.section-lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.text-prose {
  color: var(--color-text-muted);
  line-height: 1.7;
}

.text-prose p {
  margin-bottom: 1.2rem;
}

.text-prose ul, .text-prose ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.text-prose li {
  margin-bottom: 0.4rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.data-table th {
  background: var(--color-surface-muted);
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 1.5px solid var(--color-border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-main);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(248, 250, 252, 0.7);
}

.badge-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Grid of Cards (Factors, Related Tools, Materials) */
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.cards-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.cards-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 1.75rem 0;
}

@media (max-width: 900px) {
  .cards-grid-3, .cards-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cards-grid-2, .cards-grid-3, .cards-grid-4 {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.feature-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.feature-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.feature-card-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.feature-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-top: 1rem;
}

.feature-card-link:hover {
  color: var(--color-accent-hover);
  text-decoration: none;
  gap: 0.5rem;
}

/* Spectrum Comparison Section */
.comparison-container {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

.spectrum-bar-wrap {
  position: relative;
  height: 12px;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 35%, #eab308 70%, #ef4444 100%);
  border-radius: var(--radius-full);
  margin: 2rem 0 3rem;
}

.spectrum-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.comparison-box {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.comparison-box-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}

.comparison-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Accordion FAQ Section
   ========================================================================== */
.faq-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 860px;
  margin: 2rem auto 0;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item.active {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.faq-question-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.35rem;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  cursor: pointer;
  font-family: inherit;
}

.faq-question-btn:hover {
  color: var(--color-accent);
}

.faq-icon-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--color-text-light);
}

.faq-item.active .faq-icon-arrow {
  transform: rotate(180deg);
  color: var(--color-accent);
}

.faq-answer-panel {
  display: none;
  padding: 0 1.35rem 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
  border-top: 1px solid transparent;
}

.faq-item.active .faq-answer-panel {
  display: block;
  border-top-color: var(--color-border);
  padding-top: 1rem;
}

/* ==========================================================================
   AdSense / Future Monetization Placement Areas
   Clear, compliant, non-intrusive container slots
   ========================================================================== */
.ad-slot-container {
  margin: 2.5rem 0;
  text-align: center;
}

.ad-slot-inner {
  display: inline-block;
  min-height: 90px;
  width: 100%;
  max-width: 728px;
  background: #f8fafc;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--color-text-light);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
}

/* ==========================================================================
   State Grid / Directory Layout
   ========================================================================== */
.state-search-bar {
  max-width: 480px;
  margin: 0 auto 2rem;
  display: flex;
  gap: 0.5rem;
}

.state-grid-50 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
}

.state-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.state-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  text-decoration: none;
}

.state-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-primary);
}

.state-card-cost {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

.state-card-cost strong {
  color: var(--color-accent);
}

.state-card-factor {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* ==========================================================================
   Trust / E-E-A-T Callout Box
   ========================================================================== */
.trust-banner {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .trust-banner {
    grid-template-columns: 1fr;
  }
}

.trust-badge-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-badge-icon svg {
  width: 32px;
  height: 32px;
}

.trust-details h4 {
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
}

.trust-details p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.trust-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.trust-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  background: var(--color-primary-dark);
  color: #cbd5e1;
  padding-top: 4rem;
  padding-bottom: 2rem;
  margin-top: auto;
  font-size: 0.9rem;
}

.cross-link-band {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-bottom: 3.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.cross-link-text h3 {
  color: #ffffff;
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.cross-link-text p {
  color: #94a3b8;
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 550px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand h4 {
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.footer-col h5 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: #64748b;
}

.footer-bottom a {
  color: #94a3b8;
}

/* ==========================================================================
   Print Stylesheet
   Formats clean, professional printable estimate sheet
   ========================================================================== */
@media print {
  /* Hide unnecessary web chrome */
  .site-header,
  .site-footer,
  .breadcrumb-bar,
  .preset-chips-row,
  .calculator-actions,
  .results-secondary-actions,
  .pro-tip-box,
  .contractor-cta-card,
  .ad-slot-container,
  .faq-accordion-group,
  .mobile-nav-toggle,
  .content-section:not(.print-summary-section) {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .calculator-card-wrapper {
    box-shadow: none !important;
    border: none !important;
  }

  .calculator-grid {
    grid-template-columns: 1fr !important;
  }

  .calculator-inputs-pane,
  .calculator-results-pane {
    padding: 0 !important;
    background: #ffffff !important;
    border: none !important;
  }

  .print-header-banner {
    display: block !important;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #000000;
  }

  .print-header-banner h1 {
    font-size: 18pt;
    margin-bottom: 0.25rem;
  }

  .results-summary-card {
    border: 1px solid #999999 !important;
    box-shadow: none !important;
  }

  .range-cards-grid {
    gap: 0.5rem;
  }

  .range-card {
    border: 1px solid #cccccc !important;
    background: #f9f9f9 !important;
  }

  .breakdown-bar {
    border: 1px solid #000000;
  }
}

.print-header-banner {
  display: none;
}

/* Article Figures & SEO Images */
.article-figure {
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.article-figure picture {
  display: block;
  width: 100%;
}

.article-figure img {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

.article-figure figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
  background: #fafbfc;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-figure figcaption svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-accent);
}

/* ==========================================================================
   Google Sheets Leads Hub & Lead Capture Styling
   ========================================================================== */

/* Header Lead Hub Button */
.btn-lead-hub {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f2b48;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-lead-hub:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-lead-hub .lead-hub-icon {
  color: #0f9d58;
}

.btn-lead-hub.connected {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.btn-lead-hub.connected .lead-hub-icon {
  color: #059669;
}

.lead-hub-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #0f2b48;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
}

.btn-lead-hub.connected .lead-hub-badge {
  background: #059669;
}

.footer-admin-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
}

.footer-admin-btn:hover {
  color: #34d399;
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.08);
}

/* ==========================================================================
   Screenshot 1: "Get Free Roofing Quote" Trigger Button & CTA
   ========================================================================== */
.calculator-quote-trigger-box {
  margin: 1.5rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px -2px rgba(15, 43, 72, 0.06);
}

.btn-get-free-quote-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ff9800; /* Vibrant solid orange from Screenshot 1 */
  color: #000000;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.3;
  padding: 0.95rem 2.25rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 14px rgba(255, 152, 0, 0.38);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 220px;
  text-decoration: none;
}

.btn-get-free-quote-cta:hover {
  background-color: #f57c00;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
  color: #000000;
}

.btn-get-free-quote-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

.quote-trigger-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.trigger-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.trigger-badge-item svg {
  color: #16a34a;
}

/* ==========================================================================
   Screenshot 2: "Request Free Roofing Estimates" Modal Popup
   ========================================================================== */
.quote-modal-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 19, 43, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.quote-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.quote-modal-container {
  background: #ffffff;
  width: 100%;
  max-width: 660px;
  max-height: 92vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.quote-modal-overlay.active .quote-modal-container {
  transform: scale(1) translateY(0);
}

/* Modal Dark Header matching Screenshot 2 */
.quote-modal-header {
  background-color: #0b1329; /* Exact deep dark navy from Screenshot 2 */
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quote-modal-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.quote-shield-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background-color: #ff9800; /* Vibrant orange badge */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quote-shield-badge svg {
  width: 20px;
  height: 20px;
  stroke: #0b1329;
}

.quote-modal-title {
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.quote-modal-subtitle {
  color: #94a3b8;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
  line-height: 1.35;
}

.quote-modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.quote-modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Modal Body Form */
.quote-modal-body {
  padding: 1.5rem 1.6rem 1.6rem;
  overflow-y: auto;
  background: #ffffff;
}

.quote-modal-form {
  display: flex;
  flex-direction: column;
}

.quote-grid-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.quote-grid-row-3 {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.05fr;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}

@media (max-width: 600px) {
  .quote-grid-row-2,
  .quote-grid-row-3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.quote-field-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quote-field-full {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.95rem;
}

.quote-field-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #1e293b;
  text-transform: uppercase;
}

.quote-field-label .required {
  color: #ef4444;
}

.quote-input,
.quote-select,
.quote-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background-color: #f8fafc;
  color: #0f172a;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.quote-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px 16px;
  padding-left: 0.85rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

.quote-input:focus,
.quote-select:focus,
.quote-textarea:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #ff9800;
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
}

.quote-input::placeholder,
.quote-textarea::placeholder {
  color: #94a3b8;
}

.quote-size-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.quote-size-input-wrapper .quote-input {
  padding-right: 3.5rem;
}

.quote-size-input-wrapper .suffix {
  position: absolute;
  right: 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  pointer-events: none;
}

.quote-textarea {
  resize: vertical;
  min-height: 68px;
}

.quote-field-error {
  display: none;
  font-size: 0.72rem;
  color: #ef4444;
  font-weight: 600;
}

.quote-field-error.visible {
  display: block;
}

/* Modal Submit Button matching Screenshot 2 */
.quote-submit-slot {
  margin-top: 0.4rem;
}

.quote-submit-btn {
  width: 100%;
  background-color: #ff9800; /* Solid orange from Screenshot 2 */
  color: #000000;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  padding: 0.95rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.32);
  transition: all 0.18s ease;
}

.quote-submit-btn:hover {
  background-color: #f57c00;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.45);
}

.quote-submit-btn:active {
  transform: translateY(0);
}

.quote-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.quote-submit-btn .send-icon {
  width: 18px;
  height: 18px;
}

/* Privacy Note */
.quote-privacy-footer {
  text-align: center;
  font-size: 0.73rem;
  color: #64748b;
  line-height: 1.45;
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.quote-privacy-footer .lock-icon {
  font-size: 0.85rem;
}

/* Confirmation View inside Modal */
.quote-modal-success {
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.success-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background-color: #dcfce7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.success-headline {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0b1329;
  margin: 0 0 0.5rem;
}

.success-text {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto 1.25rem;
}

.success-sheet-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  text-align: left;
  max-width: 440px;
  margin: 0 auto 1.5rem;
  font-size: 0.82rem;
}

.sheet-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.sheet-info-row:last-child {
  border-bottom: none;
}

.text-success {
  color: #15803d;
  font-weight: 700;
}

.text-queued {
  color: #b45309;
  font-weight: 700;
}

.btn-quote-done {
  background: #0b1329;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-quote-done:hover {
  background: #1e293b;
}

.spinner-inline.dark {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
}

/* Spinner */
.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Google Sheets Hub Modal
   ========================================================================== */
.lead-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lead-modal-overlay.open {
  display: flex;
}

.lead-modal-container {
  background: #ffffff;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.lead-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.lead-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sheets-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #e6f4ea;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lead-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f2b48;
  margin: 0;
}

.lead-modal-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0.15rem 0 0;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.btn-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.lead-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Auth Card inside Modal */
.hub-auth-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.auth-prompt-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .auth-prompt-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

.auth-prompt-content h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f2b48;
  margin: 0 0 0.35rem;
}

.auth-prompt-content p {
  font-size: 0.85rem;
  color: #475569;
  margin: 0;
  line-height: 1.45;
}

/* Connected Box */
.auth-connected-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.connected-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.status-indicator-dot.online {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.connected-status-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f2b48;
}

.user-email-pill {
  font-size: 0.78rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.connected-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
}

@media (max-width: 640px) {
  .connected-details {
    flex-direction: column;
    align-items: flex-start;
  }
}

.spreadsheet-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sheet-icon {
  font-size: 1.5rem;
}

.sheet-title-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f2b48;
}

.sheet-sub-text {
  font-size: 0.78rem;
  color: #64748b;
}

.connected-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-open-sheet {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0f9d58;
  color: #ffffff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-open-sheet:hover {
  background: #0b8043;
}

.btn-disconnect {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-disconnect:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Action Bar */
.hub-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hub-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hub-stat-pill {
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
}

.stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f2b48;
  line-height: 1.2;
}

.stat-lbl {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
}

.hub-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-hub-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-hub-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-hub-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0f2b48;
  border: none;
  color: #ffffff;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-hub-primary:hover {
  background: #1e3a8a;
}

/* Leads Table */
.hub-table-wrapper {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-height: 380px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.leads-table th {
  background: #f8fafc;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  color: #475569;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.leads-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.leads-table tr:hover {
  background: #f8fafc;
}

.contact-link {
  color: #0f2b48;
  font-weight: 700;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

.contact-sub {
  color: #64748b;
  font-size: 0.75rem;
  text-decoration: none;
}

.urgency-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}

.urgency-pill.urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.sheet-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.sheet-status-pill.synced {
  background: #dcfce7;
  color: #15803d;
}

.sheet-status-pill.pending {
  background: #fef3c7;
  color: #b45309;
}

.empty-table-cell {
  text-align: center;
  padding: 3rem 1rem !important;
}

.empty-table-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
}

.empty-table-wrap p {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
  color: #334155;
}

.empty-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Accordion */
.hub-accordion {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.accordion-content {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

.webhook-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 0.5rem;
}

.webhook-input-row {
  display: flex;
  gap: 0.5rem;
}

.webhook-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
}

.btn-save-webhook {
  background: #0f2b48;
  color: #ffffff;
  border: none;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-test-webhook {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn-test-webhook:hover {
  background: #1d4ed8;
}

.webhook-note {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0.4rem 0 0;
}

/* Status Banner in Lead Hub */
.hub-status-banner {
  display: none;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.hub-status-banner.visible {
  display: block;
}
.hub-status-banner.success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}
.hub-status-banner.info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}
.hub-status-banner.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* Custom Spreadsheet Link Row */
.hub-custom-sheet-wrap {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #cbd5e1;
}

.hub-custom-sheet-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.35rem;
  display: block;
}

.hub-custom-sheet-input-row {
  display: flex;
  gap: 0.45rem;
}

.hub-custom-sheet-input {
  flex: 1;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.btn-link-custom-sheet {
  background: #0f2b48;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn-link-custom-sheet:hover {
  background: #1e3a8a;
}

/* Code Snippet Box */
.script-code-box {
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  padding: 0.85rem;
  border-radius: 6px;
  overflow-x: auto;
  position: relative;
  margin: 0.5rem 0;
}

.script-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.btn-copy-script {
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-copy-script:hover {
  background: #475569;
}

/* ==========================================================================
   Google Sign-In Button (Official GSI Spec)
   ========================================================================== */
.gsi-material-button {
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: #ffffff;
  background-image: none;
  border: 1px solid #747775;
  border-radius: 20px;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  vertical-align: middle;
  white-space: nowrap;
  font-family: 'Roboto', arial, sans-serif;
  font-size: 14px;
  height: 40px;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 16px;
  position: relative;
  text-align: center;
  transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 12px;
  min-width: 20px;
  width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
  flex-grow: 1;
  font-family: 'Roboto', arial, sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
  transition: opacity 0.218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.gsi-material-button:hover {
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  background-color: #f7fafe;
}

/* ==========================================================================
   Comprehensive Mobile Responsiveness & Touch Optimization
   ========================================================================== */

/* 1. Global Horizontal Overflow Guard */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* 2. Prevent iOS Safari Auto-Zoom on Form Inputs */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea,
  .quote-input,
  .quote-select,
  .quote-textarea,
  .form-input,
  .form-select {
    font-size: 16px !important; /* Mandatory to prevent iOS auto-zoom */
  }

  body {
    /* Extra padding at bottom to prevent floating CTA from covering content */
    padding-bottom: 74px;
  }
}

/* 3. Hero & Header Responsive Tweaks */
@media (max-width: 640px) {
  .hero-tool-section {
    padding: 1.5rem 0 2.25rem;
  }

  .hero-header {
    margin-bottom: 1.35rem;
  }

  .hero-title {
    font-size: clamp(1.6rem, 5.8vw, 2.1rem);
    line-height: 1.22;
  }

  .hero-subtitle {
    font-size: 0.98rem;
    line-height: 1.5;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* 4. Calculator Pane on Mobile */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .calculator-card-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .calculator-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .calculator-inputs-pane {
    padding: 1.25rem 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .input-section-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #roofCalculatorForm {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  .form-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 1.15rem;
  }

  .form-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .form-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    width: auto;
    max-width: 100%;
  }

  .input-with-addon {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .form-input,
  .form-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px !important;
  }

  .form-select {
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
    background-position: right 0.85rem center;
  }

  .range-slider-wrap,
  .range-slider {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .calculator-actions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 1.25rem;
  }

  .calculator-results-pane {
    padding: 1.25rem 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .preset-chips-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .chips-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .chip-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
    min-height: 38px;
    justify-content: center;
    box-sizing: border-box;
    max-width: 100%;
  }

  .diagram-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem;
  }

  .schematic-canvas-box {
    min-height: 180px;
    height: 180px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .diagram-live-badge,
  .diagram-live-overlay {
    font-size: 0.76rem;
    padding: 0.25rem 0.6rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-calculate {
    min-height: 48px;
    font-size: 0.98rem;
    padding: 0.85rem 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  .results-headline-range {
    font-size: clamp(1.55rem, 5.5vw, 2.15rem);
    word-break: break-word;
  }

  .results-avg-highlight {
    font-size: 0.88rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .results-secondary-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .btn-action-outline {
    width: 100%;
    justify-content: center;
  }

  .btn-get-free-quote-cta {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
  }
}

/* 5. Range Cards Grid on Mobile */
@media (max-width: 540px) {
  .range-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .range-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.95rem;
    text-align: left;
  }

  .range-card-label {
    margin-bottom: 0;
    font-size: 0.85rem;
  }

  .range-card-price {
    font-size: 1.25rem;
  }

  .range-card.featured .range-card-price {
    font-size: 1.35rem;
  }
}

/* 6. Quote Modal Mobile Polish */
@media (max-width: 640px) {
  .quote-modal-overlay {
    padding: 0.4rem;
    align-items: flex-end;
  }

  .quote-modal-container {
    width: 100%;
    max-width: 100%;
    max-height: 93vh;
    border-radius: 16px 16px 10px 10px;
    margin: 0;
  }

  .quote-modal-header {
    padding: 0.85rem 1rem;
  }

  .quote-modal-title {
    font-size: 1rem;
    line-height: 1.25;
  }

  .quote-modal-subtitle {
    font-size: 0.74rem;
    line-height: 1.35;
  }

  .quote-modal-body {
    padding: 1rem 1rem 1.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .quote-grid-row-2,
  .quote-grid-row-3 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .quote-input,
  .quote-select,
  .quote-textarea {
    min-height: 46px;
    padding: 0.7rem 0.85rem;
  }

  .quote-textarea {
    min-height: 70px;
  }

  .quote-submit-btn {
    min-height: 50px;
    font-size: 1.02rem;
    padding: 0.85rem 1rem;
  }

  .quote-privacy-footer {
    font-size: 0.7rem;
    margin-top: 0.65rem;
  }
}

/* 7. Floating Bottom Mobile Quick Quote Bar */
.mobile-floating-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-floating-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.1);
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .mobile-floating-bar.hidden-during-modal {
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
  }

  .btn-mobile-floating-quote {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #000000;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.96rem;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
    cursor: pointer;
    text-decoration: none;
    min-height: 46px;
  }

  .btn-mobile-floating-quote .star-icon {
    color: #000000;
  }

  .floating-badge-free {
    background: #000000;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    margin-left: 0.25rem;
  }
}

/* 8. Table & General Grid Responsiveness */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
    margin: 1.25rem 0;
  }

  .data-table {
    min-width: 580px;
    font-size: 0.85rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.75rem;
  }

  .cards-grid-2,
  .cards-grid-3,
  .cards-grid-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .state-grid-50 {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem;
  }

  .trust-banner {
    padding: 1.25rem 1rem;
    gap: 1rem;
  }

  .cross-link-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1rem;
  }

  .cross-link-band .btn-hero-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}


