/* Q-DASH homepage — MOBILE ONLY layout (≤767px).
   Loaded with media="(max-width: 767px)" and every rule is inside the same media query,
   so desktop is never affected. Content stays in the DOM; only presentation changes.
   "html body #section" prefixes are used to win over the section styles printed later in the page. */
@media (max-width: 767px) {

/* ---------- Shared: horizontal swipe rail ---------- */
html body #ai-center-home .qd-ai-grid,
html body #feasibility-growth .qd-feas-timeline-track,
html body #feasibility-growth .qd-feas-dashboard-grid,
html body #portfolio-preview .home-port-grid,
html body #knowledge-library-home .qkl-home-entry__grid,
html body #how-we-work .qd-workflow-stages-grid,
html body #why-us-journey .qd-journey-nodes-grid {
  display: flex !important;
  flex-wrap: nowrap !important;
  grid-template-columns: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  gap: 12px !important;
  padding: 4px 2px 10px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  align-items: stretch !important;
}
html body #ai-center-home .qd-ai-grid::-webkit-scrollbar,
html body #feasibility-growth .qd-feas-timeline-track::-webkit-scrollbar,
html body #feasibility-growth .qd-feas-dashboard-grid::-webkit-scrollbar,
html body #portfolio-preview .home-port-grid::-webkit-scrollbar,
html body #knowledge-library-home .qkl-home-entry__grid::-webkit-scrollbar,
html body #how-we-work .qd-workflow-stages-grid::-webkit-scrollbar,
html body #why-us-journey .qd-journey-nodes-grid::-webkit-scrollbar { display: none; }

/* slide widths: one main card + a peek of the next one */
html body #ai-center-home .qd-ai-grid > *,
html body #feasibility-growth .qd-feas-dashboard-grid > *,
html body #portfolio-preview .home-port-grid > *,
html body #knowledge-library-home .qkl-home-entry__grid > * {
  flex: 0 0 84% !important; max-width: 84% !important; min-width: 0 !important;
  scroll-snap-align: center; margin: 0 !important;
}
html body #how-we-work .qd-workflow-stages-grid > *,
html body #why-us-journey .qd-journey-nodes-grid > * {
  flex: 0 0 72% !important; max-width: 72% !important; min-width: 0 !important;
  scroll-snap-align: center; margin: 0 !important;
}
html body #feasibility-growth .qd-feas-timeline-track > * {
  flex: 0 0 42% !important; max-width: 42% !important; min-width: 0 !important;
  scroll-snap-align: start; margin: 0 !important;
}
/* Cards that fade in on scroll would stay hidden when they sit off-screen to the side */
html body #ai-center-home .qd-ai-grid > .fade-up,
html body #portfolio-preview .home-port-grid > .fade-up,
html body #knowledge-library-home .qkl-home-entry__grid > *,
html body #how-we-work .qd-workflow-stages-grid > *,
html body #why-us-journey .qd-journey-nodes-grid > *,
html body #feasibility-growth .qd-feas-dashboard-grid > * { opacity: 1 !important; transform: none !important; }
/* Decorative connector lines drawn for the desktop layout */
html body #why-us-journey .qd-journey-track-wrap > svg,
html body #how-we-work .qd-workflow-track-wrap > svg,
html body #feasibility-growth .qd-feas-timeline-wrap > svg { display: none !important; }

