/* Citgentic homepage: PHONE layout polish (motion mode, phones up to 767px wide).
   Swipe carousels with peek + dots + hint, compact cards, no empty blocks.
   Desktop and laptop (fit.css) are untouched by these rules. */

@media (max-width: 767px) {

  /* ---- Swipe carousel (built by motion.js on .bento-grid, .industry-grid, .network-map) ---- */
  .cg-motion .cg-carousel {
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    grid-template-columns: none !important; grid-auto-rows: auto !important;
    gap: 12px; align-items: stretch;
    /* always start at the left: a centred row wider than the screen would push its first cards out of reach */
    justify-content: flex-start !important;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    margin: 0 -24px !important; padding: 4px 24px 8px !important;
    scroll-padding: 0 24px;
    scrollbar-width: none;
    height: auto !important; min-height: 0 !important;
    position: relative;
  }
  .cg-motion .cg-carousel::-webkit-scrollbar { display: none; }
  .cg-motion .cg-slide {
    flex: 0 0 82% !important; width: auto !important; min-width: 0 !important; max-width: none !important;
    scroll-snap-align: center; margin: 0 !important; min-height: 0 !important;
    position: relative !important; inset: auto !important;
  }
  .cg-motion .cg-car-nav {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px;
  }
  .cg-motion .cg-car-hint {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 600; opacity: 0.6;
    transition: opacity 0.3s ease-out;
    animation: cgHintNudge 1.6s ease-in-out infinite;
  }
  .cg-motion .cg-car-hint svg { width: 16px; height: 16px; }
  .cg-motion .cg-car-nav.is-swiped .cg-car-hint { opacity: 0; animation: none; }
  @keyframes cgHintNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
  .cg-motion .cg-car-dots { display: flex; align-items: center; }
  .cg-motion .cg-car-dot {
    position: relative; width: 24px; height: 32px; padding: 0;
    border: 0; background: none; cursor: pointer;
  }
  .cg-motion .cg-car-dot::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 999px;
    background: currentColor; opacity: 0.25;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  }
  .cg-motion .cg-car-dot.is-active::after { opacity: 1; background: var(--c-ink); transform: scaleX(2); }
  .cg-motion .bg-ink .cg-car-dot.is-active::after { background: var(--c-yellow); }
  .cg-motion .bg-ink .cg-car-nav { color: var(--c-white); }
  .cg-motion .cg-car-dot:focus-visible { outline: 2px solid var(--c-yellow); outline-offset: -4px; border-radius: 8px; }

  /* ---- The miss: the "Answered" badge drops under the caller instead of covering the name ---- */
  .cg-motion .callcard-caller { flex-wrap: wrap; row-gap: 8px; }
  .cg-motion .callcard-badge { margin-left: 68px; }
  .cg-motion .callcard { padding: 20px; }
  .cg-motion .callcard-viz { min-height: 56px; padding: 12px 0; }
  .cg-motion .missed-call-section .missed-features { margin-top: 24px; }
  .cg-motion .missed-call-section .missed-feature { padding: 16px 0; }
  /* the three rows become swipeable soft cards on the yellow */
  .cg-motion .missed-call-section .missed-features.cg-carousel .missed-feature { padding: 16px; border: 0; border-radius: 16px; background: rgba(26, 26, 26, 0.06); }
  .cg-motion .missed-call-section .body-large { font-size: 16px; line-height: 1.6; }
  .cg-motion .missed-call-section .callcard { min-height: 0 !important; height: auto !important; }
  .cg-motion .missed-call-section .callcard-stage { margin-top: 24px; }

  /* ---- Handle: compact capability cards ---- */
  .cg-motion .bento-grid { margin-top: 24px !important; }
  .cg-motion .bento-grid .bento-item { padding: 20px; }
  .cg-motion .bento-grid .bento-item .bento-body { margin-top: 16px !important; }
  .cg-motion .bento-grid .bento-hero .bento-body { margin-top: 12px !important; }
  .cg-motion .bento-grid .bento-wave { height: 32px; margin-top: 16px; }
  /* the Connect card: agent and tool chips wrap side by side instead of one per row */
  .cg-motion .bento-grid .bento-flow { flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 8px; }
  .cg-motion .bento-grid .bento-flow .flow-line { display: none; }
  .cg-motion .bento-grid .bento-flow .flow-chips { gap: 6px; flex: 1 1 100%; }
  .cg-motion .bento-grid .bento-flow .flow-chip, .cg-motion .bento-grid .bento-flow .flow-node { padding: 6px 12px; font-size: 14px; line-height: 1.4; }
  .cg-motion .bento-grid .bento-banner { gap: 12px; }

  /* ---- Who it is for: industry cards ---- */
  .cg-motion .industry-grid { margin-top: 24px !important; }
  .cg-motion .industry-grid .industry-card { padding: 20px; }
  .cg-motion .industry-grid .industry-icon { width: 44px; height: 44px; margin-bottom: 12px; }

  /* ---- Built on: one clean logo row, no cut bubble, cards in the carousel ---- */
  .cg-motion .tech-rail-band { background: transparent; border: 0; padding: 0; margin: 24px 0 16px; }
  .cg-motion .tech-rail-band > .label-small { display: none; }
  .cg-motion .tech-rail-band .ticker-track.left { margin-bottom: 0; }
  .cg-motion .tech-rail-band .ticker-track + .ticker-track { display: none; }
  .cg-motion .tech-rail-band .tech-tile { height: 56px; min-width: 140px; background: var(--c-white); }
  .cg-motion .network-map .network-center,
  .cg-motion .network-map > svg { display: none !important; }
  .cg-motion .network-map .network-node { padding: 20px; transform: none !important; opacity: 1 !important; }

  /* ---- We run it: the managed card shows its items straight away, compact points ---- */
  .cg-motion .managed-stage { min-height: 0; padding: 8px 0; }
  .cg-motion .diagram-piece { display: none; }
  .cg-motion .managed-core { opacity: 1 !important; transform: none !important; padding: 20px; }
  .cg-motion .managed-layer { opacity: 1 !important; transform: none !important; }
  /* the five managed items wrap as compact chips (2 or 3 per row) instead of five full rows */
  .cg-motion .managed-stack { display: flex !important; flex-direction: row !important; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .cg-motion .managed-core .managed-layer { flex: 0 0 auto; width: auto; padding: 8px 12px; margin: 0; }
  .cg-motion .managed-points { margin-top: 24px !important; gap: 12px !important; }
  .cg-motion .managed-point { padding: 16px; gap: 12px; }
  .cg-motion .managed-point .mp-icon { width: 36px; height: 36px; flex: 0 0 auto; }

  /* ---- Setup: tighter steps ---- */
  .cg-motion .process-layout { margin-top: 24px !important; }
  .cg-motion .process-step { margin-bottom: 28px !important; }
  .cg-motion .process-step h3 { font-size: 20px; }

  /* ---- Hear it: no fixed-height empty block under the chat ---- */
  .cg-motion .demo-interface { height: auto !important; margin-top: 24px !important; }
  .cg-motion .demo-call, .cg-motion .demo-outcome { height: auto !important; min-height: 0 !important; }
  /* a real chat window: fixed height, newest line at the bottom, older lines scroll up out of view */
  .cg-motion .demo-transcript { height: 260px !important; max-height: none !important; overflow: hidden; justify-content: flex-end; }
  .cg-motion .demo-transcript .dc-line:not(.show) { display: none; }
  .cg-motion .demo-transcript { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px); mask-image: linear-gradient(to bottom, transparent 0, #000 40px); }
  .cg-motion .demo-outcome { padding: 20px; }
  .cg-motion .demo-outcome .outcome-row { margin-bottom: 12px; }

  /* ---- See every call: panel sized to its content ---- */
  .cg-motion .dashboard-visual { margin-top: 24px !important; }
  .cg-motion .dash-card { height: auto !important; }
  .cg-motion .dash-panels { height: auto !important; }
  /* short record fields sit two per row */
  .cg-motion .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; column-gap: 16px; }
  .cg-motion .missed-call-section h2.h1 { font-size: 40px; line-height: 1.08; }

  /* ---- Rhythm: same section padding everywhere, room for the floating controls ---- */
  .cg-motion body > section.section { padding-top: 64px; padding-bottom: 64px; }
  .cg-motion .cg-head + * { margin-top: 24px !important; }
  .cg-motion .footer { padding-bottom: 96px; }
}
