/* [v4.16.80hm +theme-single-mode-dark 2026-05-09 Q3-batch-62.4] auto-migrated hex literals to var(--aict-*) tokens */
/**
 * AICT Mobile-First — Touch Runner Optimizations
 * @since 1.73.0
 */

/* ─── Prevent horizontal overflow from off-screen elements ─── */
html, body {
  overflow-x: hidden;
}

/* ─── Touch targets ────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Minimum 44×44px touch targets for all interactive elements */
  .aict-run-btn,
  .aict-copy-btn,
  .aict-export-btn,
  button[id*="aict"],
  .aict-btn-sm {
    min-height: 44px;
    min-width: 44px;
  }

  /* Tool form inputs — larger on mobile */
  .aict-tool-textarea,
  textarea[class*="aict"],
  .aict-input,
  input[class*="aict"] {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 14px !important;
  }

  /* Agent runner: stack columns */
  .aict-detail-runner {
    grid-template-columns: 1fr !important;
  }

  /* Wider step pills on mobile */
  .aict-detail-step-pill {
    min-width: unset !important;
    font-size: 12px !important;
  }
}

/* ─── Sticky Run button (mobile) ───────────────────────────── */
@media (max-width: 768px) {
  .aict-sticky-run-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--aict-bg);
    border-top: 1px solid var(--aict-border);
    padding: 12px 16px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .aict-sticky-run-bar .aict-run-btn {
    flex: 1;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    height: 48px;
    background: #7c3aed;
    color: var(--aict-bg, #fff);
    border: none;
    cursor: pointer;
  }

  .aict-sticky-run-bar .aict-run-btn:disabled {
    background: #a78bfa;
    cursor: not-allowed;
  }

  /* Dark mode adjustments for sticky run bar */
  [data-theme="dark"] .aict-sticky-run-bar {
    background: var(--aict-bg-card);
    border-top-color: var(--aict-border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  }

  [data-theme="dark"] .aict-sticky-run-bar .aict-run-btn {
    background: #818cf8;
  }

  [data-theme="dark"] .aict-sticky-run-bar .aict-run-btn:disabled {
    background: #4c1d95;
  }

  /* Prevent page content from being hidden behind sticky bar */
  .aict-tool-page-body,
  .aict-detail-page {
    padding-bottom: 80px !important;
  }
}

/* ─── Tool page mobile layout ───────────────────────────────── */
@media (max-width: 600px) {
  .aict-tool-card {
    padding: 16px !important;
    border-radius: 12px !important;
  }

  .aict-results-section {
    padding: 16px !important;
  }

  /* Hide labels, show placeholder only on very small screens */
  .aict-field-label {
    font-size: 13px !important;
  }

  /* Sharing / export bar: horizontal scroll */
  .aict-share-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
  }
}

/* ─── Swipe-friendly horizontal tabs ───────────────────────── */
@media (max-width: 768px) {
  .aict-search-tabs,
  .aict-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }

  .aict-search-tabs::-webkit-scrollbar,
  .aict-tab-bar::-webkit-scrollbar {
    display: none;
  }

  .aict-search-tab,
  .aict-tab {
    flex-shrink: 0;
  }
}

/* ─── Agents page — mobile step flow ───────────────────────── */
@media (max-width: 768px) {
  .aict-agents-hero h1 {
    font-size: 1.6rem !important;
  }

  .aict-agents-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─── Reduce motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Floating chat/WhatsApp button positioning ────────────────── */
/* Desktop: move above compare bar and other fixed elements */
.whatsapp-float,
.floating-chat-btn,
[class*="whatsapp"],
[class*="chat-float"] {
  bottom: 80px !important;
  z-index: 9990 !important; /* below compare bar (9998), below modals */
}

/* Mobile: smaller, tucked right, above sticky nav */
@media (max-width: 768px) {
  .whatsapp-float,
  .floating-chat-btn,
  [class*="whatsapp"],
  [class*="chat-float"] {
    bottom: 80px !important;
    right: 12px !important;
    width: 44px !important;
    height: 44px !important;
  }
}

/* Hide floating chat on pages with a contact form */
.landing-page-contact .whatsapp-float,
.landing-page-contact .floating-chat-btn,
.landing-page-contact [class*="whatsapp"],
.landing-page-contact [class*="chat-float"] {
  display: none !important;
}
