/* ============================================================
   EcomCloud.ai compact organized mobile layout
   Purpose: reduce oversized phone typography/cards and make the
   page feel like an organized service website instead of huge blocks.
   This affects mobile/tablet only and does not modify chat code.
   ============================================================ */

@media (max-width: 820px) {
  :root {
    --mobile-card-radius: 18px;
    --mobile-card-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
  }

  html,
  body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
  }

  body {
    font-size: 15px !important;
    line-height: 1.5 !important;
    background: #f8fbff !important;
  }

  .container,
  .nav-shell {
    width: min(100% - 30px, 1180px) !important;
  }

  .site-header {
    background: rgba(255,255,255,0.985) !important;
    border-bottom: 1px solid rgba(219,230,243,0.9) !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.035) !important;
  }

  .nav-shell {
    min-height: 58px !important;
  }

  .brand-mark {
    width: 34px !important;
    height: 34px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
  }

  .brand-text {
    font-size: 19px !important;
  }

  .nav-toggle {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
  }

  .section-pad,
  section.section-pad {
    padding-top: 38px !important;
    padding-bottom: 38px !important;
  }

  .section-soft,
  .contact-section {
    background: linear-gradient(180deg, #f5f9ff 0%, #ffffff 100%) !important;
  }

  .hero,
  .hero.section-pad,
  section.hero,
  section.hero.section-pad {
    padding-top: 22px !important;
    padding-bottom: 30px !important;
    min-height: auto !important;
    background:
      radial-gradient(circle at 88% 0%, rgba(37,99,235,0.10), transparent 34%),
      radial-gradient(circle at 0% 18%, rgba(0,194,255,0.11), transparent 30%),
      linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
  }

  .hero-grid,
  .two-col,
  .contact-grid,
  .demo-board,
  .question-grid,
  .services-grid,
  .usecase-grid,
  .timeline,
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .hero-grid {
    gap: 18px !important;
  }

  .hero .eyebrow {
    display: none !important;
  }

  .hero h1,
  h1.hero-title,
  .hero-title,
  h1.hero-heading {
    max-width: 8.5em !important;
    margin: 0 0 10px !important;
    font-size: clamp(29px, 7.9vw, 35px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.035em !important;
    text-wrap: balance !important;
  }

  .hero-lead,
  .hero p.hero-lead {
    margin-top: 0 !important;
    max-width: 100% !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #334155 !important;
  }

  .hero-support,
  .hero p.hero-support {
    margin-top: 12px !important;
    padding: 12px 13px !important;
    border-radius: 15px !important;
    font-size: 13.8px !important;
    line-height: 1.48 !important;
    color: #52647c !important;
    background: rgba(255,255,255,0.9) !important;
    border: 1px solid rgba(219,230,243,0.9) !important;
    box-shadow: var(--mobile-card-shadow) !important;
  }

  .hero-actions {
    margin-top: 14px !important;
    gap: 8px !important;
  }

  .hero-actions .btn,
  .contact-form .btn,
  button.btn,
  a.btn {
    width: 100% !important;
    min-height: 46px !important;
    padding: 11px 14px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20) !important;
  }

  .btn-secondary {
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.05) !important;
  }

  .trust-row {
    display: none !important;
  }

  .main-flow-card,
  .visual-card {
    border-radius: 18px !important;
    box-shadow: var(--mobile-card-shadow) !important;
  }

  .visual-topbar {
    height: 44px !important;
    padding: 0 14px !important;
  }

  .visual-topbar strong {
    font-size: 11.5px !important;
  }

  .flow-comparison {
    padding: 14px !important;
    gap: 8px !important;
  }

  .flow-column {
    border-radius: 16px !important;
    padding: 12px !important;
  }

  .flow-label {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }

  .flow-step {
    padding: 9px 10px !important;
    margin-top: 7px !important;
    font-size: 12.5px !important;
    border-radius: 11px !important;
  }

  .mini-dashboard {
    margin: 0 14px 14px !important;
    padding: 13px !important;
    border-radius: 15px !important;
    gap: 8px !important;
    font-size: 12.5px !important;
  }

  /* Section titles: small, readable, and organized. */
  .section-heading,
  .section-heading.narrow,
  .section-intro,
  .contact-copy {
    max-width: 100% !important;
    margin: 0 0 16px !important;
    text-align: left !important;
  }

  .section-heading .eyebrow,
  .section-intro .eyebrow,
  .contact-copy .eyebrow,
  .eyebrow.center,
  p.eyebrow.center,
  .eyebrow {
    display: inline-flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 0 0 8px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.12em !important;
  }

  .eyebrow span,
  p.eyebrow span {
    width: 18px !important;
    height: 2px !important;
  }

  section:not(.hero) h2,
  .section-heading h2,
  .section-intro h2,
  .contact-copy h2,
  h2 {
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(22px, 5.5vw, 26px) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.028em !important;
    text-align: left !important;
    text-wrap: balance !important;
  }

  .section-heading p,
  .section-intro p,
  .contact-copy p,
  .section-dark p {
    margin-top: 8px !important;
    max-width: 100% !important;
    font-size: 14.3px !important;
    line-height: 1.48 !important;
    text-align: left !important;
  }

  /* Cards become compact organized rows/lists on phone. */
  .question-card,
  .service-card,
  .usecase-card,
  .timeline-item,
  .checker-card,
  .contact-form,
  .demo-side,
  .systems-wrap,
  .contact-note {
    border-radius: var(--mobile-card-radius) !important;
    border: 1px solid rgba(219, 230, 243, 0.95) !important;
    box-shadow: var(--mobile-card-shadow) !important;
  }

  .service-card,
  .timeline-item,
  .question-card {
    display: grid !important;
    grid-template-columns: 40px 1fr !important;
    column-gap: 12px !important;
    align-items: start !important;
    padding: 15px !important;
    min-height: 0 !important;
  }

  .service-card:hover {
    transform: none !important;
  }

  .service-icon,
  .question-card span,
  .timeline-item span {
    grid-row: 1 / span 2 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    margin: 0 !important;
    border-radius: 13px !important;
    font-size: 15px !important;
  }

  .timeline-item span {
    border-radius: 12px !important;
  }

  .question-card h3,
  .service-card h3,
  .usecase-card h3,
  .timeline-item h3,
  .demo-side h3,
  .checker-card h3,
  .systems-wrap h3 {
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1.18 !important;
    letter-spacing: -0.03em !important;
  }

  .question-card p,
  .service-card p,
  .usecase-card p,
  .timeline-item p,
  .checker-card p,
  .systems-wrap p {
    margin-top: 5px !important;
    font-size: 13.8px !important;
    line-height: 1.45 !important;
    color: #5d6b82 !important;
  }

  .usecase-card,
  .checker-card,
  .systems-wrap,
  .contact-form,
  .demo-side {
    padding: 16px !important;
  }

  .usecase-grid {
    gap: 10px !important;
  }

  .text-button {
    margin-top: 10px !important;
    font-size: 13.8px !important;
  }

  .demo-board {
    gap: 12px !important;
  }

  .demo-header {
    padding: 6px 10px !important;
    margin-bottom: 10px !important;
    font-size: 10px !important;
  }

  .demo-side ul {
    margin-top: 10px !important;
    gap: 7px !important;
  }

  .demo-side li {
    padding-left: 18px !important;
    font-size: 13.8px !important;
    line-height: 1.45 !important;
    font-weight: 700 !important;
  }

  .demo-side li::before {
    width: 7px !important;
    height: 7px !important;
    top: 8px !important;
  }

  .demo-center {
    min-height: 56px !important;
  }

  .orbit {
    width: 62px !important;
    height: 62px !important;
    font-size: 13px !important;
    box-shadow: 0 12px 24px rgba(37,99,235,0.22) !important;
  }

  .orbit::before { inset: -9px !important; }
  .orbit::after { inset: -18px !important; }

  .systems-wrap {
    margin-top: 16px !important;
  }

  .system-pills,
  .dark-points,
  .checker-options {
    gap: 7px !important;
  }

  .system-pills span,
  .dark-points span,
  .checker-options button {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }

  .section-dark {
    padding-top: 38px !important;
    padding-bottom: 38px !important;
  }

  .checker-result {
    margin-top: 12px !important;
    padding: 12px !important;
    border-radius: 14px !important;
    font-size: 13.5px !important;
  }

  .contact-note {
    margin-top: 14px !important;
    padding: 13px !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
  }

  .contact-form label,
  label {
    margin-bottom: 11px !important;
    gap: 6px !important;
    font-size: 13.7px !important;
    line-height: 1.3 !important;
  }

  input,
  textarea,
  select {
    min-height: 46px !important;
    border-radius: 13px !important;
    padding: 11px 12px !important;
    font-size: 15.5px !important;
  }

  textarea {
    min-height: 118px !important;
  }

  .form-footnote {
    font-size: 12.8px !important;
    line-height: 1.45 !important;
  }

  .signal-strip {
    padding: 12px 0 !important;
  }

  .signal-grid {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 3px !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .signal-grid::-webkit-scrollbar { display: none !important; }

  .signal-card {
    flex: 0 0 auto !important;
    padding: 8px 11px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }

  .site-footer {
    padding: 32px 0 !important;
  }

  .footer-grid p,
  .footer-links a {
    font-size: 13.5px !important;
  }
}

@media (max-width: 420px) {
  .container,
  .nav-shell {
    width: min(100% - 26px, 1180px) !important;
  }

  .hero h1,
  h1.hero-title,
  .hero-title,
  h1.hero-heading {
    font-size: clamp(28px, 7.5vw, 32px) !important;
  }

  section:not(.hero) h2,
  .section-heading h2,
  .section-intro h2,
  .contact-copy h2,
  h2 {
    font-size: 23px !important;
  }

  .question-card h3,
  .service-card h3,
  .usecase-card h3,
  .timeline-item h3,
  .demo-side h3,
  .checker-card h3 {
    font-size: 17.2px !important;
  }

  .question-card p,
  .service-card p,
  .usecase-card p,
  .timeline-item p,
  .demo-side li,
  .checker-card p {
    font-size: 13.4px !important;
  }
}

@media (max-width: 360px) {
  .hero h1,
  h1.hero-title,
  .hero-title,
  h1.hero-heading {
    font-size: 27px !important;
  }

  section:not(.hero) h2,
  .section-heading h2,
  .section-intro h2,
  .contact-copy h2,
  h2 {
    font-size: 21px !important;
  }
}
