/* ── 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%;
  }

  main > section {
    margin-top: 28px !important;
    padding-top: 24px !important;
  }

  main > section:first-child {
    margin-top: 24px !important;
  }

  .calculator-intro {
    width: calc(100% - 24px) !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .calculator-content {
    padding: 20px 16px !important;
    border-radius: 16px !important;
  }

  #hero-title {
    display: inline-block !important;
    max-width: 100% !important;
    margin-top: 1.5rem !important;
    margin-bottom: 2rem !important;
    padding: 1rem !important;
    border: 1px solid rgba(77, 214, 255, 0.28) !important;
    border-radius: 1.25rem !important;
    background:
      radial-gradient(circle at 12% 18%, rgba(77, 214, 255, 0.32), transparent 34%),
      linear-gradient(135deg, rgba(2, 18, 32, 0.72), rgba(5, 62, 91, 0.58)) !important;
    color: #4dd6ff !important;
    font-size: clamp(2.25rem, 11vw, 3.25rem) !important;
    font-weight: 700 !important;
    line-height: 1.18 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    text-shadow: 0 0 12px rgba(77, 214, 255, 0.45) !important;
    box-shadow:
      0 0 30px rgba(77, 214, 255, 0.16),
      0 18px 42px rgba(5, 14, 24, 0.34) !important;
  }

  @media (prefers-reduced-motion: reduce) {
    #hero-title {
      animation: none !important;
    }
  }

  /* 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;
    margin: 20px 0 !important;
  }

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

  .game-lab-links {
    display: grid !important;
    grid-template-columns: 1fr !important;
    margin: 12px 0 0 !important;
  }

  .game-lab-links .journey-link {
    width: 100% !important;
    min-height: 52px;
    padding: 14px 24px !important;
    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;
  }

  #calculateBtn {
    width: 100% !important;
    min-height: 72px;
    font-size: 1.28rem;
    margin-top: 4px;
    padding: 1.1rem 1.35rem !important;
    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 {
    position: static !important;
    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;
    min-height: 44px;
  }

  /* 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;
  }
}