/* Arrows + dots under each rail (added by qd-home-mobile.js) */
.qd-m-ctrl { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 8px; }
.qd-m-arrow {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 50%; border: 1.5px solid rgba(224,92,42,.65); background: transparent; color: #E05C2A;
  transition: background .15s, color .15s, opacity .15s; -webkit-tap-highlight-color: transparent;
}
.qd-m-arrow--right svg { transform: scaleX(-1); }
.qd-m-arrow:active, .qd-m-arrow:hover { background: #E05C2A; color: #fff; }
.qd-m-arrow:focus-visible { outline: 2px solid #E05C2A; outline-offset: 2px; }
.qd-m-arrow:disabled { opacity: .3; cursor: default; background: transparent; color: #E05C2A; }
.qd-m-dots { display: flex; justify-content: center; gap: 6px; margin: 0; }
.qd-m-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 10px; background: rgba(128,140,155,.45); transition: width .2s, background .2s; cursor: pointer; }
.qd-m-dots button.is-active { width: 20px; background: #E05C2A; }
.qd-m-dots button:focus-visible { outline: 2px solid #E05C2A; outline-offset: 2px; }

/* ---------- 1. Q-DASH GOALS: compact hub + 2-column goal grid ---------- */
html body #goals-navigator .qd-goals-board {
  display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important;
  height: auto !important; min-height: 0 !important; padding: 0 !important; margin-top: 4px !important;
}
html body #goals-navigator .qd-goals-board > svg { display: none !important; }
html body #goals-navigator .qd-goals-col { display: contents !important; }
html body #goals-navigator .qd-goals-center {
  grid-column: 1 / -1; order: -1; position: relative !important;
  width: 100% !important; height: 150px !important; min-height: 0 !important; margin: 0 0 4px !important;
  display: flex !important; align-items: center !important; justify-content: center !important; overflow: visible !important;
  opacity: 1 !important; transform: none !important;
}
html body #goals-navigator .qd-goals-radar-wrap { transform: scale(.62) !important; transform-origin: center center !important; margin: 0 !important; }
/* Goal order 01 02 / 03 04 / 05 06 (desktop columns hold 01-03-05 and 02-04-06) */
html body #goals-navigator .qd-goals-col-left > :nth-child(1) { order: 1; }
html body #goals-navigator .qd-goals-col-right > :nth-child(1) { order: 2; }
html body #goals-navigator .qd-goals-col-left > :nth-child(2) { order: 3; }
html body #goals-navigator .qd-goals-col-right > :nth-child(2) { order: 4; }
html body #goals-navigator .qd-goals-col-left > :nth-child(3) { order: 5; }
html body #goals-navigator .qd-goals-col-right > :nth-child(3) { order: 6; }
/* short signal lines from the hub to the grid */
html body #goals-navigator .qd-goals-center::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 14px;
  border: 1.5px dashed rgba(224,92,42,.55); border-bottom: 0; border-radius: 12px 12px 0 0; pointer-events: none;
}
html body #goals-navigator .qd-goal-card {
  min-height: 150px !important; height: auto !important; padding: 12px !important; gap: 6px !important;
  margin: 0 !important; width: auto !important; max-width: none !important; border-radius: 14px !important;
  display: flex !important; flex-direction: column !important;
}
html body #goals-navigator .qd-goal-card-top { margin: 0 !important; }
html body #goals-navigator .qd-goal-icon-wrap { width: 34px !important; height: 34px !important; min-width: 34px !important; border-radius: 10px !important; font-size: 15px !important; }
html body #goals-navigator .qd-goal-number { font-size: 13px !important; }
html body #goals-navigator .qd-goal-card-title { font-size: 14px !important; line-height: 1.35 !important; margin: 2px 0 0 !important; }
html body #goals-navigator .qd-goal-card-desc {
  font-size: 12px !important; line-height: 1.5 !important; margin: 0 !important;
  display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden !important;
}
html body #goals-navigator .qd-goal-solutions { display: none !important; }
html body #goals-navigator .qd-goal-card-cta { margin-top: auto !important; font-size: 12px !important; padding-top: 4px !important; }
html body #goals-navigator .qd-goals-metrics-strip { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
html body #goals-navigator .qd-goals-metrics-strip > * { min-width: 0 !important; margin: 0 !important; }

/* ---------- 2. AI CENTER: module cards as a swipe rail ---------- */
html body #ai-center-home .qd-ai-module-card { height: auto !important; }

/* ---------- 3. DIAGNOSTICS: mode chips in one row, check cards side by side ---------- */
html body #business-audit-section .qd-diagnostic-modes {
  flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto !important;
  scrollbar-width: none; gap: 8px !important; padding-bottom: 4px !important; justify-content: flex-start !important;
}
html body #business-audit-section .qd-diagnostic-modes::-webkit-scrollbar { display: none; }
html body #business-audit-section .qd-diagnostic-mode-btn { flex: 0 0 auto !important; width: auto !important; white-space: nowrap !important; }
html body #business-audit-section .qd-diagnostic-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
html body #business-audit-section .qd-diagnostic-grid > svg { display: none !important; }
html body #business-audit-section .qd-diagnostic-side-panel,
html body #business-audit-section .qd-diagnostic-center { grid-column: 1 / -1 !important; }
html body #business-audit-section .qd-diagnostic-center { max-height: none !important; height: auto !important; overflow: visible !important; order: -1; display: flex !important; flex-direction: column !important; align-items: center !important; gap: 0 !important; padding: 0 !important; }
/* radar: keep its real square size, then scale it so rings never cover the title or the button */
html body #business-audit-section .qd-diagnostic-radar {
  width: 270px !important; height: 270px !important; min-height: 270px !important; flex: 0 0 auto !important;
  transform: scale(.74) !important; transform-origin: center center !important;
  margin: -30px auto -30px !important;
}
html body #business-audit-section .qd-diagnostic-action-wrap { margin-top: 6px !important; position: relative !important; z-index: 2 !important; }
html body #business-audit-section .qd-diagnostic-col { min-width: 0 !important; gap: 8px !important; }
html body #business-audit-section .qd-diagnostic-card { min-width: 0 !important; padding: 10px !important; }

