/* ============================================================
   KABS AI LABS — audit patches
   Append this to the END of /assets/css/styles.css, or load it
   after styles.css. It only overrides; it deletes nothing.
   ============================================================ */

/* --- 1. Contrast: --faint was #9aa6be on white — 2.6:1 (fails WCAG AA).
       #6b7688 on white — 4.9:1 and reads nearly identically. --- */
:root{
  --faint: #6b7688;
}
.fr-time,
.pago,
.cs-illus,
.demo-transcript.is-empty::before,
.demo-transcript:empty::before{
  color: #6b7688 !important;
}
/* 10.5px monospace timestamps were unreadable on a phone */
.pago{ font-size: 11.5px !important; }
.fr-time{ font-size: 12px !important; }

/* --- 2. CLS: reserve space for the JS-injected header + announcement bar
       so the hero doesn't jump when they land. Adjust the values if your
       real header measures differently — check in DevTools. --- */
#site-header{ min-height: 108px; display: block; }
@media (max-width: 820px){ #site-header{ min-height: 96px; } }
#site-footer{ min-height: 320px; }
@media (max-width: 820px){ #site-footer{ min-height: 520px; } }

/* --- 3. Images: stop layout shift while logos decode. --- */
.tool-pill .tlogo,
.ng-sat img,
.ochip img,
.io-chip img,
.av-chip img{
  aspect-ratio: 1 / 1;
}

/* --- 4. Marquees must stop for prefers-reduced-motion (WCAG 2.2.2).
       The old rule covered the workflow card and orbits but not these. --- */
@media (prefers-reduced-motion: reduce){
  .marquee-track,
  .tool-track,
  .announce .marquee-track{
    animation: none !important;
    transform: none !important;
  }
  .marquee{ overflow-x: auto; }
}
.marquee-static .marquee-track,
.marquee-track.marquee-static,
.tool-track.marquee-static{
  animation: none !important;
  transform: none !important;
}

/* --- 5. Visible focus indicator. Verify your base stylesheet isn't
       removing outlines; this guarantees a visible ring either way. --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible{
  outline: 3px solid #2f6ad6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- 6. Heading order fix.
       Service pages used <h4> directly under <h2>, skipping a level.
       The bulk script promotes those to <h3 class="as-h4">; these rules
       preserve the previous visual size exactly. --- */
.feat h3.as-h4,
.step h3.as-h4,
.compare-col h3.as-h4,
.aside-card h3.as-h4,
.impact-banner h3.as-h4,
.feedback h3.as-h4{
  font-size: 16px;
  margin-bottom: 4px;
  line-height: 1.35;
}
.build-panel h3{ font-size: 18px; margin-bottom: 6px; }
.impact-banner h3{ font-size: 16px; margin-bottom: 2px; }

/* --- 7. Form status messaging (new element created by main.js). --- */
.form-status{
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  min-height: 0;
}
.form-status:empty{ display: none; }
.form-status.is-error{
  background: #fdecec;
  border: 1px solid #f3c6c6;
  color: #9a2f2f;
  border-radius: 10px;
  padding: 10px 14px;
}

/* --- 8. Touch targets: nothing interactive below 44px. --- */
.foot-social a{
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.share a{
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- 9. The live counter overflowed at 320–375px.
       11vw on a 9-character string exceeded the container. --- */
.live-counter{
  font-size: clamp(34px, 9vw, 128px);
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* --- 10. Keep the WhatsApp FAB clear of the cookie bar on mobile. --- */
@media (max-width: 520px){
  .fab{ bottom: 16px; }
  body:has(.cookie-bar) .fab{ bottom: 96px; }
}

/* --- 11. Belt-and-braces: no horizontal scroll anywhere. --- */
html, body{ overflow-x: hidden; }
.marquee{ overflow: hidden; }

/* --- 12. Services dropdown closed when the cursor crossed into it.
       .menu-panel sits at top: calc(100% + 14px), so that 14px gap was
       dead space: the pointer left .has-menu and the panel hid instantly.
       This transparent bridge is a child of the panel, so hovering it
       keeps .has-menu:hover true all the way down. It only exists while
       the panel is open, because it inherits visibility:hidden when closed. --- */
.menu-panel::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
  background: transparent;
}
