/* ============================================================
   ConvaIQ — responsive overrides
   Desktop layout (≥1180px) is authored inline in index.html and
   must remain untouched. Below 1180px these rules take over;
   `!important` is required wherever an inline style is being
   overridden (never for the mobile-only elements like the
   hamburger / mobile menu).
   Breakpoints: 1179px · 1023px · 767px · 479px
   ============================================================ */

/* ================= GLOBAL ================= */
@media (max-width: 1179px) {
  #page { min-width: 0 !important; }
}

@media (max-width: 1023px) {
  .nav-links { display: none !important; }
  .nav-actions .btn-ghost { display: none !important; }
  .nav-burger { display: inline-flex; }
  .nav-actions .btn-primary { white-space: nowrap; }
}

@media (max-width: 767px) {
  .container { padding-left: 20px !important; padding-right: 20px !important; }
  .sec-head h2 { font-size: 30px !important; }
  .sec-head p { font-size: 15.5px !important; }
  .cta-card h2 { font-size: 31px !important; }
  .lang-word { font-size: 44px !important; line-height: 64px !important; }
  .lang-rotator { height: 64px !important; }
  section[id], header[id] { scroll-margin-top: 76px; }
  /* announcement: short copy on phones */
  .announce-full { display: none !important; }
  .announce-short { display: inline !important; }
  /* comfortable touch targets */
  .footer-link { padding: 5px 0 !important; }
  .footer-bottom a { padding: 8px 4px !important; }
  #math a.js-open-lead { padding: 10px 0 !important; }
  /* 6px visual track, 26px hit area */
  input[type="range"] {
    height: 26px !important;
    background: linear-gradient(var(--line-2) 0 0) center / 100% 6px no-repeat !important;
  }
  input[type="range"]::-webkit-slider-thumb { margin-top: 0; }
}

@media (max-width: 479px) {
  .sec-head h2 { font-size: 26px !important; }
  .cta-card h2 { font-size: 27px !important; }
  .lang-word { font-size: 34px !important; line-height: 52px !important; }
  .lang-rotator { height: 52px !important; }
  /* nav: keep the real logo visible without colliding with the CTA */
  .brand-logo-nav { width: 118px !important; }
}

/* Per-section rules are appended below, grouped by section. */


/* ════════════════ GROUP 1 — announcement · hero · footer ════════════════ */

/* ============================================================
   .announce — announcement bar
   ============================================================ */
@media (max-width: 767px) {
  .announce { height: auto !important; padding: 9px 16px; }
  .announce > a { display: none !important; }
  .announce > span:last-of-type {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 479px) {
  .announce > span:first-of-type { display: none !important; } /* NEW pill */
}

/* ============================================================
   header#top — hero (grid, ctas, checks, chat, floats, strip)
   ============================================================ */
@media (max-width: 1179px) {
  .hero-grid { gap: 48px !important; }
  .hero-grid h1 { font-size: 52px !important; }
  /* keep floating cards from being clipped by the header's overflow:hidden;
     float-tr perches above the chat card (inline top:-70px), clear of all text */
  .float-card.float-tr { right: -8px !important; }
  .float-card.float-bl { left: -8px !important; }
  /* let the channel strip wrap before it can overflow */
  .hero-strip { flex-wrap: wrap; row-gap: 12px !important; }
}

@media (max-width: 1023px) {
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 44px !important;
    padding-top: 64px !important;
    padding-bottom: 56px !important;
  }
  .chat-wrap {
    width: 100%;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    /* clearance for the float badge perched above the card */
    margin-top: 26px;
  }
}

@media (max-width: 767px) {
  .hero-grid { padding-top: 56px !important; padding-bottom: 48px !important; }
  .brand-logo-nav { width: 148px !important; }
  .hero-grid h1 { font-size: 40px !important; line-height: 1.12 !important; }
  .hero-grid p { font-size: 16.5px !important; }
  .hero-ctas { flex-wrap: wrap; }
  .hero-checks { flex-wrap: wrap; row-gap: 10px !important; }
  .hero-strip { padding-bottom: 32px !important; }
  .hero-strip > span[style*="height:1px"] { display: none !important; } /* divider */
  /* scale the floating badge cards down but keep them */
  .float-card { padding: 9px 12px !important; gap: 8px !important; border-radius: 12px !important; }
  .float-card > span:first-child { width: 28px !important; height: 28px !important; }
  .float-card span > span:first-child { font-size: 12px !important; }
  .float-card span > span:last-child { font-size: 11px !important; }
}

