/* CalcuTools mobile quality layer | 5 Nov 2026
   Page-scoped overrides only. Desktop layouts are intentionally unchanged. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body.ct-home-v2, body.ct-nutrition-v3, body.ct-age-calculator-page,
body.ct-partner-page, body.ct-contact-page { min-width: 320px; }
body.ct-home-v2, body.ct-nutrition-v3, body.ct-age-calculator-page,
body.ct-partner-page, body.ct-contact-page { overflow-x: clip; }
body.ct-home-v2 *, body.ct-nutrition-v3 *, body.ct-age-calculator-page *,
body.ct-partner-page *, body.ct-contact-page * { min-width: 0; }

/* Homepage: two compact navigation rows, visible section links, searchable hero. */
@media (max-width: 760px) {
  body.ct-home-v2 .ct-home-nav { position: sticky; top: 0; z-index: 1400; }
  body.ct-home-v2 .ct-home-nav-in {
    width: calc(100% - 24px) !important; min-height: 0 !important;
    padding: 8px 0 0 !important; display: flex !important; flex-wrap: wrap !important;
    align-items: center !important; gap: 8px !important;
  }
  body.ct-home-v2 .ct-home-nav .ct-brand { order: 1; flex: 0 0 auto; font-size: 18px !important; }
  body.ct-home-v2 .ct-home-nav .ct-brand img { width: 32px !important; height: 32px !important; }
  body.ct-home-v2 .ct-home-actions { order: 2; margin-left: auto !important; gap: 6px !important; }
  body.ct-home-v2 .ct-home-actions .ct-home-btn { min-width: 40px; min-height: 40px; padding: 8px 10px !important; }
  body.ct-home-v2 .ct-home-links {
    display: flex !important; order: 3; flex: 1 0 100%; width: 100%;
    margin: 0 !important; padding: 0 0 8px !important; gap: 6px !important;
    overflow-x: auto !important; overflow-y: hidden !important; white-space: nowrap !important;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  body.ct-home-v2 .ct-home-links::-webkit-scrollbar { display: none; }
  body.ct-home-v2 .ct-home-links a {
    flex: 0 0 auto; min-height: 38px; display: inline-flex !important;
    align-items: center; padding: 7px 11px !important; border-radius: 999px;
    background: rgba(37,99,235,.06); border: 1px solid rgba(100,116,139,.18);
    font-size: 12px !important; font-weight: 750; text-decoration: none;
  }
  body.ct-home-v2 .ct-home-hero { padding: 28px 0 24px !important; }
  body.ct-home-v2 .ct-home-hero-in {
    width: calc(100% - 28px) !important; max-width: 700px !important;
    display: grid !important; grid-template-columns: minmax(0,1fr) !important;
    gap: 18px !important;
  }
  body.ct-home-v2 .ct-home-hero h1 { font-size: clamp(34px, 9vw, 46px) !important; line-height: 1.04 !important; letter-spacing: -.045em !important; }
  body.ct-home-v2 .ct-home-hero p { font-size: 15px !important; line-height: 1.55 !important; }
  body.ct-home-v2 .ct-home-kicker { gap: 6px !important; flex-wrap: wrap !important; }
  body.ct-home-v2 .ct-home-search { width: 100% !important; }
  body.ct-home-v2 .ct-home-search-row { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 8px !important; }
  body.ct-home-v2 .ct-home-search-row input,
  body.ct-home-v2 .hero-search-btn { width: 100% !important; min-height: 50px !important; font-size: 16px !important; }
  body.ct-home-v2 .ct-home-hero-note { line-height: 1.5 !important; font-size: 11px !important; }
  body.ct-home-v2 .ct-hero-panel { width: 100% !important; max-width: none !important; padding: 16px !important; }
  body.ct-home-v2 .ct-home-hero-partner { margin-top: 12px; display: grid; gap: 4px; }
  body.ct-home-v2 .ct-home-hero-partner a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 46px; padding: 11px 14px; border-radius: 12px;
    background: #eaf2ff; border: 1px solid #c7dcff; color: #174ea6;
    font-size: 13px; line-height: 1.35; font-weight: 800; text-decoration: none;
  }
  body.ct-home-v2 .ct-home-hero-partner small { color: #64748b; font-size: 11px; line-height: 1.45; }
  body.ct-home-v2 .ct-section { padding-top: 28px !important; padding-bottom: 28px !important; }
  body.ct-home-v2 .ct-section-in { width: calc(100% - 28px) !important; }
  body.ct-home-v2 .ct-section-head h2 { font-size: clamp(21px, 6vw, 28px) !important; line-height: 1.18 !important; }
  body.ct-home-v2 .ct-category, body.ct-home-v2 .ct-popular a,
  body.ct-home-v2 .ct-trust-box { min-height: 0 !important; padding: 15px !important; }
  body.ct-home-v2 .ct-home-footer-in { width: calc(100% - 28px) !important; }
}
@media (max-width: 420px) {
  body.ct-home-v2 .ct-home-actions .ct-home-btn:not(.primary) { display: none !important; }
  body.ct-home-v2 .ct-home-hero h1 { font-size: 35px !important; }
  body.ct-home-v2 .ct-grid-6,
  body.ct-home-v2 .ct-grid-4,
  body.ct-home-v2 .ct-popular,
  body.ct-home-v2 .ct-trust-grid { grid-template-columns: minmax(0,1fr) !important; }
}

/* Nutrition workspace: thumb-friendly search, tabs, portions and meal controls. */
@media (max-width: 760px) {
  body.ct-nutrition-v3 .ct-nutrition-hero { width: calc(100% - 24px) !important; margin-left: auto !important; margin-right: auto !important; padding: 18px 0 10px !important; }
  body.ct-nutrition-v3 .ct-nutrition-hero h1 { font-size: clamp(27px, 7.6vw, 35px) !important; line-height: 1.08 !important; }
  body.ct-nutrition-v3 .ct-nutrition-hero p { font-size: 14px !important; line-height: 1.55 !important; }
  body.ct-nutrition-v3 #main-content { width: calc(100% - 20px) !important; max-width: 720px !important; padding: 10px 0 32px !important; }
  body.ct-nutrition-v3 .ct-nutrition-tabs {
    position: sticky !important; top: 60px !important; z-index: 1100 !important;
    display: flex !important; flex-wrap: nowrap !important; gap: 7px !important;
    overflow-x: auto !important; overflow-y: hidden !important; padding: 7px !important;
    margin: 0 0 12px !important; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  body.ct-nutrition-v3 .ct-nutrition-tabs::-webkit-scrollbar { display:none; }
  body.ct-nutrition-v3 .ct-nutrition-tabs .task-link {
    flex: 0 0 auto !important; min-width: max-content !important; min-height: 42px !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    padding: 9px 12px !important; scroll-snap-align: start; white-space: nowrap;
    font-size: 12px !important;
  }
  body.ct-nutrition-v3 .ct-howto { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 7px !important; margin: 0 0 12px !important; }
  body.ct-nutrition-v3 .ct-howto-step { min-height: 54px !important; padding: 9px !important; gap: 7px !important; }
  body.ct-nutrition-v3 .ct-nutrition-workspace { grid-template-columns: minmax(0,1fr) !important; gap: 12px !important; }
  body.ct-nutrition-v3 .ct-food-search-panel,
  body.ct-nutrition-v3 .ct-food-detail-panel,
  body.ct-nutrition-v3 .ct-summary-card,
  body.ct-nutrition-v3 .ct-quick-card,
  body.ct-nutrition-v3 .ct-meal-card,
  body.ct-nutrition-v3 .ct-bmr-card,
  body.ct-nutrition-v3 .ct-goal-card { padding: 14px !important; border-radius: 15px !important; }
  body.ct-nutrition-v3 .search-wrap input { width: 100% !important; min-height: 48px !important; font-size: 16px !important; }
  body.ct-nutrition-v3 .ct-result-meta-row { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 8px !important; }
  body.ct-nutrition-v3 .ct-live-search-btn { width: 100% !important; min-height: 46px !important; }
  body.ct-nutrition-v3 .cat-tabs { display: flex !important; flex-wrap: nowrap !important; gap: 7px !important; overflow-x: auto !important; padding: 3px 0 8px !important; scrollbar-width: none; }
  body.ct-nutrition-v3 .cat-tabs button { flex: 0 0 auto !important; min-height: 40px !important; white-space: nowrap; }
  body.ct-nutrition-v3 .food-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; max-height: 52vh !important; overflow-y: auto !important; }
  body.ct-nutrition-v3 .food-chip { min-width: 0 !important; min-height: 88px !important; padding: 9px !important; }
  body.ct-nutrition-v3 .food-main-hit { min-width: 0 !important; }
  body.ct-nutrition-v3 .food-row-actions { display: flex !important; gap: 6px !important; }
  body.ct-nutrition-v3 .food-row-actions button { min-height: 40px !important; flex: 1 1 0 !important; }
  body.ct-nutrition-v3 .macro-grid,
  body.ct-nutrition-v3 .bmr-results,
  body.ct-nutrition-v3 .meal-total { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  body.ct-nutrition-v3 .macro-box,
  body.ct-nutrition-v3 .bmr-box,
  body.ct-nutrition-v3 .meal-total > * { min-width: 0 !important; padding: 11px 9px !important; }
  body.ct-nutrition-v3 .macro-val,
  body.ct-nutrition-v3 .bmr-val { font-size: clamp(19px,6vw,24px) !important; overflow-wrap: anywhere; }
  body.ct-nutrition-v3 .qty-row,
  body.ct-nutrition-v3 .ct-add-controls { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  body.ct-nutrition-v3 .qty-row input,
  body.ct-nutrition-v3 .ct-add-controls input,
  body.ct-nutrition-v3 .ct-add-controls select { width: 100% !important; min-width: 0 !important; min-height: 46px !important; font-size: 16px !important; }
  body.ct-nutrition-v3 .add-btn,
  body.ct-nutrition-v3 .bmr-btn,
  body.ct-nutrition-v3 .goal-calc-btn { width: 100% !important; min-height: 48px !important; }
  body.ct-nutrition-v3 .ct-meal-targetbar { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 9px !important; }
  body.ct-nutrition-v3 .ct-target-controls { display: grid !important; grid-template-columns: minmax(0,1fr) !important; width: 100% !important; gap: 8px !important; }
  body.ct-nutrition-v3 .ct-target-controls input,
  body.ct-nutrition-v3 .ct-target-controls button { width: 100% !important; min-height: 44px !important; }
  body.ct-nutrition-v3 .ct-goal-form,
  body.ct-nutrition-v3 .input-grid-2 { grid-template-columns: minmax(0,1fr) !important; gap: 10px !important; }
  body.ct-nutrition-v3 .related-grid,
  body.ct-nutrition-v3 .ct-sprint2-grid,
  body.ct-nutrition-v3 .ct-growth-grid,
  body.ct-nutrition-v3 .ctg-related-grid { grid-template-columns: minmax(0,1fr) !important; }
  body.ct-nutrition-v3 .ct-original-guide { width: calc(100% - 24px) !important; padding: 0 !important; margin: 20px auto !important; }
  body.ct-nutrition-v3 .ct-original-guide > div { padding: 16px !important; }
}
@media (max-width: 390px) {
  body.ct-nutrition-v3 .food-grid { grid-template-columns: minmax(0,1fr) !important; }
  body.ct-nutrition-v3 .ct-howto { grid-template-columns: minmax(0,1fr) !important; }
  body.ct-nutrition-v3 .qty-row,
  body.ct-nutrition-v3 .ct-add-controls { grid-template-columns: minmax(0,1fr) !important; }
}

/* Age calculator: readable form, predictable result cards, safe long text. */
@media (max-width: 760px) {
  body.ct-age-calculator-page #main-content { width: calc(100% - 24px) !important; padding: 10px 0 30px !important; }
  body.ct-age-calculator-page .breadcrumb { display: flex !important; flex-wrap: wrap !important; gap: 4px 7px !important; line-height: 1.4 !important; }
  body.ct-age-calculator-page .header-text { margin: 8px 0 12px !important; }
  body.ct-age-calculator-page .header-text h1 { font-size: clamp(27px,7.5vw,35px) !important; line-height: 1.08 !important; }
  body.ct-age-calculator-page .header-text p { font-size: 14px !important; line-height: 1.55 !important; }
  body.ct-age-calculator-page .ct-age-quickpath { gap: 6px !important; }
  body.ct-age-calculator-page .ct-age-quickpath span { font-size: 11px !important; }
  body.ct-age-calculator-page .ct-age-eligibility-mobile-note { margin: 10px 0 12px; padding: 12px 13px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; border-radius: 12px; font-size: 12px; line-height: 1.55; }
  body.ct-age-calculator-page .ct-sprint2-intro { padding: 12px 13px !important; margin: 10px 0 12px !important; font-size: 12px !important; line-height: 1.55 !important; }
  body.ct-age-calculator-page .calc-card { padding: 14px !important; border-radius: 15px !important; }
  body.ct-age-calculator-page .calc-card .input-group { margin-bottom: 13px !important; }
  body.ct-age-calculator-page .calc-card input[type="date"],
  body.ct-age-calculator-page .calc-card input[type="number"] { width: 100% !important; max-width: 100% !important; min-height: 48px !important; font-size: 16px !important; }
  body.ct-age-calculator-page .calc-card .btn { width: 100% !important; min-height: 49px !important; font-size: 15px !important; }
  body.ct-age-calculator-page .calc-card .result-grid { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  body.ct-age-calculator-page .calc-card .result-metric { min-width: 0 !important; padding: 11px !important; overflow-wrap: anywhere !important; }
  body.ct-age-calculator-page .calc-card .metric-label { font-size: 11px !important; line-height: 1.35 !important; }
  body.ct-age-calculator-page .calc-card .metric-val { font-size: clamp(18px,5vw,23px) !important; line-height: 1.2 !important; overflow-wrap: anywhere !important; }
  body.ct-age-calculator-page .ct-top10-action-row { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 8px !important; }
  body.ct-age-calculator-page .ct-top10-action-row button,
  body.ct-age-calculator-page #explainBox > button,
  body.ct-age-calculator-page .calc-card > button[onclick="downloadResultCard()"] { width: 100% !important; min-height: 46px !important; }
  body.ct-age-calculator-page .ct-seo-links-grid { grid-template-columns: minmax(0,1fr) !important; }
  body.ct-age-calculator-page .seo-article { padding: 15px !important; margin: 14px 0 !important; }
  body.ct-age-calculator-page .ct-original-guide { width: calc(100% - 24px) !important; padding: 0 !important; margin: 18px auto !important; }
  body.ct-age-calculator-page .ct-original-guide > div { padding: 16px !important; }
}
@media (max-width: 380px) {
  body.ct-age-calculator-page .calc-card .result-grid { grid-template-columns: minmax(0,1fr) !important; }
}

/* Partner page: mobile-first stack, horizontal nav, embedded demo containment. */
body.ct-partner-page .wrap { width: min(1100px, calc(100% - 36px)); }
body.ct-partner-page .ct-partner-nav { flex-wrap: wrap; }
body.ct-partner-page .ct-partner-nav .navlinks { align-items: center; }
body.ct-partner-page .card { min-width: 0; overflow: hidden; }
body.ct-partner-page iframe { display: block; width: 100% !important; max-width: 100% !important; border: 0; }
body.ct-partner-page .cta { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 760px) {
  body.ct-partner-page .wrap { width: calc(100% - 24px) !important; padding: 14px 0 36px !important; }
  body.ct-partner-page .ct-partner-nav { align-items: flex-start !important; gap: 8px !important; padding: 8px 0 16px !important; }
  body.ct-partner-page .ct-partner-nav .brand { font-size: 19px !important; }
  body.ct-partner-page .ct-partner-nav .navlinks { width: 100% !important; display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 8px !important; padding: 2px 0 7px !important; white-space: nowrap; scrollbar-width: none; }
  body.ct-partner-page .ct-partner-nav .navlinks::-webkit-scrollbar { display:none; }
  body.ct-partner-page .ct-partner-nav .navlinks a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 12px; }
  body.ct-partner-page .hero { padding: 19px !important; border-radius: 16px !important; }
  body.ct-partner-page .hero h1 { font-size: clamp(29px,8vw,37px) !important; line-height: 1.08 !important; }
  body.ct-partner-page .hero .lead { font-size: 14px !important; line-height: 1.6 !important; }
  body.ct-partner-page .grid { grid-template-columns: minmax(0,1fr) !important; gap: 12px !important; }
  body.ct-partner-page .card { padding: 15px !important; border-radius: 14px !important; }
  body.ct-partner-page .cta { width: 100% !important; margin: 6px 0 !important; padding: 12px 14px !important; text-align: center; }
  body.ct-partner-page footer { line-height: 1.6; font-size: 12px; }
}

/* Contact: single-column form and large touch targets. */
@media (max-width: 760px) {
  body.ct-contact-page .hero { width: calc(100% - 24px) !important; margin: 12px auto 10px !important; padding: 19px !important; border-radius: 16px !important; }
  body.ct-contact-page .hero h1 { font-size: clamp(27px,7vw,35px) !important; line-height: 1.1 !important; }
  body.ct-contact-page .hero p { font-size: 14px !important; line-height: 1.55 !important; }
  body.ct-contact-page #main-content .container { width: calc(100% - 24px) !important; padding: 8px 0 30px !important; }
  body.ct-contact-page #main-content .grid { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 12px !important; }
  body.ct-contact-page #main-content .card { padding: 15px !important; border-radius: 15px !important; }
  body.ct-contact-page #main-content input,
  body.ct-contact-page #main-content select { min-height: 48px !important; font-size: 16px !important; }
  body.ct-contact-page #main-content textarea { min-height: 130px !important; font-size: 16px !important; }
  body.ct-contact-page #main-content .submit-btn { width: 100% !important; min-height: 49px !important; }
  body.ct-contact-page .contact-info { overflow-wrap: anywhere; }
}

/* General mobile safety and accessible tap areas. */
@media (max-width: 760px) {
  body.ct-home-v2 a, body.ct-nutrition-v3 a, body.ct-age-calculator-page a,
  body.ct-partner-page a, body.ct-contact-page a,
  body.ct-home-v2 button, body.ct-nutrition-v3 button,
  body.ct-age-calculator-page button, body.ct-partner-page button,
  body.ct-contact-page button { -webkit-tap-highlight-color: rgba(37,99,235,.12); }
  body.ct-home-v2 img, body.ct-nutrition-v3 img, body.ct-age-calculator-page img,
  body.ct-partner-page img, body.ct-contact-page img { max-width: 100%; height: auto; }
  body.ct-home-v2 table, body.ct-nutrition-v3 table, body.ct-age-calculator-page table,
  body.ct-partner-page table, body.ct-contact-page table { display: block; max-width: 100%; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  body.ct-home-v2 *, body.ct-nutrition-v3 *, body.ct-age-calculator-page *,
  body.ct-partner-page *, body.ct-contact-page * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
