/* ── Developer credit logo: fixed size ──────────────────────────── */
.developer-credit {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: rgba(247, 251, 255, 0.6);
  font-size: 0.82rem;
}

.developer-credit img {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  flex-shrink: 0;
}

/* ── Footer logo: show naturally, no invert filter ─────────────── */
.footer-logo {
  filter: none !important;
  width: 80px !important;
  height: auto !important;
}

/* ── Appointment section: simplified friendly layout ────────────── */
.appt-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 28px;
}

.appt-lead {
  margin: 12px 0 0;
  color: #5f564e;
  font-size: 1.05rem;
  line-height: 1.7;
}

.appt-trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 32px;
  max-width: 700px;
}

.appt-trust-item {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(110, 89, 57, 0.14);
  color: #173453;
  font-size: 0.88rem;
  font-weight: 800;
}

/* ── Mobile: calculator + buttons ─────────────────────────────── */
@media (max-width: 640px) {

  /* Prevent horizontal overflow at the page level */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .container {
    width: calc(100% - 24px);
    max-width: 100%;
  }

  /* Calculator section: never clip or overflow */
  .calculator-section.container,
  .calculator-section {
    padding-left: 0;
    padding-right: 0;
    width: 100% !important;
    max-width: 100% !important;
  }

  .calculator-shell {
    padding: 12px !important;
    overflow: visible !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Tool layout: single column, inputs FIRST */
  .tool-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Kill all fixed min-widths on sidebar — this is the overflow culprit */
  .tool-sidebar {
    order: 1 !important;
    position: static !important;
    padding: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tool-results {
    order: 2 !important;
    padding: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Form inside sidebar: full width, no overflow */
  .tool-form {
    width: 100% !important;
    min-width: 0 !important;
  }

  .form-group {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Hero buttons: stack full-width */
  .hero-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
  }

  .hero-cta,
  .hero-pdf-btn {
    width: 100% !important;
    min-height: 52px;
    font-size: 0.97rem;
    justify-content: center;
  }

  /* Updates callout: stack vertically */
  .updates-callout {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 18px;
  }

  .updates-text {
    font-size: 1.05rem;
    text-align: center;
  }

  .updates-arrow {
    display: none;
  }

  .updates-cta {
    width: 100% !important;
    min-height: 52px;
    font-size: 1rem;
    justify-content: center;
  }

  /* Prevent iOS input zoom + make inputs full-width */
  input[type="number"],
  input[type="range"],
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select {
    font-size: 16px !important;
    min-height: 48px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Range slider: reset height so it doesn't add to overflow */
  input[type="range"] {
    min-height: 0 !important;
    height: 36px !important;
  }

  /* Scenario + calculate buttons */
  .scenario-btn {
    width: 100% !important;
    min-height: 48px;
    font-size: 0.95rem;
    box-sizing: border-box !important;
  }

  #calculateBtn {
    width: 100% !important;
    min-height: 52px;
    font-size: 1rem;
    margin-top: 4px;
    box-sizing: border-box !important;
  }

  /* Result cards: 2-col */
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .result-card {
    padding: 12px 10px !important;
    min-width: 0 !important;
  }

  .result-value {
    font-size: clamp(1rem, 5vw, 1.35rem) !important;
    word-break: break-word;
  }

  /* Chart: contained */
  .chart-canvas {
    max-height: 200px;
    width: 100% !important;
  }

  .chart-container {
    width: 100% !important;
    min-width: 0 !important;
    padding: 14px !important;
    box-sizing: border-box !important;
  }

  /* Monthly table scrollable */
  #monthlyTable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
  }

  /* Form name fields: single column */
  .form-split {
    grid-template-columns: 1fr !important;
  }

  /* Topbar */
  .topbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px;
    padding: 14px 16px !important;
    margin-bottom: 20px;
  }

  .topbar-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
    font-size: 0.85rem;
  }

  .topbar-links a {
    text-align: center;
    padding: 10px 8px;
  }

  /* Section titles */
  .section-title {
    font-size: clamp(1.6rem, 6vw, 2.4rem) !important;
  }

  /* Lead form */
  .lead-shell {
    padding: 16px !important;
  }

  .lead-copy {
    padding: 16px !important;
  }

  .lead-submit-btn,
  .lead-form button[type="submit"] {
    width: 100% !important;
    min-height: 52px;
    font-size: 1rem;
  }

  /* Appointment section: mobile */
  .appt-intro {
    padding: 0 4px;
  }

  .appt-lead {
    font-size: 0.97rem;
  }

  .appt-trust-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 24px;
  }

  .appt-trust-item {
    text-align: center;
  }

  .calendly-panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px;
  }

  .calendly-fallback-link {
    width: 100% !important;
    text-align: center;
  }

  .calendly-inline-widget {
    height: 560px !important;
  }

  .appointment-shell {
    padding: 20px 16px !important;
  }
}