@media (max-width: 479px) {
  .hero-grid { padding-top: 44px !important; padding-bottom: 36px !important; }
  .brand-logo-nav { width: 118px !important; }
  .hero-grid h1 { font-size: 34px !important; }
  .hero-grid p { font-size: 15.5px !important; }
  .hero-ctas a { width: 100%; }
  /* eyebrow pill fits on one line on small phones */
  .hero-grid > div:first-child > div:first-child > span { font-size: 11px !important; padding: 7px 12px !important; }
  /* chat card fills the width here, so perch the badge above the card
     instead of over the chat header text */
  .chat-wrap { margin-top: 18px; }
  .float-card.float-tr { top: -38px !important; }
  /* duplicates the "Appointment booked" chip inside the chat at this width */
  .float-card.float-bl { display: none !important; }
}

/* ============================================================
   footer — .footer-top / .footer-cols / .footer-bottom
   ============================================================ */
@media (max-width: 1023px) {
  /* keep the three link columns from squeezing until link labels wrap words */
  .footer-top { gap: 40px !important; }
  .footer-top > div:first-child { max-width: 220px !important; }
  .footer-cols { flex-wrap: wrap; gap: 32px 36px !important; }
  .footer-cols > div { flex-shrink: 0; }
}
@media (max-width: 767px) {
  footer { margin-top: 72px !important; }
  .footer-top {
    flex-direction: column !important;
    gap: 36px !important;
    padding-top: 44px !important;
  }
  .footer-cols { flex-wrap: wrap; gap: 32px 40px !important; }
  .footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
  }
}
@media (max-width: 479px) {
  footer { margin-top: 56px !important; }
  .footer-cols { gap: 26px 32px !important; }
}


/* ════════════════ GROUP 2 — difference · channels · intelligence · how ════════════════ */

/* ============================================================
   #difference — "with / without" comparison
   ============================================================ */
@media (max-width: 767px) {
  #difference { padding-top: 72px !important; }
  #difference .diff-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    margin-top: 40px !important;
  }
  /* .vs-chip stays absolutely centered — when the cards stack it
     sits on the seam between them (intentional). */
}
@media (max-width: 479px) {
  #difference { padding-top: 56px !important; }
  #difference .diff-grid > .reveal > div { padding: 26px 22px !important; }
}

/* ============================================================
   #channels — channel cards (3+2 desktop placement)
   ============================================================ */
@media (max-width: 1023px) {
  #channels .chan-grid { grid-template-columns: 1fr 1fr !important; }
  /* reset the desktop span/offset placement on every cell */
  #channels .chan-grid > div { grid-column: auto !important; }
}
@media (max-width: 767px) {
  #channels { padding-top: 72px !important; padding-bottom: 72px !important; }
  #channels .chan-grid {
    grid-template-columns: 1fr !important;
    margin-top: 40px !important;
  }
}
@media (max-width: 479px) {
  #channels { padding-top: 56px !important; padding-bottom: 56px !important; }
  #channels .channel-card { padding: 24px 20px !important; }
}

/* ============================================================
   #intelligence — dark section: orbit visual + feature grid
   ============================================================ */
@media (max-width: 1023px) {
  #intelligence .intel-grid {
    grid-template-columns: 1fr !important;
    gap: 56px !important;
  }
  /* orbit below the text, centered; rings self-center via left:50% */
  #intelligence .intel-orbit {
    order: 2;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }
}
@media (max-width: 767px) {
  #intelligence { padding-top: 72px !important; padding-bottom: 72px !important; }
  #intelligence .intel-grid { gap: 48px !important; }
  #intelligence h2 { font-size: 30px !important; }
  #intelligence .intel-feats { grid-template-columns: 1fr !important; }
  /* keep the "Booked · CRM synced" chip inside the viewport */
  #intelligence .intel-orbit > span:nth-of-type(3) { right: 0 !important; }
}
@media (max-width: 479px) {
  #intelligence { padding-top: 56px !important; padding-bottom: 56px !important; }
  #intelligence h2 { font-size: 26px !important; }
  /* shorter stage; fixed-size rings may bleed sideways — the section
     has inline overflow:hidden so they clip without causing scroll */
  #intelligence .intel-orbit { height: 340px !important; }
  /* lift the "Booked" chip above the core circle so it doesn't sit
     on the logo at narrow widths */
  #intelligence .intel-orbit > span:nth-of-type(3) { top: 64px !important; }
}

