/* Tuotu Astro-projektista: src/styles/mobile/type-system.css (bin/sync-astro.py). */
/* Shared phone typography, based on the approved homepage scale.
   Named roles cover Site's service, guide, article, archive and pricing pages.
   Important declarations in this layer outrank legacy unlayered !important rules
   without escalating selector specificity. Desktop and navigation stay untouched.
   Do not set a font on main itself: embedded demos must keep their own inheritance. */
@layer mobile-type-system {
  @media (max-width: 640px) {
    :root {
      --mobile-copy-font: 'Source Sans 3 Variable', 'Source Sans 3', sans-serif;
      --mobile-heading-font: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    }

    /* Reading text only. Preserve prices, counters and widget typography. */
    main :where(p, li, blockquote, td, th, .wp-prose dd, .article-body dd):not(:where(
      nav *, .toc *, .article-toc *, .guide-toc *, .wp-toc *,
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *,
      .salary-figures *, .service-offer-figures *, .case-figure *,
      .logo-wall *, .logo-strip *, svg *, pre *, code *,
      .pricing-price, .service-offer-price, .offer-price, .section-price,
      .avs-price, .home-offer-price, .booking-path-price, .est-amount,
      .jss-offer-price, .mig-offer-price, .wps-offer-price, .fp-path-price,
      .aeo-hero-fact-figure,
      .est-fig, .ref-show-stat, .case-card-value, .price, .amount,
      .stat, .metric, .kpi, .value
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-copy-font) !important;
      font-size: 15px !important;
      font-weight: 400 !important;
      line-height: 1.6 !important;
    }

    main th:not(:where(
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-weight: 700 !important;
    }

    /* H1 and H2 remain chapter-level headings; cards use the smaller H3 scale. */
    main :where(h1, h2, h3, h4, h5, h6, .wp-card-title,
      .contact-band-heading, .case-figures-title, .service-offer-name, .offer-name,
      .jss-offer-name, .mig-offer-name, .wps-offer-name, .fp-path-name
    ):not(:where(
      nav *, .toc *, .article-toc *, .guide-toc *, .wp-toc *,
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *, pre *, code *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      max-width: 100% !important;
      font-family: var(--mobile-heading-font) !important;
      font-weight: 700 !important;
      overflow-wrap: anywhere;
    }

    main h1:not(:where(
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-size: clamp(26px, 7.5vw, 32px) !important;
      line-height: 1.15 !important;
      letter-spacing: -0.01em !important;
    }

    main :where(h2, .contact-band-heading, .case-figures-title, .feature-row-title, .service-section-heading):not(:where(
      nav *, .toc *, .article-toc *, .guide-toc *, .wp-toc *,
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-size: 24px !important;
      line-height: 1.2 !important;
      letter-spacing: -0.01em !important;
    }

    main :where(h3, h4, h5, h6, .wp-card-title, .fp-path-name):not(:where(
      .feature-row-title, .service-section-heading, nav *, .toc *, .article-toc *, .guide-toc *, .wp-toc *,
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-size: 17px !important;
      line-height: 1.3 !important;
      letter-spacing: 0 !important;
    }

    /* Card links must inherit the heading rather than their legacy link font. */
    main :where(h1, h2, h3, h4, h5, h6, .wp-card-title) > a:not(:where(
      nav *, .toc *, .article-toc *, .guide-toc *, .wp-toc *,
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: inherit !important;
      font-size: inherit !important;
      font-weight: inherit !important;
      line-height: inherit !important;
      letter-spacing: inherit !important;
    }

    main :where(h1, h2, h3, h4, h5, h6, .wp-card-title) > span:not(:where(
      .case-card-value, .stat, .metric, .kpi, .value,
      nav *, .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: inherit !important;
    }

    main summary:not(:where(
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-heading-font) !important;
      font-size: 17px !important;
      font-weight: 700 !important;
      line-height: 1.3 !important;
      letter-spacing: 0 !important;
    }

    /* Standalone offer names and the featured beginner guide are one step larger. */
    main :where(.service-offer-name, .offer-name, .section-offer h3, .avs-offer h3,
      .home-guides-start h3, .jss-offer-name, .mig-offer-name, .wps-offer-name
    ):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-heading-font) !important;
      font-size: 20px !important;
      font-weight: 700 !important;
      line-height: 1.25 !important;
      letter-spacing: 0 !important;
    }

    main :where(.lede, .wp-lede, .service-section-lede, .salary-lede,
      .article-subtitle, .split-hero-lede, .svc-cell-lede, .ukk-lede,
      .service-hero-text > h3:first-child
    ):not(:where(
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-copy-font) !important;
      font-size: 18px !important;
      font-weight: 300 !important;
      line-height: 1.4 !important;
      letter-spacing: 0 !important;
    }

    /* Supporting copy stays subordinate to the 15px reading text. */
    main :where(small, figcaption, .muted, .section-note, .home-offer-budget,
      .service-hero-fine, .service-hero-note, .pricing-hero-fine, .wp-booking-note,
      .seo-hero-note, .split-hero-note, .jss-offer-unit, .jss-offer-terms,
      .jss-offer-custom, .mig-offer-fine, .wps-offer-fine,
      .service-offer-unit, .service-offer-terms, .service-offer-custom,
      .offer-unit, .offer-custom, .offer-extra, .pricing-footnote,
      .pricing-tier-footnote, .compare-table-note, .download-note,
      .home-services-count, .home-guides-facts dt, .home-guides-facts dd,
      .agent-form-hint, .agent-form-note, .agent-form-error,
      .wp-byline p, .wp-dateline, .data-updated, .article-author-credit
    ):not(:where(
      .lede, .wp-lede, .service-section-lede, .salary-lede,
      .article-subtitle, .split-hero-lede, .svc-cell-lede, .ukk-lede,
      .service-hero-text > h3:first-child,
      nav *, .toc *, .article-toc *, .guide-toc *, .wp-toc *,
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *,
      .salary-figures *, .service-offer-figures *, .case-figure *,
      .logo-wall *, .logo-strip *, svg *, pre *, code *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-copy-font) !important;
      font-size: 14px !important;
      line-height: 1.5 !important;
    }

    /* Category labels keep their existing casing and colour. */
    main :where(.eyebrow, .icon-card-label, .home-card-label, .home-guides-eyebrow,
      .service-offer-strip, .offer-label, .avs-offer-label, .contact-band-label,
      .service-hero-label, .pricing-badge, .article-meta, .post-meta, .download-meta
    ):not(:where(
      nav *, .toc *, .article-toc *, .guide-toc *, .wp-toc *,
      .gd *, .opt *, .ai-demo *, .aic *, .quiz *, .est-ui *,
      .ref-show *, .chart *, .unemp-chart *, .calculator *, svg *
    )):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-copy-font) !important;
      font-size: 13px !important;
      font-weight: 600 !important;
      line-height: 1.5 !important;
      letter-spacing: 0.04em !important;
    }

    /* Static monthly offers share the homepage price scale. Calculator results,
       pricing-tier figures and case metrics deliberately retain their own scale. */
    main :where(.service-offer-price, .offer-price, .section-price, .avs-price,
      .jss-offer-price, .mig-offer-price, .wps-offer-price
    ):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: 'Mona Sans', sans-serif !important;
      font-size: 40px !important;
      font-weight: 300 !important;
      line-height: 1 !important;
      letter-spacing: -0.03em !important;
    }

    main :where(.service-offer-price, .offer-price, .section-price, .avs-price,
      .jss-offer-price, .mig-offer-price, .wps-offer-price
    ) > :where(span, small):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-size: 15px !important;
      line-height: 1.4 !important;
      letter-spacing: 0 !important;
    }

    /* PriceEstimator is now a static offer/form. Opt its reading roles in without
       flattening its amounts, historic statistics or form-control typography. */
    main .est-ui .est-name:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-heading-font) !important;
      font-size: 20px !important;
      font-weight: 700 !important;
      line-height: 1.25 !important;
      letter-spacing: 0 !important;
    }

    main .est-ui :where(.est-pitch, .est-includes li, .est-includes strong, .est-includes span):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-copy-font) !important;
      font-size: 15px !important;
      line-height: 1.6 !important;
    }

    main .est-ui :where(.est-unit, .est-fine, .est-note, .est-extra):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
      font-family: var(--mobile-copy-font) !important;
      font-size: 14px !important;
      line-height: 1.5 !important;
    }
  }
}