/* ---------- 4. SYSTEMS: smaller core, nodes in a 2-column grid ---------- */
html body #systems-showcase .qd-systems-center-canvas { min-height: 0 !important; height: auto !important; padding: 8px 10px 12px !important; flex-direction: column !important; align-items: center !important; justify-content: flex-start !important; gap: 6px !important; }
html body #systems-showcase .qd-systems-center-canvas > svg { display: none !important; }
html body #systems-showcase .qd-systems-core-engine { width: 260px !important; height: 260px !important; min-width: 260px !important; flex: 0 0 auto !important; transform: scale(.62) !important; margin: -48px auto -48px !important; }
html body #systems-showcase .qd-systems-nodes-wrap {
  position: static !important; display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  gap: 8px !important; height: auto !important; width: 100% !important; min-width: 100% !important; max-width: 100% !important; align-self: stretch !important;
}
html body #systems-showcase .qd-systems-node { position: static !important; transform: none !important; width: auto !important; min-width: 0 !important; margin: 0 !important; inset: auto !important; }

/* ---------- 5. FEASIBILITY: timeline + dashboard panels as swipe rails ---------- */
html body #feasibility-growth .qd-feas-dashboard-grid > * { height: auto !important; }

/* ---------- 6. PORTFOLIO: swipe carousel, media first ---------- */
html body #portfolio-preview .home-port-item { height: auto !important; }
html body #portfolio-preview .home-port-item > div:last-child { padding: 14px !important; }
html body #portfolio-preview .home-port-item > div:last-child p {
  display: -webkit-box !important; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden !important;
  font-size: 13px !important; line-height: 1.6 !important; margin-bottom: 8px !important;
}
/* filter buttons: one swipeable row instead of three rows */
html body #portfolio-preview .port-filter-bar {
  flex-wrap: nowrap !important; overflow-x: auto !important; justify-content: flex-start !important;
  scrollbar-width: none; padding-bottom: 4px !important; gap: 6px !important;
}
html body #portfolio-preview .port-filter-bar::-webkit-scrollbar { display: none; }
html body #portfolio-preview .port-filter-btn { flex: 0 0 auto !important; white-space: nowrap !important; }

/* ---------- 7. SMS: metrics and locations in 2 columns ---------- */
html body #sms-campaign-simulator .qd-sms-analytics-bar { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
html body #sms-campaign-simulator .qd-sms-analytics-bar > * { min-width: 0 !important; margin: 0 !important; }
html body #sms-campaign-simulator .qd-sms-analytics-bar > *:last-child:nth-child(odd) { grid-column: 1 / -1; }
html body #sms-campaign-simulator .qd-sms-locations-col { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; height: auto !important; }

/* ---------- 9. WORKFLOW / 10. WHY US: swipe timelines + 2x2 impact ---------- */
html body #why-us-journey .qd-journey-impact-bar { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
html body #why-us-journey .qd-journey-impact-item { flex-direction: column !important; align-items: flex-start !important; text-align: start !important; min-width: 0 !important; padding: 12px !important; gap: 8px !important; }
html body #why-us-journey .qd-journey-track-wrap { height: auto !important; min-height: 0 !important; }

/* ---------- 11. FAQ: decorative visual hidden, trust items 2x2 ---------- */
html body #faq-experience .qd-faq-visual-wrap { display: none !important; }
html body #faq-experience .qd-faq-trust-strip { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
html body #faq-experience .qd-faq-trust-item { flex-direction: column !important; align-items: flex-start !important; text-align: start !important; min-width: 0 !important; padding: 12px !important; gap: 8px !important; }

/* ---------- Section side rail: thin dots at the edge instead of numbered circles ---------- */
html body .qd-global-rail { width: 14px !important; padding: 6px 0 !important; left: 2px !important; right: auto !important; background: transparent !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; }
html[dir="ltr"] body .qd-global-rail, body.en .qd-global-rail { left: auto !important; right: 2px !important; }
html body .qd-global-rail__track { display: none !important; }
html body .qd-global-rail__links { width: 14px !important; gap: 7px !important; align-items: center !important; }
html body .qd-global-rail__links a { width: 7px !important; height: 7px !important; min-width: 0 !important; padding: 0 !important; border-radius: 10px !important; background: rgba(140,150,165,.55) !important; border: 0 !important; box-shadow: none !important; font-size: 0 !important; opacity: .85; }
html body .qd-global-rail__links a.is-active { height: 18px !important; background: #E05C2A !important; opacity: 1; }
html body .qd-global-rail__links a span, html body .qd-global-rail__label { display: none !important; }
html body .qd-global-rail > :not(.qd-global-rail__track):not(.qd-global-rail__links) { transform: scale(.7); transform-origin: center; }

/* ---------- Floating buttons: smaller, never on top of content ---------- */
html body .qd-float-wa { width: 46px !important; height: 46px !important; bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
html body #qda-root { transform: scale(.72) !important; transform-origin: bottom right !important; }
html[dir="ltr"] body #qda-root, body.en #qda-root { transform-origin: bottom left !important; }

} /* end mobile */

/* Small phones */
@media (max-width: 359px) {
  html body #goals-navigator .qd-goal-card { padding: 10px !important; }
  html body #goals-navigator .qd-goal-card-title { font-size: 13px !important; }
  html body #business-audit-section .qd-diagnostic-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  html body [class*="qd-"] { scroll-behavior: auto !important; }
}