/* ============================================================
   #how — four numbered steps + dashed connector
   ============================================================ */
@media (max-width: 1023px) {
  #how .how-grid { grid-template-columns: 1fr 1fr !important; }
  /* the dashed connector only makes sense in a single row */
  #how .how-line { display: none; }
}
@media (max-width: 767px) {
  #how { padding-top: 72px !important; padding-bottom: 72px !important; }
  #how .how-grid { gap: 32px 24px !important; margin-top: 44px !important; }
}
@media (max-width: 479px) {
  #how { padding-top: 56px !important; padding-bottom: 56px !important; }
  #how .how-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
}


/* ════════════════ GROUP 3 — mission control · results · ROI · industries · languages ════════════════ */

/* ============================================================
   Responsive: #control · #results · #math · #industries · #languages
   All rules live inside max-width queries; desktop (≥1180px) untouched.
   ============================================================ */

/* ================= #control — Mission Control ================= */
@media (max-width: 1023px) {
  /* Dashboard collapses to one column: inbox on top, analytics below.
     minmax(0,1fr) releases the min-content floor so nowrap text can truncate
     instead of widening the grid past its card. */
  #control .mc-grid { grid-template-columns: minmax(0, 1fr) !important; }
  #control .mc-grid > div:first-child { border-right: none !important; }
  #control .mc-grid > div:last-child { border-top: 1px solid var(--line-2); }
  /* Pull the toast inside horizontally; keep it below the caption line */
  #control .float-card.mc-float { right: 8px !important; bottom: -42px !important; }
}

@media (max-width: 767px) {
  #control { padding-top: 72px !important; }
  #control .mc-wrap { margin-top: 40px !important; }
  /* Header: tighter, drop the "Mission Control" label (logo + pills stay) */
  #control .mc-wrap > div:first-child > div:first-child { padding: 12px 16px !important; gap: 10px !important; }
  #control .mc-wrap > div:first-child > div:first-child > span:first-of-type { display: none !important; }
  #control .mc-wrap > div:first-child > div:first-child > span:nth-of-type(2) > span { padding: 6px 12px !important; }
  /* Inbox rows: tighter padding, middle column truncates instead of pushing */
  #control .mc-grid > div:first-child > div { padding: 14px 16px !important; }
  #control .mc-grid > div:first-child > div > span:nth-of-type(2) { flex: 1; overflow: hidden; }
  #control .mc-grid > div:first-child > div > span:nth-of-type(2) > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Analytics panel */
  #control .mc-grid > div:last-child { padding: 20px 16px !important; }
  /* Toast would cover the card's footer line — let it flow below the card instead */
  #control .float-card.mc-float { position: static !important; width: fit-content; margin: 18px 0 0 auto; }
}

@media (max-width: 479px) {
  #control { padding-top: 56px !important; }
  /* Keep logo + Inbox pill; hide Calendar / Insights tabs */
  #control .mc-wrap > div:first-child > div:first-child > span:nth-of-type(2) > span:nth-child(n+2) { display: none !important; }
}

/* ================= #results — stats ================= */
@media (max-width: 1023px) {
  #results .stats-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; row-gap: 8px; }
}

@media (max-width: 767px) {
  #results { padding-top: 72px !important; padding-bottom: 72px !important; }
  #results .stats-grid { grid-template-columns: minmax(0, 1fr) !important; row-gap: 0; margin-top: 40px !important; }
  /* Stacked left borders look odd — switch to horizontal rules */
  #results .stats-grid > div { border-left: none !important; padding: 28px 0 12px !important; }
  #results .stats-grid > div + div { border-top: 1px solid var(--line-2); }
  #results .stats-grid > div > div:first-child { font-size: 46px !important; }
  #results .stats-grid > div > div:first-child > span:last-child { font-size: 22px !important; }
}

