/* Loaded after the desktop theme, only at widths up to 900px. */
@media (max-width: 900px) {
    :root { --mobile-gutter: 20px; --mobile-section: 48px; }
    body { -webkit-text-size-adjust: 100%; }
    .page-home .site-page-shell { width: 100%; min-width: 0; zoom: 1; }
    .site-header, .page-home .site-header { height: 68px; }
    .header-inner, .page-home .header-inner { width: calc(100% - 32px); padding: 0; gap: 12px; }
    .site-brand, .page-home .site-brand { width: auto; min-width: 0; height: auto; }
    .site-brand-tagline { width: auto; }
    .site-brand-tagline strong { font-size: 11px; letter-spacing: 0; }
    .site-brand-tagline small { font-size: 8px; letter-spacing: 0; }
    .site-brand-separator { margin-inline: 8px; }
    .nav-toggle, .page-home .nav-toggle { display: grid; flex: 0 0 44px; width: 44px; height: 44px; }
    .primary-nav, .page-home .primary-nav {
        position: absolute; top: 68px; right: 0; left: 0; width: 100%; height: auto;
        max-height: calc(100dvh - 68px); padding: 12px 20px 24px; display: none;
        grid-template-columns: minmax(0, 1fr); gap: 0; overflow-y: auto;
        overscroll-behavior: contain; background: #fff; box-shadow: 0 18px 30px rgba(15,24,36,.14);
    }
    .primary-nav.is-open, .page-home .primary-nav.is-open { display: grid; }
    .nav-group, .page-home .nav-group { height: auto; transform: none; }
    .primary-nav > .nav-link:first-child { transform: none; }
    .nav-link, .page-home .nav-link, .page-home .nav-group > .nav-link {
        width: 100%; min-height: 48px; height: auto; padding: 10px 4px;
        justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 16px;
    }
    .nav-link.is-active, .page-home .nav-link.is-active { color: var(--nav-accent); }
    .nav-dropdown, .page-home .nav-dropdown,
    .nav-group[open] .nav-dropdown, .nav-group:focus-within .nav-dropdown {
        position: static; width: 100%; transform: none; padding: 4px 0 8px 16px;
        box-shadow: none; opacity: 1; pointer-events: auto;
    }
    .nav-dropdown a { min-height: 44px; justify-content: flex-start; }
    .nav-group > summary .nav-chevron { width: 8px; height: 8px; flex-shrink: 0; color: inherit; border-right: 1px solid; border-bottom: 1px solid; background: none; -webkit-mask: none; mask: none; transform: rotate(45deg); }
    .nav-group[open] > summary .nav-chevron { transform: rotate(225deg); }

    /* One footer layout for every public template, with readable contact links. */
    body[class] .site-footer { height: auto; padding: 40px 0 24px; }
    body[class] .footer-grid.site-container, body[class] .footer-legal.site-container { width: calc(100% - 2 * var(--mobile-gutter)); }
    body[class] .footer-grid { height: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
    body[class] .footer-identity, body[class] .footer-benefits, body[class] .footer-qrs,
    body[class] .footer-brand, body[class] .footer-identity > a:not(.footer-brand) { position: static; width: auto; height: auto; }
    body[class] .footer-identity { display: grid; gap: 8px; }
    body[class] .footer-brand { width: 178px; height: 54px; margin: 0 0 8px; }
    body[class] .footer-identity > a:not(.footer-brand) { min-height: 36px; white-space: normal; overflow-wrap: anywhere; }
    body[class] .footer-benefits h2 { height: auto; margin-bottom: 20px; font-size: 22px; }
    body[class] .footer-benefits ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; font-size: 14px; }
    body[class] .footer-benefits li { height: auto; white-space: normal; }
    body[class] .footer-qrs { grid-column: 1 / -1; justify-content: flex-start; gap: 24px; }
    body[class] .footer-qrs figure { width: min(136px, calc((100% - 24px) / 2)); }
    body[class] .footer-qrs img { width: 100%; height: auto; aspect-ratio: 1; }
    body[class] .footer-qrs figcaption { height: auto; margin-top: 10px; font-size: 14px; }
    body[class] .footer-legal { height: auto; margin-top: 32px; padding-top: 20px; }
    body[class] .footer-legal p { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }

    /* Homepage artwork reflows independently of the desktop composition. */
    .home-fixed-container { width: calc(100% - 2 * var(--mobile-gutter)); }
    .page-home .home-hero { height: 480px; min-height: 0; }
    .page-home .hero-copy { padding-top: 135px; }
    .page-home .home-hero-title,
    .page-home .home-hero-slide--blue-architecture .home-hero-title,
    .page-home .home-hero-slide--photo-pill .home-hero-title {
        width: 100%; margin: 0; font-size: clamp(30px, 6vw, 48px); line-height: 1.45;
        letter-spacing: .04em; white-space: normal;
    }
    .page-home .home-hero-subtitle,
    .page-home .home-hero-slide--blue-architecture .home-hero-subtitle,
    .page-home .home-hero-slide--photo-pill .home-hero-subtitle {
        width: fit-content; max-width: 100%; height: auto; margin: 20px 0 0;
        font-size: 15px; line-height: 1.8; letter-spacing: .02em; white-space: normal;
    }
    .home-hero-slide--red-geometric .home-hero-background { object-position: 35% center; }
    .home-hero-slide--blue-architecture .home-hero-background { object-position: 25% center; }
    .home-hero-slide--photo-pill .home-hero-background { object-position: 65% center; }
    .home-hero-slide--photo-pill .home-hero-media::after { content: ""; position: absolute; inset: 0; background: rgba(8,24,42,.32); }
    .page-home .home-hero-slide--photo-pill .home-hero-subtitle { padding: 10px 16px; border-radius: 16px; text-align: left; }
    .home-hero-pagination.swiper-pagination { bottom: 10px; height: 44px; gap: 4px; }
    .home-hero-pagination .swiper-pagination-bullet { position: relative; width: 44px; height: 44px; background: transparent; }
    .home-hero-pagination .swiper-pagination-bullet::after { content: ""; position: absolute; inset: 18px 12px; border-radius: 5px; background: rgba(255,255,255,.65); }
    .home-hero-pagination .swiper-pagination-bullet-active::after { inset-inline: 6px; background: #fff; }
    .home-services, .home-company, .home-company-red, .home-company-white, .home-news { height: auto; }
    .home-services, .home-news { padding: var(--mobile-section) 0; }
    .home-services .home-section-heading, .home-news .home-section-heading { width: 100%; padding-top: 0; }
    .home-section-heading h2 { height: auto; font-size: 28px; line-height: 1.4; }
    .home-section-heading p { height: auto; font-size: 15px; white-space: normal; }
    .home-service-grid { margin-top: 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .home-service-card--large, .home-service-card--small { height: auto; grid-column: auto; padding: 16px; border-radius: 18px; }
    .home-service-card--large .home-service-visual, .home-service-card--small .home-service-visual { height: auto; min-height: 230px; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 18px; border-radius: 12px; }
    .home-service-card--large .home-service-visual { min-height: 310px; }
    .home-service-visual .service-logo { position: relative; inset: auto; width: auto; max-width: 100%; height: 54px; flex: 0 0 auto; }
    .home-service-visual .service-visual-title,
    .home-service-visual .service-visual-copy,
    .home-service-visual .service-visual-small-copy { position: relative; inset: auto; width: 100%; margin: 0; text-align: center; white-space: normal; }
    .home-service-visual .service-visual-title { font-size: 21px; line-height: 1.5; letter-spacing: 0; }
    .home-service-visual .service-visual-copy { gap: 8px; }
    .home-service-visual .service-visual-copy strong { font-size: 23px; line-height: 1.45; }
    .home-service-visual .service-visual-copy b { font-size: 16px; line-height: 1.7; }
    .home-service-visual .service-visual-copy small { font-size: 12px; line-height: 1.6; }
    .service-quote { display: none; }
    .home-service-visual .service-visual-small-copy { font-size: 23px; line-height: 1.5; }
    .home-service-visual--cima .service-visual-small-copy small { font-size: 16px; white-space: normal; }
    .home-service-card > h3, .home-service-card--small > h3 { height: auto; margin: 20px 0 0; font-size: 24px; line-height: 1.5; }
    .home-service-card > p, .home-service-card--large > p, .home-service-card--small > p { width: 100%; height: auto; margin: 12px 0 0; font-size: 15px; line-height: 1.8; overflow: visible; }
    .home-service-features { width: 100%; height: auto; margin: 24px 0 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .home-service-features li { grid-template-rows: 48px auto; gap: 8px; font-size: 12px; }
    .home-service-features img { width: 48px; height: 48px; }
    .home-service-card--large > .home-outline-button, .home-service-card > .home-plus-button { position: relative; inset: auto; margin: 24px auto 4px; display: flex; justify-content: center; transform: none; }
    .home-service-card > .home-plus-button { width: 96px; height: 44px; border-radius: 24px; }
    .home-company-red { padding: var(--mobile-section) 0; }
    .home-company-brand-mark { left: auto; right: -45px; top: 20px; transform: scale(.7); transform-origin: top right; }
    .home-company-intro { display: block; padding-top: 0; }
    .home-company-intro > div { position: relative; inset: auto; width: 100%; }
    .home-company-intro h2 { height: auto; font-size: 28px; }
    .home-company-subtitle { width: 100%; height: auto; font-size: 15px; text-align: left; }
    .home-company-body { width: 100%; height: auto; margin: 24px 0 0; font-size: 16px; line-height: 1.9; overflow: visible; }
    .home-company-intro > .home-outline-button { position: relative; inset: auto; margin-top: 24px; }
    .home-company-white { padding: 28px 0 var(--mobile-section); }
    .home-company-photo { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 657 / 518; border-radius: 16px; }
    .home-company-features { position: relative; inset: auto; width: 100%; margin-top: 32px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .home-company-features article { width: 100%; }
    .home-company-features h3 { width: auto; font-size: 15px; }
    .home-news-grid { margin-top: 28px; padding: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 24px; }
    .home-news-item { height: auto; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
    .home-news-image { width: 112px; height: 84px; }
    .home-news-item h3, .home-news-item:first-child h3 { height: auto; overflow: visible; }
    .home-news-item i { width: 100%; margin-block: 12px; }
    .home-news-item p { height: auto; }
    .home-news-more { position: relative; inset: auto; display: flex; margin: 32px auto 0; transform: none; }

    /* Course detail sections must grow with their text and slider content. */
    .aia-about, .aia-certificates, .aia-graduation, .aia-china, .aia-advantages, .aia-global { height: auto; padding-block: var(--mobile-section); }
    .aia-certificate-copy { width: 100%; max-width: none; }
    .aia-certificate-quote { display: none; }
    .aia-certificates { background-size: 100% 100%; }
    .aia-certificate-stage { position: relative; inset: auto; width: calc(100% - 32px); max-width: none; margin: 28px auto 0; transform: none; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
    .aia-certificate-swiper { min-width: 0; width: 100%; }
    .aia-certificate-arrow, .aia-certificate-arrow img { width: 44px; height: 44px; }
    .aia-china-timeline { height: auto; padding: 0; grid-template-columns: 65px minmax(0, 1fr); gap: 16px; overflow: visible; }
    .aia-timeline-year i, .aia-timeline-scroll { display: none; }
    .aia-advantage-grid article { height: auto; min-height: 150px; }
    .aia-advantage-grid p { font-size: 14px; line-height: 1.7; }
    .cima-background { height: auto; padding-block: var(--mobile-section); }
    .cima-background__intro { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .cima-background__intro figure, .cima-background__intro figure img { width: 100%; height: auto; }
    .cima-profile-tabs { height: auto; grid-template-columns: minmax(0, 1fr); }
    .cima-profile-tabs__nav { height: auto; padding: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; gap: 8px; }
    .cima-profile-tabs__nav button { min-height: 48px; font-size: 15px; }
    .cima-profile-tabs__content, .cima-profile-tabs__content article { height: auto; }
    .cima-profile-tabs__content { padding: 24px 0; }
    .cima-profile-stats { height: auto; }
    .cima-profile-stats > div { padding-inline: 8px; }
    .cima-profile-stats strong { font-size: 28px; }
    .cima-hero__cards { max-width: 100%; }
    .cima-competency, .cima-jobs, .cima-competency .service-program-container, .cima-jobs .service-program-container { height: auto; padding-bottom: 32px; }
    .cima-graphic img { height: auto; }
    .ipa-program-grid article, .ipa-network-grid article, .isca-ability-grid article { height: auto; }
    .rich-text { overflow-wrap: anywhere; }
    .rich-text img, .rich-text video, .rich-text iframe { max-width: 100%; height: auto; }
    .rich-text iframe { width: 100%; aspect-ratio: 16 / 9; }
    .rich-text table { display: block; max-width: 100%; overflow-x: auto; }
    .industry-list-card { height: auto; }
    .industry-list-card h2 { white-space: normal; }
    input, textarea, select { max-width: 100%; font-size: 16px; }
    .contact-fields input, .contact-message-field textarea { font-size: 16px; }
    .contact-fields input { min-height: 44px; }
}

@media (max-width: 600px) {
    body[class] .footer-grid { grid-template-columns: minmax(0, 1fr); }
    .home-service-grid { grid-template-columns: minmax(0, 1fr); }
    .home-company-features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .page-home .home-hero { height: 420px; }
    .page-home .hero-copy { padding-top: 110px; }
    .home-hero-slide--red-geometric .home-hero-background { object-position: 24% center; }
    .page-home .hero-copy .home-hero-subtitle[lang="en"] { font-size: 13px; letter-spacing: 0; }
    .cpa-stats article { padding-inline: 10px; }
    .cpa-stats p { white-space: nowrap; }
    .cpa-stats strong { font-size: clamp(24px, 7vw, 30px); }
    .cpa-channel-grid, .aia-advantage-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .cpa-process-flow, .cpa-process-row { gap: 20px; }
    .cpa-process-row--1, .cpa-process-row--2, .cpa-process-row--3 { grid-template-columns: minmax(0, 1fr); }
    .cpa-process-step--cpd { margin-top: 0; }
    .cpa-about-art img { height: auto; }
    .service-detail-heading h2, .service-detail-heading--left h2, .aia-certificates .service-detail-heading h2,
    .program-heading h2, .cima-heading h2, .isca-heading h2 { font-size: 27px; }
    .cima-hero { height: auto; min-height: 540px; padding-bottom: 36px; }
    .cima-hero__content { padding-top: 48px; }
    .cima-hero__logo { max-width: 100%; height: auto; }
    .cima-background__facts { margin-top: 28px; grid-template-columns: minmax(0, 1fr); }
    .cima-background__facts article { min-height: 0; border-right: 0; border-bottom: 1px solid #ece5eb; padding: 24px; }
    .cima-background__facts article:last-child { border-bottom: 0; }
    .cima-certification-grid article { min-height: 0; padding: 28px 20px; }
    .cima-certification-grid h3 { font-size: 24px; }
    .cima-certification-grid p { padding: 16px; }
    .cima-advantage-layout > figure { margin-inline: auto; max-width: 100%; }
    .cima-advantage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cima-advantage-grid article { height: auto; padding: 24px 12px; }
    .cima-teacher-grid article { height: auto; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; }
    .cima-teacher-grid img { width: 88px; height: 116px; align-self: start; }
    .cima-testimonial__stage { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; }
    .cima-testimonial__arrow { width: 44px; height: 44px; }
    .cima-testimonial blockquote { min-height: 0; padding: 20px 8px; }
    .cima-testimonial blockquote > img { display: none; }
    .ipa-history-slider__rail button { min-height: 56px; }
    .ipa-history-slider__navigation button { width: 44px; height: 44px; }
    .ipa-channel-board__heading { position: static; padding: 28px 18px; }
    .ipa-channel-board__heading h2, .ipa-channel-board__heading h3 { font-size: 24px; }
    .ipa-channel-board__heading p { font-size: 16px; }
    .ipa-channel-board, .ipa-channel-one-grid { padding-top: 0; }
    .ipa-channel-one-grid article { min-height: 0; padding: 28px 20px; }
    .industry-list-card { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
    .industry-list-card__image { width: 96px; height: 76px; }
    .industry-list-card h2 { padding-bottom: 10px; font-size: 16px; line-height: 1.6; white-space: normal; }
    .industry-list-card__arrow { grid-column: 2; justify-self: end; }
    .industry-list-card p { display: block; font-size: 14px; }
}

@media (max-width: 359px) {
    .site-brand-tagline, .site-brand-separator { display: none; }
    :root { --mobile-gutter: 16px; }
    .home-news-item { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
    .home-news-image { width: 88px; height: 72px; }
    .home-service-visual .service-visual-title { font-size: 19px; }
}
