/* =========================================================================
   PHASE 14B — AI Agents page · mobile shortening pass
   SCOPE: AI Agents.html ONLY, via html[data-aa-14b] marker.
   ALL rules live inside @media (max-width: 767px) → zero desktop impact.
   Builds on the existing mobile system (mobile-cards.js / mobile-section-nav.js
   / styles-mobile-pass.css). Does NOT undo prior phases.
   ========================================================================= */

/* ----- Desktop & tablet (>=768px): the 14B mobile-only chrome is hidden ----- */
.aa-qp,
.aa-midcta {
  display: none;
}

@media (max-width: 767px) {

  /* ===================================================================
     1 · HERO — compress vertical rhythm, clamp copy, tame the theater
     =================================================================== */
  html[data-aa-14b] .hv2-hero {
    padding-top: 84px !important;   /* clears nav, was much taller */
    padding-bottom: 28px !important;
  }
  html[data-aa-14b] .hv2-head {
    margin-bottom: 4px !important;
  }
  html[data-aa-14b] .hv2-eyebrow {
    margin-bottom: 12px !important;
  }
  html[data-aa-14b] .hv2-h {
    font-size: clamp(30px, 8.6vw, 40px) !important;
    line-height: 1.08 !important;
    margin: 0 0 12px !important;
  }
  /* Support copy: full text stays in DOM, clamped visually to 3 lines */
  html[data-aa-14b] .hv2-sub {
    font-size: 15px !important;
    line-height: 1.5 !important;
    margin: 0 auto 18px !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* CTA order: primary (Book a Demo) → ghost (Explore) → link (Use cases) */
  html[data-aa-14b] .hv2-ctas {
    gap: 10px !important;
    margin-bottom: 6px !important;
  }
  html[data-aa-14b] .hv2-ctas .btn {
    width: 100%;
    justify-content: center;
  }
  html[data-aa-14b] .hv2-ctas .btn-link {
    margin-left: 0 !important;
  }

  /* The live operations theater is the single biggest height sink.
     Collapse it behind a fade + "Expand live view" toggle (wired by
     mobile-section-nav.js once aa-mobile-14b.js tags it). */
  html[data-aa-14b] .aat[data-bgmn-expand="collapsed"] {
    max-height: 340px !important;
  }
  /* Trust badges: keep but tighten (they're real trust signals) */
  html[data-aa-14b] .hv2-badges {
    gap: 8px !important;
    margin-top: 16px !important;
  }

  /* ===================================================================
     2 · QUICK-PATH block (injected by aa-mobile-14b.js) — show on mobile
     =================================================================== */
  html[data-aa-14b] .aa-qp {
    display: block;
    padding: 18px 18px 4px;
    max-width: 560px;
    margin: 0 auto;
  }
  .aa-qp-label {
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--site-text-3, #6E7B98);
    margin: 0 0 10px;
  }
  .aa-qp-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--site-blue, #0055FF);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 6px 24px rgba(0, 85, 255, 0.28);
    margin-bottom: 10px;
  }
  .aa-qp-primary .aa-qp-arrow { flex: 0 0 auto; opacity: 0.9; }
  .aa-qp-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .aa-qp-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 10px;
    border-radius: 11px;
    background: rgba(12, 18, 38, 0.85);
    border: 1px solid rgba(79, 200, 255, 0.18);
    color: var(--site-text, #ECF0FA);
    text-decoration: none;
    min-height: 64px;
  }
  .aa-qp-tile .t {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }
  .aa-qp-tile .s {
    font-family: var(--font-mono, ui-monospace, Menlo, monospace);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--site-text-3, #6E7B98);
  }
  .aa-qp-tile:active { border-color: rgba(79, 200, 255, 0.5); }

  /* ===================================================================
     3 · MID-PAGE CTA band (injected) — strong, compact, mobile-only
     =================================================================== */
  html[data-aa-14b] .aa-midcta {
    display: block;
    margin: 6px 18px 10px;
    padding: 22px 20px;
    border-radius: 16px;
    text-align: center;
    background:
      radial-gradient(120% 140% at 50% 0%, rgba(0, 85, 255, 0.18), transparent 60%),
      linear-gradient(180deg, rgba(12, 18, 38, 0.92), rgba(6, 9, 18, 0.94));
    border: 1px solid rgba(79, 200, 255, 0.2);
  }
  .aa-midcta-h {
    font-family: var(--font-display, inherit);
    font-size: 21px;
    line-height: 1.18;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 14px;
    text-wrap: balance;
  }
  .aa-midcta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 11px;
    background: var(--site-blue, #0055FF);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 6px 24px rgba(0, 85, 255, 0.28);
  }

  /* ===================================================================
     4 · SECTION RHYTHM — trim vertical padding across the page on mobile
     =================================================================== */
  html[data-aa-14b] .aa-cv-section,
  html[data-aa-14b] .aa-pick-section,
  html[data-aa-14b] .aax-ind,
  html[data-aa-14b] .aax-hub,
  html[data-aa-14b] .aax-outc,
  html[data-aa-14b] .adi-dept,
  html[data-aa-14b] .adi-int,
  html[data-aa-14b] .adi-subnav,
  html[data-aa-14b] .tcp-section,
  html[data-aa-14b] .cw-section,
  html[data-aa-14b] .aa-proof-section {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  /* Section intro paragraphs: clamp visually (full text remains in DOM) */
  html[data-aa-14b] .aax-head > p,
  html[data-aa-14b] .adi-dept-head > p,
  html[data-aa-14b] .adi-int-head > p,
  html[data-aa-14b] .aa-cv-head > p,
  html[data-aa-14b] .cine-head > p,
  html[data-aa-14b] .aax-hub-head > p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ===================================================================
     5 · COLLAPSIBLE cinematic widgets — cap height of the tagged inner
         visual blocks; headings stay visible above the fade.
         (toggle button + fade come from styles-mobile-pass.css)
     =================================================================== */
  html[data-aa-14b] .aa-cv-bldr[data-bgmn-expand="collapsed"],
  html[data-aa-14b] .aax-stage[data-bgmn-expand="collapsed"],
  html[data-aa-14b] .adi-int-hero[data-bgmn-expand="collapsed"],
  html[data-aa-14b] .tcp-console[data-bgmn-expand="collapsed"],
  html[data-aa-14b] .cw-container[data-bgmn-expand="collapsed"] {
    max-height: 320px !important;
  }

  /* Decorative-only secondary marquee inside Integrations — hide on mobile */
  html[data-aa-14b] .adi-int-marquee {
    display: none !important;
  }

  /* ===================================================================
     6 · "Show all / Expand" buttons — give them consistent room
     =================================================================== */
  html[data-aa-14b] .bgmc-more {
    margin-top: 14px;
  }
}