@media (max-width: 479px) {
  #results { padding-top: 56px !important; padding-bottom: 56px !important; }
  #results .stats-grid > div { padding: 24px 0 8px !important; }
  #results .stats-grid > div > div:first-child { font-size: 40px !important; }
  #results .stats-grid > div > div:first-child > span:last-child { font-size: 20px !important; }
}

/* ================= #math — ROI calculator ================= */
@media (max-width: 1023px) {
  #math .roi-grid { grid-template-columns: minmax(0, 1fr) !important; }
  #math .roi-grid > div:last-child { border-left: none !important; border-top: 1px solid var(--line-2); }
}

@media (max-width: 767px) {
  #math { padding-bottom: 72px !important; }
  #math .sec-head + .reveal { margin-top: 40px !important; }
  #math .roi-grid > div { padding: 30px 26px !important; }
  #math .roi-grid > div:last-child > div { font-size: 44px !important; }
}

@media (max-width: 479px) {
  #math { padding-bottom: 56px !important; }
  #math .roi-grid > div { padding: 26px 20px !important; }
  #math .roi-grid > div:last-child > div { font-size: 38px !important; }
  #math .roi-grid > div:last-child > div > span:last-child { font-size: 15px !important; }
}

/* ================= #industries — marquee ================= */
@media (max-width: 767px) {
  #industries { padding-bottom: 72px !important; }
  #industries > div:last-child { margin-top: 36px !important; }
}

@media (max-width: 479px) {
  #industries { padding-bottom: 56px !important; }
  #marqueeTop > span, #marqueeBottom > span { padding: 10px 18px !important; font-size: 13.5px !important; margin-right: 10px !important; gap: 7px !important; }
}

/* ================= #languages ================= */
@media (max-width: 767px) {
  #languages { padding-bottom: 72px !important; }
  /* Inner wrapper has no .container class — match the global 20px gutters */
  #languages > div { padding-left: 20px !important; padding-right: 20px !important; }
  #languages > div > p { font-size: 15.5px !important; }
}

@media (max-width: 479px) {
  #languages { padding-bottom: 56px !important; }
}


/* ════════════════ GROUP 4 — security · stories · FAQ · CTA ════════════════ */

/* ============================================================
   #security — "Safe by design" card grid (.sec-grid)
   ============================================================ */
@media (max-width: 1023px) {
  #security .sec-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 767px) {
  #security { padding-top: 72px !important; padding-bottom: 72px !important; }
  #security .sec-grid { margin-top: 40px !important; }
}
@media (max-width: 479px) {
  #security { padding-top: 56px !important; padding-bottom: 56px !important; }
  #security .sec-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  #security .lift-card { padding: 24px 20px !important; }
}

/* ============================================================
   #stories — testimonial cards (.stories-grid)
   ============================================================ */
@media (max-width: 1023px) {
  #stories .stories-grid { grid-template-columns: 1fr !important; justify-items: center; }
  #stories .stories-grid > .reveal { width: 100%; max-width: 640px; }
}
@media (max-width: 767px) {
  #stories { padding-top: 72px !important; padding-bottom: 72px !important; }
  #stories .stories-grid { margin-top: 40px !important; gap: 18px !important; }
}
@media (max-width: 479px) {
  #stories { padding-top: 56px !important; padding-bottom: 56px !important; }
  #stories .lift-card { padding: 26px 22px !important; }
}

/* ============================================================
   #faq — accordion (container already narrow at 760px)
   ============================================================ */
@media (max-width: 767px) {
  #faq { padding-top: 72px !important; padding-bottom: 72px !important; }
  #faqList { margin-top: 36px !important; }
}
@media (max-width: 479px) {
  #faq { padding-top: 56px !important; padding-bottom: 56px !important; }
  #faq .faq-card > button { padding: 18px 18px !important; font-size: 15.5px !important; }
  #faq .faq-rows p { padding: 0 18px 20px !important; font-size: 14.5px !important; }
}

/* ============================================================
   #demo — CTA band (.cta-card)
   ============================================================ */
@media (max-width: 767px) {
  #demo { padding-top: 72px !important; } /* right/bottom/left stay 0 from the original shorthand */
  #demo .cta-card {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
  }
}
@media (max-width: 479px) {
  #demo { padding-top: 56px !important; }
  #demo .cta-card {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  #demo .cta-card .btn-white { width: 100%; }
}
