/* Hydroposhan Academy — shared responsive layer (load last in <head>)
 * Pair with: css/tokens.css, css/header-premium.css, css/footer-premium.css (main template).
 * See docs/RESPONSIVE_DESIGN_SYSTEM.md and README.md.
 *
 * Breakpoints (convention): 1250 / 1024 / 992 / 900 / 768 / 640 / 500 / 480 / 380
 * Primary mobile cut: 768px. Narrow phones: 480px and 500px (touch targets). */

html {
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.container {
    width: min(var(--container-max, 1280px), 100%);
    margin-inline: auto;
    padding-inline: var(--gutter, 16px);
}

/* Fixed header clearance — all viewports (inner pages); top-bar removed — nav row only */
:root {
    --site-fixed-header-offset: calc(4.75rem + env(safe-area-inset-top, 0px));
}

html.ha-unified body:not(.page-home) > header + .page-hero {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: calc(var(--site-fixed-header-offset) + clamp(20px, 4vw, 40px)) !important;
    padding-bottom: clamp(56px, 9vw, 72px) !important;
    min-height: 0 !important;
    overflow: visible !important;
}

html.ha-unified body:not(.page-home) > header + .programs-hero {
    padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 2vw, 24px)) !important;
}

html.ha-unified body:not(.page-home) > header + main.container,
html.ha-unified body:not(.page-home) > header + main {
    padding-top: var(--site-fixed-header-offset) !important;
}

html.ha-unified body:not(.page-home) > header + .page-hero + main,
html.ha-unified body:not(.page-home) > header + .page-hero + main.container,
html.ha-unified body:not(.page-home) > header + .programs-hero + main,
html.ha-unified body:not(.page-home) > header + .programs-hero + main.container {
    padding-top: clamp(16px, 3vw, 32px) !important;
    margin-top: 0 !important;
}

/* Program detail pages — batch strip overlaps hero; keep main above hero paint layer */
html.ha-unified body:not(.page-home) > header + .program-hero + main#program-main,
html.ha-unified body:not(.page-home) > header + .program-hero + main.container {
    position: relative;
    z-index: 10;
    padding-top: 0 !important;
}

html.ha-unified body.page-about > header + .about-hero + main#about-main {
    position: relative;
    z-index: 10;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

html.ha-unified body.page-about > header + .about-hero {
    padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 2vw, 20px)) !important;
    padding-bottom: clamp(56px, 9vw, 72px) !important;
}

html.ha-unified body.page-infrastructure > header + .infra-hero + main#infra-main {
    position: relative;
    z-index: 10;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

html.ha-unified body.page-infrastructure > header + .infra-hero {
    padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 2vw, 20px)) !important;
    padding-bottom: clamp(56px, 9vw, 72px) !important;
}

html.ha-unified body.page-about main .content-card,
html.ha-unified body.page-about main > section.content-card,
html.ha-unified body.page-about main > section.about-power-cta {
    padding: clamp(18px, 2.5vw, 28px) clamp(16px, 2.5vw, 22px) !important;
}

html.ha-unified body.page-infrastructure main .content-card,
html.ha-unified body.page-infrastructure main > section.content-card,
html.ha-unified body.page-infrastructure main > section.infra-power-cta {
    padding: clamp(18px, 2.5vw, 28px) clamp(16px, 2.5vw, 22px) !important;
}

html.ha-unified body.page-how-we-train > header + .hwt-hero + main#hwt-main {
    position: relative;
    z-index: 10;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

html.ha-unified body.page-how-we-train > header + .hwt-hero {
    padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 2vw, 20px)) !important;
    padding-bottom: clamp(56px, 9vw, 72px) !important;
}

html.ha-unified body.page-how-we-train main .content-card,
html.ha-unified body.page-how-we-train main > section.content-card,
html.ha-unified body.page-how-we-train main > section.hwt-power-cta,
html.ha-unified body.page-how-we-train main > section.hwt-why-band {
    padding: clamp(18px, 2.5vw, 28px) clamp(16px, 2.5vw, 22px) !important;
}

html.ha-unified body.page-insights > header + .ins-hero + main#ins-main {
    position: relative;
    z-index: 10;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

html.ha-unified body.page-insights > header + .ins-hero {
    padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 2vw, 20px)) !important;
    padding-bottom: clamp(56px, 9vw, 72px) !important;
}

html.ha-unified body.page-insights main .content-card,
html.ha-unified body.page-insights main > section.content-card,
html.ha-unified body.page-insights main > section.ins-power-cta,
html.ha-unified body.page-insights main > section.ins-path-band {
    padding: clamp(18px, 2.5vw, 28px) clamp(16px, 2.5vw, 22px) !important;
}

html.ha-unified body.page-contact > header + .con-hero + main#con-main {
    position: relative;
    z-index: 10;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

html.ha-unified body.page-contact > header + .con-hero {
    padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 2vw, 20px)) !important;
    padding-bottom: clamp(56px, 9vw, 72px) !important;
}

html.ha-unified body.page-contact main .content-card,
html.ha-unified body.page-contact main > section.content-card,
html.ha-unified body.page-contact main > section.con-power-cta,
html.ha-unified body.page-contact main > section.con-action-band {
    padding: clamp(18px, 2.5vw, 28px) clamp(16px, 2.5vw, 22px) !important;
}

img,
video,
iframe,
svg {
    max-width: 100%;
    height: auto;
}

/* Knowledge Hub — keep card/featured images filling tiles (global img height:auto breaks layout) */
.page-insights .featured-img img,
.page-insights .card-img img {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
}

.page-insights .featured-img {
    min-height: clamp(220px, 42vw, 380px);
}

.page-insights .article-grid {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)) !important;
}

.page-insights button.filter-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    text-transform: none !important;
    letter-spacing: 0.02em !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 18px !important;
    line-height: 1.25 !important;
    align-self: center !important;
}

.page-insights .category-filters {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
}

.page-insights .insights-toolbar {
    flex-direction: column;
    align-items: stretch;
}

.page-insights .insights-search-wrap {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.page-insights .insights-search {
    display: block !important;
    width: 100% !important;
    min-height: 44px !important;
    background: #fff !important;
    border: 1px solid rgba(0, 115, 5, 0.28) !important;
    color: var(--text-main) !important;
}

@media (min-width: 720px) {
    .page-insights .insights-toolbar {
        flex-direction: row;
        align-items: center;
    }

    .page-insights .insights-search-wrap {
        width: auto !important;
        max-width: 420px !important;
        flex: 1 1 240px !important;
    }

    .page-insights .category-filters {
        justify-content: flex-end !important;
        width: auto !important;
        flex: 1 1 200px;
    }
}

/* Photo gallery tiles: global img { height: auto } breaks absolute/grid fill */
.page-gallery .gallery-grid button.gallery-card > img {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.page-gallery .gallery-grid {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;
}

.page-gallery .gallery-grid button.gallery-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

body {
    overflow-x: hidden;
}

/* Skip link (keyboard accessibility) */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 20000;
    padding: 10px 14px;
    border-radius: 999px;
    background: #ffffff;
    color: #004b04;
    border: 1px solid rgba(0, 115, 5, 0.25);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.3px;
    transform: translateY(-160%);
    transition: transform 0.18s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid rgba(0, 115, 5, 0.55);
    outline-offset: 2px;
}

/* Global focus ring for keyboard users */
:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid rgba(0, 115, 5, 0.5);
    outline-offset: 3px;
}

/* Flex/grid page shells: let main shrink instead of forcing horizontal scroll */
main {
    max-width: 100%;
    min-width: 0;
}

/* Prevent long headings from overflowing; prefer word boundaries (not mid-word splits) */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: manual;
}

p, li, span {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Long URLs / unbroken strings in links (exclude main nav — see header-premium.css) */
a:not(.nav-links a):not(#global-mobile-menu-panel a) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Common content wrappers: allow children to shrink inside flex/grid cards */
.content-card,
.section-box,
.about-card,
.stage-card,
.proposal-form,
.framework-box,
.facility-card,
.program-card,
.partner-acc-content {
    min-width: 0;
}

/* Hero title underline — used on many inner pages (single source; avoids missing styles when class is used without inline CSS) */
.hero-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue, #0079c6), var(--primary-green, #007305));
    margin: 0 auto;
    border-radius: 4px;
}

/* Shared top action buttons: keep consistent across pages */
.top-bar .top-action-btn {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.top-bar .top-action-btn a {
    min-height: 42px;
    padding: 8px 16px !important;
    border-radius: 999px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
}

/* Unified hamburger button style (all pages) */
#mobile-toggle.mobile-toggle,
.mobile-toggle {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border: 1px solid rgba(0, 115, 5, 0.22) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #004b04 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer;
}

#mobile-toggle.mobile-toggle i,
.mobile-toggle i {
    font-size: 1.1rem !important;
    color: #004b04 !important;
    line-height: 1 !important;
    pointer-events: none;
}

#mobile-toggle.mobile-toggle:focus-visible,
.mobile-toggle:focus-visible {
    outline: 2px solid rgba(0, 115, 5, 0.45) !important;
    outline-offset: 2px;
}

/* Upcoming cards: stable layout across devices */
.batch-list-container {
    display: grid;
    gap: 16px;
}

.batch-list-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 18px;
}

/* Prevent layout break on narrow screens for long URLs/text */
@media (max-width: 768px) {
    /* Safety fallback: never keep reveal sections hidden on phones */
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Global mobile nav behavior (home + all inner pages) */
    .main-nav-container nav {
        position: relative;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 4px;
        overflow: visible !important;
    }

    .main-nav-container,
    header {
        overflow: visible !important;
    }

    #mobile-toggle.mobile-toggle,
    .mobile-toggle {
        display: inline-flex !important;
        order: 2;
        margin-left: auto;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    .nav-links:not(.active) {
        display: none !important;
        clip-path: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .nav-links.active {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        clip-path: none !important;
        transform: none !important;
        position: static !important;
        z-index: 1002 !important;
        transition: none !important;
        flex: none !important;
        flex-basis: 100% !important;
        order: 3;
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 0 16px !important;
        margin: 0 !important;
        gap: 0 !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        max-height: min(75vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links,
    .nav-links.active {
        clip-path: none !important;
        -webkit-clip-path: none !important;
    }

    .nav-links.active a {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        justify-content: center !important;
        padding: 14px 16px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .top-bar .top-action-btn {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px !important;
    }

    /* Logo alignment consistency (header + footer + logo-nav templates) */
    .main-nav-container nav .nav-logo {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .main-nav-container nav .nav-logo img {
        display: block;
        margin-inline: auto;
    }

    .logo-nav .logo,
    .logo-nav .logo img {
        margin-inline: auto !important;
        display: block;
        text-align: center;
    }

    footer .footer-grid > div:first-child {
        display: flex;
        justify-content: center;
    }

    footer .footer-logo {
        margin-inline: auto !important;
    }

    a:not(.btn):not(.program-hero-btn):not(.btn-card):not(.nav-links a):not(#global-mobile-menu-panel a) {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    button {
        max-width: 100%;
    }
}

/* --- Collapse main nav into hamburger when 8 links no longer fit (tablet / narrow desktop) --- */
@media (max-width: 1200px) {
    .main-nav-container nav {
        position: relative;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 4px;
        overflow: visible !important;
    }

    .main-nav-container,
    header {
        overflow: visible !important;
    }

    .main-nav-container nav .nav-logo {
        order: 1;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    #mobile-toggle.mobile-toggle,
    .mobile-toggle {
        display: inline-flex !important;
        order: 2;
        margin-left: auto;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    .nav-links:not(.active) {
        display: none !important;
        clip-path: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .nav-links.active {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        clip-path: none !important;
        transform: none !important;
        position: static !important;
        z-index: 1002 !important;
        transition: none !important;
        flex: none !important;
        flex-basis: 100% !important;
        order: 3;
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 0 16px !important;
        margin: 0 !important;
        gap: 0 !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        max-height: min(75vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.active a {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        justify-content: center !important;
        padding: 14px 16px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-links a:not(.nav-btn)::after {
        display: none !important;
    }
}

/* --- Inner pages: “premium” header uses .nav-links { display: flex } without a mobile breakpoint,
   which overrides display:none and keeps the full menu visible on small screens. --- */
@media (max-width: 768px) {
    body.page-home #mobile-toggle.mobile-toggle,
    body.page-home .mobile-toggle {
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    body:not(.page-home) .main-nav-container nav {
        position: relative;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 4px;
    }

    body:not(.page-home) .nav-logo {
        order: 1;
    }

    body:not(.page-home) #mobile-toggle.mobile-toggle,
    body:not(.page-home) .mobile-toggle {
        order: 2;
        margin-left: auto;
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    body:not(.page-home) .nav-links:not(.active) {
        display: none !important;
    }

    body:not(.page-home) .nav-links.active {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        flex: none !important;
        flex-basis: 100% !important;
        order: 3;
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 0 16px !important;
        margin: 0 !important;
        gap: 0 !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        max-height: min(75vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body:not(.page-home) .nav-links.active a {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        justify-content: center !important;
        padding: 14px 16px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    body:not(.page-home) .nav-links a:not(.nav-btn)::after {
        display: none !important;
    }

    body:not(.page-home) .top-bar .top-action-btn,
    body.page-home .top-bar .top-action-btn {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: 100%;
    }

    body:not(.page-home) .top-bar .top-action-btn a,
    body.page-home .top-bar .top-action-btn a {
        display: inline-flex !important;
        justify-content: center;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        font-size: clamp(0.62rem, 2.8vw, 0.78rem) !important;
        padding: 6px 4px !important;
        white-space: nowrap;
    }

    /* Inner pages: blog / variants with phone row + action row in top bar */
    body:not(.page-home) .top-bar-content {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    body:not(.page-home) .top-contact-info {
        flex-direction: column !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100%;
        text-align: center;
    }

    /* Fixed header clearance — nav row only (top-bar removed) */
    :root {
        --site-fixed-header-offset: calc(4.75rem + env(safe-area-inset-top, 0px));
    }

    .page-hero {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        padding-top: calc(var(--site-fixed-header-offset) + clamp(20px, 5vw, 36px)) !important;
        padding-bottom: clamp(36px, 8vw, 56px) !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .page-hero .container {
        width: 100%;
    }

    .hero-title {
        font-size: clamp(1.75rem, 7vw, 2.5rem) !important;
        line-height: 1.15 !important;
        padding: 0 12px;
        word-break: break-word;
    }

    .programs-hero {
        padding: var(--site-fixed-header-offset) 16px 56px !important;
    }

    body:not(.page-home) > header + #how-to-enroll.section-padding {
        padding-top: var(--site-fixed-header-offset) !important;
    }

    /* Overlap card onto hero (negative main margin) looks fine on desktop; on mobile it slides under fixed header */
    body:not(.page-home) header + .page-hero + main,
    body:not(.page-home) header + .programs-hero + main {
        margin-top: 0 !important;
    }

    /* Calendar: first content is main > .page-title (no hero section) */
    body:not(.page-home) > header + main.container {
        padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 3vw, 24px)) !important;
    }

    /* Utility pages: header + .page-wrap (company details, etc.) */
    html.ha-unified body > header + .page-wrap,
    html.ha-unified body.page-company-details .page-wrap {
        padding-top: calc(var(--site-fixed-header-offset) + clamp(16px, 4vw, 32px)) !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        min-height: calc(100dvh - var(--site-fixed-header-offset));
    }

    /* Blog article: hero + overlapping article card */
    body:not(.page-home) > header + main .blog-hero {
        padding-top: calc(var(--site-fixed-header-offset) + clamp(16px, 4vw, 28px)) !important;
    }

    body.page-blog-article > header + .page-blog-hero {
        padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 3vw, 20px)) !important;
        overflow: visible !important;
    }

    body.page-blog-article .page-blog-hero__content.hero-content,
    body.page-blog-article .page-blog-hero .hero-subtitle,
    body.page-blog-article .page-blog-hero__title,
    body.page-blog-article .page-blog-hero__desc {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    body.page-insights .page-hero {
        display: none !important;
    }

    body.page-insights main.container,
    body.page-insights main#ins-main {
        padding-top: 0 !important;
    }

    body:not(.page-home) .article-card-wrapper {
        margin-top: 0 !important;
    }

    /* Homepage hero — clear fixed header; avoid vertical centering under tall mobile header */
    body.page-home .hero {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 3vw, 24px)) !important;
        min-height: min(100dvh, 920px) !important;
    }

    .programs-title {
        font-size: clamp(1.5rem, 6vw, 2.15rem) !important;
        line-height: 1.2 !important;
    }

    .programs-subtitle {
        font-size: clamp(0.95rem, 3.5vw, 1.05rem) !important;
    }

    .content-card {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .programs-grid {
        grid-template-columns: 1fr !important;
    }

    .horizontal-legal-links {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        padding-inline: 0 !important;
        justify-items: stretch !important;
    }

    .horizontal-legal-links a {
        font-size: 0.78rem !important;
        padding: 10px 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .global-cta a.btn,
    .global-cta .btn {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }

    .about-card {
        padding: 24px 18px !important;
    }

    .about-card h3 {
        font-size: clamp(1.2rem, 4.5vw, 1.65rem) !important;
    }

    /* Program certificate / 30-day pages (.logo-nav) */
    .logo-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .logo-nav .logo {
        justify-content: center;
        text-align: center;
    }

    .logo-nav nav {
        flex-direction: column !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        width: 100%;
    }

    .logo-nav nav > a {
        padding: 12px 8px !important;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .logo-nav .nav-cta {
        flex-direction: column !important;
        width: 100%;
        margin-top: 6px;
        gap: 10px !important;
    }

    .logo-nav .nav-cta .btn {
        width: 100%;
        justify-content: center;
        white-space: normal !important;
    }

    header .top-bar .top-bar-content > span {
        display: block;
        text-align: center;
        font-size: 0.78rem !important;
        line-height: 1.45 !important;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .page-hero {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding-top: calc(var(--site-fixed-header-offset) + clamp(12px, 3vw, 24px)) !important;
        padding-bottom: clamp(48px, 10vw, 64px) !important;
    }

    .container {
        padding-left: 4% !important;
        padding-right: 4% !important;
    }

    .nav-logo img {
        max-height: 56px;
        width: auto;
    }

    .top-bar .top-action-btn {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
    }

    .top-bar .top-action-btn a {
        min-height: 44px;
        font-size: clamp(0.68rem, 2.8vw, 0.8rem) !important;
        letter-spacing: 0.2px !important;
        padding: 8px 6px !important;
        white-space: normal !important;
        line-height: 1.25 !important;
    }

    .top-bar .top-action-btn a:last-child {
        grid-column: auto;
    }
}

@media (max-width: 992px) {
    html.ha-unified footer.ha-footer .footer-grid,
    html.ha-unified footer#contact.ha-footer .footer-grid,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: clamp(20px, 3vw, 32px) !important;
    }

    html.ha-unified footer.ha-footer .footer-col--contact,
    html.ha-unified footer#contact.ha-footer .footer-col--contact,
    .footer-col--contact {
        grid-column: 1 / -1 !important;
        max-width: min(640px, 100%) !important;
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-grid > div:first-child {
        text-align: center;
    }
}

/* =============================================================================
   Site-wide responsive (all pages) — load after page CSS
   ============================================================================= */

/* View-details modal (common-interactive.js) */
@media (max-width: 640px) {
    .vd-modal-overlay {
        padding: 10px !important;
        align-items: flex-end !important;
    }

    .vd-modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 18px 18px 0 0 !important;
    }

    .vd-modal-header {
        padding: 14px 14px 8px !important;
    }

    .vd-modal-title {
        font-size: 1.25rem !important;
        padding-right: 8px;
    }

    .vd-modal-body {
        padding: 12px 14px 16px !important;
    }

    .vd-modal-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .vd-modal-actions .vd-btn {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }
}

/* Anchor offset under fixed header (program pages with #program-main) */
#program-main {
    scroll-margin-top: 100px;
}

/* Program hero (e.g. 2-Day Masterclass, 7-Day Microgreens) */
.program-hero .program-hero-inner {
    max-width: min(1100px, 94vw) !important;
}

.program-hero h1.program-title {
    text-wrap: balance;
    word-break: normal !important;
    overflow-wrap: anywhere;
}

.program-hero .program-title .program-title-accent {
    font-size: 1em !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

@media (max-width: 768px) {
    #program-main {
        scroll-margin-top: calc(var(--site-fixed-header-offset, 200px) + 8px);
    }

    .program-hero {
        padding-top: var(--site-fixed-header-offset) !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .program-hero-cta {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .program-hero-cta .program-hero-btn {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }

    .program-subtitle {
        letter-spacing: 0.12em !important;
    }

    .program-hero h1.program-title {
        font-size: clamp(1.35rem, 6.1vw, 2.05rem) !important;
        line-height: 1.18 !important;
    }
}

/* Homepage & shared grids */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: 1fr !important;
    }
}

/* Upcoming batches, program listing, long-form program pages, tables, embedded media — 768px */
@media (max-width: 768px) {
    .batch-list-card {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
        text-align: center !important;
        gap: 18px !important;
        padding: 22px 16px !important;
    }

    .batch-info {
        align-items: center;
    }

    .batch-meta {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .batch-action {
        width: 100% !important;
        align-self: stretch !important;
    }

    .batch-action .btn {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .td-title {
        font-size: clamp(1.1rem, 4.5vw, 1.25rem) !important;
        line-height: 1.3 !important;
    }

    .curr-grid {
        grid-template-columns: 1fr !important;
    }

    .check-list-grid {
        grid-template-columns: 1fr !important;
    }

    .program-top-cta {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .program-top-cta .btn {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }

    .sticky-enroll {
        flex-direction: column !important;
        text-align: center !important;
        gap: 16px !important;
        padding: 16px !important;
    }

    .two-column {
        grid-template-columns: 1fr !important;
    }

    .outcomes-grid {
        grid-template-columns: 1fr !important;
    }

    .cta-buttons {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .cta-buttons .btn {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }

    .hero-meta {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .section-title {
        font-size: clamp(1.35rem, 5.5vw, 1.85rem) !important;
    }

    main table,
    .content-card table,
    .program-section table {
        font-size: 0.86rem;
        max-width: 100%;
    }

    main th,
    main td,
    .content-card th,
    .content-card td,
    .program-section th,
    .program-section td {
        padding: 10px 8px !important;
    }

    iframe {
        max-width: 100% !important;
    }
}

/* Homepage institutional training card — mobile */
@media (max-width: 768px) {
    .hero-content {
        padding: 28px 18px !important;
    }

    .inst-card {
        padding: 28px 18px !important;
        border-radius: 16px !important;
    }

    .inst-card__title {
        font-size: clamp(1.55rem, 6vw, 2rem) !important;
    }

    .inst-card__lead {
        font-size: 1rem !important;
    }

    .inst-cta-row {
        flex-direction: column !important;
        align-items: center !important;
    }

    .inst-cta-row .btn {
        width: 100% !important;
        max-width: 320px !important;
        justify-content: center !important;
        min-height: 46px;
    }
}

/* Touch-friendly legal strip */
@media (max-width: 480px) {
    .horizontal-legal-links {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .horizontal-legal-links a {
        min-height: 44px;
        display: inline-flex !important;
        align-items: center !important;
    }
}

/* =============================================================================
   Global baseline — every page (works with inline utility styles)
   ============================================================================= */

pre,
code {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.map-container {
    max-width: 100%;
    box-sizing: border-box;
}

/* Safety: keep homepage lightbox hidden until explicitly opened */
#home-training-lightbox[aria-hidden="true"] {
    display: none !important;
}

#home-training-lightbox.open[aria-hidden="false"] {
    display: flex !important;
}

@media (max-width: 480px) {
    .contact-info-boxes {
        grid-template-columns: 1fr !important;
    }
}

/* Map, large CTAs, program detail main — 768px */
@media (max-width: 768px) {
    .map-container {
        height: min(400px, 52vh) !important;
        min-height: 220px;
    }

    .global-cta {
        padding: 36px 16px !important;
        margin: 48px auto !important;
    }

    .global-cta h3.serif-text,
    .global-cta .serif-text {
        font-size: clamp(1.35rem, 5.5vw, 2rem) !important;
        line-height: 1.2 !important;
    }

    .global-cta p {
        font-size: 1rem !important;
    }

    .global-cta .btn,
    .global-cta a.btn {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }

    main#program-main > section.content-card {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* Calendar & any horizontal table scroll */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Training calendar — desktop: fit container, readable headers & cells */
@media (min-width: 769px) {
    .calendar-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    .calendar-table th {
        white-space: nowrap !important;
        line-height: 1.25 !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
        hyphens: manual !important;
        padding: 14px 10px !important;
        font-size: 0.78rem !important;
        vertical-align: middle !important;
    }

    .calendar-table td {
        padding: 16px 12px !important;
        line-height: 1.45 !important;
        vertical-align: top !important;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .calendar-table td.col-duration {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    .calendar-table td.col-seats,
    .calendar-table th.col-seats {
        text-align: center !important;
    }

    .calendar-table td.col-action,
    .calendar-table th.col-action {
        text-align: center !important;
    }

    .calendar-table .calendar-action-cell {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .calendar-table .calendar-action-cell .btn {
        width: 100% !important;
        justify-content: center !important;
        white-space: normal !important;
    }
}

/* Shown only under @media (max-width: 768px) for .calendar-table */
.calendar-mobile-only-dates {
    display: none;
}

/* Training calendar — wrap at word boundaries; avoid mid-word splits */
.calendar-table td:first-child {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}

.calendar-table .program-name {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
}

.calendar-table .program-meta {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.calendar-enroll-disabled {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
}

/* Calendar / batch cards: stack Enroll + Details as real buttons (not link-like text) */
.calendar-action-cell {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.calendar-table .calendar-action-cell .btn,
.batch-list-card .calendar-details-btn {
    box-sizing: border-box;
}

.calendar-details-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800 !important;
    font-size: 0.82rem !important;
    min-height: 44px;
    padding: 10px 18px !important;
    border: 2px solid rgba(0, 115, 5, 0.45) !important;
    color: #004b04 !important;
    background: transparent !important;
    border-radius: 999px !important;
    text-align: center;
}

.calendar-details-btn:hover {
    background: rgba(0, 115, 5, 0.06) !important;
    color: #004b04 !important;
}

/* Desktop: always show Start/End columns (legacy builds hid nth-child 3–4 site-wide) */
@media (min-width: 769px) {
    .calendar-table thead {
        display: table-header-group !important;
    }

    .calendar-table tbody tr {
        display: table-row !important;
    }

    .calendar-table thead th:nth-child(3),
    .calendar-table thead th:nth-child(4),
    .calendar-table tbody td:nth-child(3),
    .calendar-table tbody td:nth-child(4) {
        display: table-cell !important;
        visibility: visible !important;
    }
}

/* Calendar: stacked cards on phones + cell padding */
@media (max-width: 768px) {
    .calendar-table th,
    .calendar-table td {
        padding: 12px 14px !important;
        font-size: 0.92rem !important;
        white-space: normal !important; /* override any global nowrap on main table */
    }

    .table-responsive {
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .calendar-table {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 12px !important;
        display: block !important;
    }

    .calendar-table colgroup,
    .calendar-table col {
        display: none !important;
        width: auto !important;
    }

    .calendar-table tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .calendar-table thead {
        display: none !important;
    }

    .calendar-table tbody,
    .calendar-table tr,
    .calendar-table td {
        display: block !important;
        width: 100% !important;
    }

    .calendar-table tr {
        background: #fff;
        border: 1px solid rgba(0, 115, 5, 0.12);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 75, 4, 0.06);
        padding: 8px 0;
        min-width: 0;
        max-width: 100%;
        width: 100% !important;
        box-sizing: border-box;
        display: block !important;
    }

    .calendar-table td {
        border: none !important;
        padding: 8px 14px !important;
        position: relative;
        text-align: left !important;
        font-size: 0.94rem !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        float: none !important;
        clear: both !important;
        box-sizing: border-box !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    .calendar-table td::before {
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #0a7f1e;
        margin-bottom: 4px;
    }

    .calendar-table td:nth-child(1)::before { content: "Program"; }
    .calendar-table td:nth-child(2)::before { content: "Duration"; }
    .calendar-table td:nth-child(3)::before { content: "Start Date"; }
    .calendar-table td:nth-child(4)::before { content: "End Date"; }
    .calendar-table td:nth-child(5)::before { content: "Last date of registration"; }
    .calendar-table td:nth-child(6)::before { content: "Seats Available"; }
    .calendar-table td:nth-child(7)::before { content: "Enroll"; }

    .calendar-table td:last-child {
        padding-top: 12px !important;
    }

    .calendar-table td:last-child .calendar-action-cell {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .calendar-table td:last-child a,
    .calendar-table td:last-child .btn {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }

    /* Inlined under Duration — some mobile engines skip or collapse separate Start/End <td> rows */
    .calendar-table tbody tr > td:nth-child(3),
    .calendar-table tbody tr > td:nth-child(4) {
        display: none !important;
    }

    .calendar-mobile-only-dates {
        display: grid !important;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(0, 115, 5, 0.14);
    }

    .calendar-mob-lbl {
        display: block;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #0a7f1e;
        margin-bottom: 2px;
    }

    .calendar-mob-val {
        font-size: 0.94rem;
        font-weight: 600;
        color: var(--text-main, #1a1f1b);
    }

    .calendar-mob-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

@media (min-width: 769px) {
    .calendar-mobile-only-dates {
        display: none !important;
    }
}

/* Extra-narrow: program hero title breathing room */
@media (max-width: 380px) {
    h1.program-title {
        font-size: clamp(1.45rem, 9vw, 1.85rem) !important;
    }
}

/* How to Enroll — notes grid: never wider than viewport */
.enroll-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 30px;
}

@media (max-width: 480px) {
    .enroll-notes-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .help-section .btn-group {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        max-width: 400px;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .help-section .btn-group .btn {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }
}

/* Partner With Us page mobile/tablet readability */
@media (max-width: 1024px) {
    .partner-intro {
        margin-bottom: 36px !important;
    }

    .partner-intro .partner-subtitle {
        font-size: clamp(1.05rem, 4.2vw, 1.35rem) !important;
        line-height: 1.35 !important;
        letter-spacing: 0.06em !important;
        margin-bottom: 14px !important;
        word-break: keep-all;
    }

    .partner-intro h2.serif-text {
        font-size: clamp(1.8rem, 6vw, 2.35rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 14px !important;
    }

    .partner-intro .partner-lead {
        font-size: clamp(1rem, 3.8vw, 1.15rem) !important;
        line-height: 1.6 !important;
        margin-bottom: 18px !important;
    }

    .partner-intro .btn-group {
        width: 100%;
        max-width: 520px;
        margin-inline: auto;
    }

    .partner-intro .btn-group .btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center;
        white-space: normal !important;
    }

    .section-box {
        padding: 22px 16px !important;
    }

    .partner-acc-header span {
        line-height: 1.35 !important;
        padding-right: 8px;
    }
}

/* Partner page: tighten header-to-content spacing for better balance */
@media (max-width: 1024px) {
    .page-hero + main .content-card {
        padding-top: 22px !important;
    }

    .page-hero + main .partner-intro {
        margin-top: 0 !important;
        margin-bottom: 28px !important;
    }
}

@media (max-width: 768px) {
    .partner-intro {
        text-align: left !important;
    }

    .partner-intro .btn-group {
        gap: 10px !important;
    }

    .page-hero + main .content-card {
        padding-top: 14px !important;
    }

    .page-hero + main .partner-intro {
        margin-bottom: 22px !important;
    }
}

/* Insights bottom CTA: force consistent button rendering */
.bottom-cta .btn-group .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    text-decoration: none !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
}

.bottom-cta .btn-group .btn.btn-primary {
    background: var(--primary-green) !important;
    color: #fff !important;
    border: 2px solid var(--primary-green) !important;
}

.bottom-cta .btn-group .btn.btn-outline {
    background: #fff !important;
    color: var(--primary-green) !important;
    border: 2px solid var(--primary-green) !important;
}

@media (max-width: 768px) {
    .bottom-cta .btn-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .bottom-cta .btn-group .btn {
        width: 100% !important;
        box-sizing: border-box;
        text-align: center;
    }
}

/* =============================================================================
   Strict Mobile Overrides (Max-Width: 500px)
   ============================================================================= */
@media (max-width: 500px) {
    /* Prevent min-width forcing by any container */
    body, html, .container, main {
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    /* Keep all three CTAs on one compact row */
    body.page-home .top-bar .top-action-btn,
    body:not(.page-home) .top-bar .top-action-btn {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        justify-content: stretch !important;
        gap: 5px !important;
    }

    body.page-home .top-bar .top-action-btn a,
    body:not(.page-home) .top-bar .top-action-btn a {
        width: 100% !important;
        padding: 6px 3px !important;
        font-size: clamp(0.58rem, 2.6vw, 0.7rem) !important;
        max-width: 100% !important;
        grid-column: auto !important;
    }

    /* Fix Hero Badges cramping */
    .hero-badges {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .hero-badges a {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .horizontal-legal-links {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 18px 0 !important;
    }

    .horizontal-legal-links a {
        min-height: 44px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Legacy nav animation block removed:
   mobile menu is now controlled by common-interactive.js via #global-mobile-menu-panel. */

/* ==========================================================================
   Final Global Responsive Pass (all pages)
   ========================================================================== */
@media (max-width: 1024px) {
    h1 { font-size: clamp(1.7rem, 4.8vw, 2.3rem) !important; line-height: 1.2 !important; }
    h2 { font-size: clamp(1.4rem, 4vw, 1.95rem) !important; line-height: 1.25 !important; }
    h3 { font-size: clamp(1.15rem, 3.2vw, 1.45rem) !important; line-height: 1.3 !important; }
    p, li { line-height: 1.65 !important; }

    .section-padding { padding: clamp(48px, 8vw, 82px) 0 !important; }
    .content-card,
    .step-card,
    .section-box,
    .program-card { padding: clamp(18px, 3vw, 28px) !important; }

    .btn-group,
    .programs-cta-row,
    .program-top-cta,
    .cta-buttons,
    .hero .btn-group,
    .inst-btn-group,
    .help-section .btn-group {
        gap: 12px !important;
    }
}

@media (max-width: 768px) {
    .container { padding-left: 4% !important; padding-right: 4% !important; }

    .btn,
    a.btn,
    button.btn,
    .program-hero-btn,
    .btn-outline,
    .btn-primary {
        min-height: 44px !important;
        padding: 11px 16px !important;
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
    }

    button.filter-btn,
    button.gallery-filter,
    button.testimonials-filter {
        min-height: 0 !important;
        height: auto !important;
        padding: 8px 16px !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }

    .btn-group,
    .programs-cta-row,
    .program-top-cta,
    .cta-buttons,
    .hero .btn-group,
    .inst-btn-group,
    .help-section .btn-group {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .btn-group .btn,
    .programs-cta-row .btn,
    .program-top-cta .btn,
    .cta-buttons .btn,
    .hero .btn-group .btn,
    .inst-btn-group .btn,
    .help-section .btn-group .btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .programs-grid,
    .grid-3,
    .two-col-grid,
    .two-column,
    .outcomes-grid,
    .check-list-grid,
    .curr-grid,
    .contact-info-boxes {
        grid-template-columns: 1fr !important;
    }

    .batch-list-card,
    .program-card,
    .infra-card,
    .section-box,
    .content-card {
        border-radius: 12px !important;
    }

    .table-responsive { overflow-x: auto !important; max-width: 100% !important; }
    table { width: 100% !important; }
    th, td { word-break: break-word; }

    iframe,
    video,
    img { max-width: 100% !important; height: auto !important; }

    /* Homepage training gallery: aspect-ratio tiles + absolute fill (global img rule resets height) */
    #home-training-gallery .home-training-gallery-item img,
    #hwt-training-gallery .hwt-gallery-item img {
        height: 100% !important;
        object-fit: cover !important;
    }

    #global-mobile-menu-panel {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        border-top: 1px solid rgba(0,0,0,0.06) !important;
    }
}

@media (max-width: 480px) {
    h1 { font-size: clamp(1.45rem, 7.5vw, 1.9rem) !important; }
    h2 { font-size: clamp(1.25rem, 6.2vw, 1.6rem) !important; }
    h3 { font-size: clamp(1.05rem, 5.2vw, 1.3rem) !important; }
    p, li { font-size: 0.96rem !important; }

    .content-card,
    .step-card,
    .section-box,
    .program-card,
    .global-cta {
        padding: 16px !important;
    }

    .horizontal-legal-links {
        grid-template-columns: 1fr !important;
        justify-items: stretch !important;
    }

    .horizontal-legal-links a {
        min-height: 44px;
        width: 100% !important;
    }
}

/* ==========================================================================
   Responsive Stability Overrides (site-wide)
   Keeps legacy + new breakpoints consistent on all pages.
   ========================================================================== */
@media (max-width: 768px) {
    /* Normalize top bar layout across templates */
    .top-bar .top-bar-content {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        align-items: center !important;
        text-align: center !important;
    }

    .top-contact-info {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px 12px !important;
        width: 100% !important;
    }

    /* Keep CTA rows consistent in all pages — single compact row on mobile */
    .top-bar .top-action-btn,
    body.page-home .top-bar .top-action-btn,
    body:not(.page-home) .top-bar .top-action-btn {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .top-bar .top-action-btn a {
        width: 100% !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        font-size: clamp(0.62rem, 2.8vw, 0.78rem) !important;
        padding: 6px 4px !important;
    }

    /* Safer drawer sizing for long menu lists */
    .nav-links.active,
    body:not(.page-home) .nav-links.active {
        max-height: min(70vh, 460px) !important;
        overscroll-behavior: contain;
    }

    /*
     * Wide legacy tables: keep native `display: table` so columns stay visible.
     * (Older `display: block` + `nowrap` on `<table>` broke 2-column comparison tables.)
     * Use a wrapper with overflow-x: auto + min-width on the table when horizontal scroll is needed.
     */
    .content-card table:not(.calendar-table),
    main table:not(.calendar-table) {
        display: table;
        width: 100%;
        max-width: 100%;
        border-collapse: collapse;
        white-space: normal;
    }

    .content-card div[style*="overflow-x: auto"],
    .content-card div[style*="overflow-x:auto"],
    .table-responsive {
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    /* Article / CMS HTML tables: allow wrapping inside the column */
    main .content table,
    main .prose table,
    article .content table,
    .legal-content table {
        white-space: normal !important;
    }
}

@media (max-width: 500px) {
    /* Compact but readable CTA strip — stay on one row */
    .top-bar .top-action-btn,
    body.page-home .top-bar .top-action-btn,
    body:not(.page-home) .top-bar .top-action-btn {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px !important;
    }

    .top-bar .top-action-btn a:last-child {
        grid-column: auto !important;
    }

    /* Keep nav logo + toggle on one visual row */
    .main-nav-container nav {
        column-gap: 10px;
    }

    .main-nav-container .nav-logo img {
        max-height: 56px !important;
        width: auto !important;
    }
}

/* =============================================================================
   RESPONSIVE_DESIGN_SYSTEM.md — site-wide baseline (all pages / viewports)
   Fluid type, xs + xxl tuning, prose width, card grid utility, touch targets.
   ============================================================================= */

@supports (padding: max(0px, env(safe-area-inset-left))) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Body: fluid size (this file loads after page <style> blocks) */
body {
    font-size: clamp(0.9375rem, 0.88rem + 0.35vw, 1.0625rem);
    line-height: 1.62;
}

/* Inner pages use .hero-title; home .hero h1 keeps stronger inline .hero h1 rules */
h1.hero-title {
    font-size: clamp(1.65rem, 2.6vw + 1rem, 2.9rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

main h2,
main .section-title,
.section-headline {
    font-size: clamp(1.3rem, 1.6vw + 0.8rem, 2.05rem);
    line-height: 1.22;
}

main h3 {
    font-size: clamp(1.1rem, 0.9vw + 0.82rem, 1.45rem);
    line-height: 1.3;
}

/* EdTech card grids — min(100%,280px) avoids overflow at 320px */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(16px, 3vw, 28px);
}

/* Long-form / CMS HTML */
.prose,
article .content.prose,
main .legal-content {
    max-width: 72ch;
}

.prose img,
.prose iframe,
.prose video {
    max-width: 100%;
    height: auto;
}

.prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

section.content-section,
.page-section {
    padding-block: var(--section-pad-y, clamp(40px, 6vw, 96px));
}

/* XS — extra-narrow phones (token 0–479px) */
@media (max-width: 479.98px) {
    .container {
        padding-inline: clamp(12px, 3.2vw, 18px);
    }

    body {
        font-size: clamp(0.9rem, 0.86rem + 0.45vw, 1rem);
    }

    h1.hero-title {
        font-size: clamp(1.45rem, 5vw + 0.65rem, 2.1rem);
    }
}

/* XXL — large desktops */
@media (min-width: 1280px) {
    .container {
        padding-inline: clamp(20px, 2.5vw, 40px);
    }
}

/* Touch targets footer / nav CTA (WCAG 2.5.5), tablets & phones */
@media (max-width: 767.98px) {
    .footer-grid ul li a {
        min-height: 44px;
        padding-block: 10px;
        box-sizing: border-box;
    }

    footer .social-links a,
    .footer-social a,
    footer .social-icons a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links .nav-btn,
    .nav-btn {
        min-height: 44px;
        padding-block: 12px;
    }
}

/* =============================================================================
   All-device polish — homepage specifics + globals (loads after legacy inline CSS)
   ============================================================================= */

/* Tablet: program showcase readable 2-column instead of cramped 3-up */
@media (max-width: 992px) and (min-width: 769px) {
    body.page-home #programs.programs-showcase .programs-showcase-grid,
    body.page-home #programs.programs-showcase .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: clamp(16px, 3vw, 28px) !important;
    }
}

/* Homepage hero — fluid headline / lead (beats large inline px sizes via !important) */
@media (max-width: 900px) {
    body.page-home .hero-content h1 {
        font-size: clamp(1.65rem, 6vw + 0.6rem, 2.85rem) !important;
        line-height: 1.12 !important;
        letter-spacing: -0.02em !important;
    }

    body.page-home .hero-content .desc {
        font-size: clamp(0.95rem, 1.6vw + 0.72rem, 1.125rem) !important;
        line-height: 1.62 !important;
    }

    body.page-home .hero-subtitle {
        font-size: clamp(0.68rem, 1vw + 0.54rem, 0.82rem) !important;
        letter-spacing: 0.16em !important;
    }
}

@media (max-width: 768px) {
    /* Home “Upcoming programs” → horizontal scroll instead of cramped columns */
    body.page-home .upcoming-programs-table-wrap {
        margin-inline: calc(-1 * clamp(12px, 3vw, 18px)) !important;
        padding-inline: clamp(8px, 2vw, 12px) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-x: contain;
        scroll-snap-type: none;
    }

    body.page-home .upcoming-programs-table {
        min-width: min(620px, 140vw);
        font-size: 0.88rem !important;
    }

    body.page-home .upcoming-programs-table th,
    body.page-home .upcoming-programs-table td {
        padding: 10px 10px !important;
        vertical-align: top !important;
    }

    /* Only index uses .cta-section: stack CTAs full-width */
    .cta-section .container > div:last-of-type {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: min(480px, 100%);
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: clamp(24px, 5vw, 40px) !important;
    }

    .cta-section .container > div:last-of-type > .btn,
    .cta-section .container > div:last-of-type .ha-counselling-trigger {
        width: 100% !important;
        justify-content: center !important;
        white-space: normal !important;
        box-sizing: border-box !important;
    }

    body.page-home #programs.programs-showcase .section-header h2[style] {
        font-size: clamp(1.52rem, 5.8vw + 0.38rem, 2.35rem) !important;
        line-height: 1.2 !important;
    }

    body.page-home .cta-section .container > h2.serif-text[style] {
        font-size: clamp(1.52rem, 5.5vw + 0.42rem, 2.52rem) !important;
        line-height: 1.2 !important;
        hyphens: manual;
        overflow-wrap: break-word;
        word-break: normal;
    }

    body.page-home .cta-section {
        padding-block: clamp(44px, 10vw, 78px) !important;
        padding-inline: clamp(14px, 4vw, 24px);
    }

    /* Methodology strip: phones stack steps (arrows hidden in home-page.css) */
    body.page-home .methodology-flow {
        gap: 12px !important;
    }
}

@media (max-width: 380px) {
    body.page-home .hero-content {
        padding-inline: clamp(14px, 5vw, 20px) !important;
    }
}

/* Landscape phones — reduce hero wasted vertical space */
@media (max-height: 520px) and (orientation: landscape) {
    body.page-home .hero {
        padding-top: calc(76px + env(safe-area-inset-top)) !important;
        padding-bottom: clamp(28px, 10vh, 52px) !important;
        min-height: 0 !important;
    }

    body.page-home .hero .scroll-indicator {
        display: none !important;
    }
}

/* Fixed header — nav row only (top-bar removed) */
@media (max-width: 640px) {
    :root {
        --site-fixed-header-offset: calc(4.75rem + env(safe-area-inset-top, 0px));
    }
}

@media (max-width: 480px) {
    :root {
        --site-fixed-header-offset: calc(4.75rem + env(safe-area-inset-top, 0px));
    }
}

/* Mobile nav drawer bottom safe-area (home indicator — iOS) */
#global-mobile-menu-panel {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
}

#global-mobile-menu-panel a,
#global-mobile-menu-panel .nav-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

#global-mobile-menu-panel a:focus-visible {
    outline: 2px solid rgba(0, 115, 5, 0.45);
    outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   Mobile responsive pass — hero padding, header logo, forms (iOS), grids
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Inline home CSS can set a tall nav logo on small screens — cap for foldables */
    header .nav-logo img,
    .main-nav-container .nav-logo img {
        max-height: 52px !important;
        height: auto !important;
        width: auto !important;
    }

    /* Home hero glass panel: inline CSS uses large padding — tighten on phones */
    body.page-home .hero-content {
        padding: clamp(18px, 4.5vw, 28px) !important;
        width: 100%;
        max-width: min(720px, 100%);
        margin-inline: auto;
        box-sizing: border-box;
    }

    body.page-home .hero .container {
        min-width: 0;
        padding-inline: clamp(12px, 3.5vw, 20px);
    }

    /* iOS: avoid auto-zoom on focus when control font is below 16px */
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="range"]):not([type="color"]),
    select,
    textarea {
        font-size: max(16px, 1rem) !important;
    }

    /* Homepage institutional CTA strip */
    .institutional-block {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: clamp(18px, 4vw, 28px) !important;
        padding: clamp(28px, 6vw, 40px) !important;
    }

    .institutional-block .inst-action,
    .institutional-block .inst-content {
        max-width: 100% !important;
    }

    .institutional-block .inst-action .btn,
    .institutional-block .inst-action .btn-outline {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    body.page-home .hero-content h1 {
        font-size: clamp(1.35rem, 6.5vw + 0.55rem, 2rem) !important;
        line-height: 1.14 !important;
    }

    body.page-home .hero-content .btn-group .btn {
        min-height: 48px;
    }
}

/* CMS / legal HTML: embeds never wider than column */
main iframe,
.content-card iframe,
article iframe {
    max-width: 100%;
}

/* ==========================================================================
   Site-wide mobile polish (all pages — complements per-page inline CSS)
   ========================================================================== */

@media (max-width: 559px) {
    /* Knowledge Hub — single column on narrow phones only (site-grids.css handles tablet 2-col) */
    .page-insights .article-grid {
        grid-template-columns: 1fr !important;
        gap: clamp(18px, 4vw, 26px) !important;
        margin-bottom: clamp(36px, 8vw, 56px) !important;
    }
}

@media (max-width: 768px) {
    .article-grid {
        grid-template-columns: 1fr !important;
        gap: clamp(18px, 4vw, 26px) !important;
        margin-bottom: clamp(36px, 8vw, 56px) !important;
    }

    .page-insights .featured-article,
    .featured-article {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .featured-img,
    .featured-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Marketing / program CTAs */
    .global-cta {
        padding: clamp(32px, 7vw, 52px) clamp(16px, 4vw, 26px) !important;
        margin: clamp(28px, 6vw, 48px) auto !important;
        border-radius: 16px !important;
    }

    .bottom-cta {
        padding: clamp(28px, 6vw, 44px) clamp(16px, 4vw, 22px) !important;
    }

    /* Program / inner-page hero titles (inline px on many templates) */
    .page-title h1 {
        font-size: clamp(1.55rem, 5.8vw + 0.55rem, 2.65rem) !important;
        line-height: 1.15 !important;
        padding-inline: 6px !important;
    }

    /* Long flex rows of buttons */
    .programs-cta-row,
    main .cta-buttons,
    .cta-btn-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .programs-cta-row > a,
    .programs-cta-row > .btn,
    main .cta-buttons > a,
    main .cta-buttons > .btn,
    .cta-btn-group > a,
    .cta-btn-group > .btn {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        white-space: normal !important;
    }

    /* Contact page info tiles */
    .contact-info-boxes {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-bottom: clamp(28px, 6vw, 40px) !important;
    }

    /* Wide comparison tables: keep horizontal scroll smooth */
    div[style*="overflow-x: auto"] table,
    div[style*="overflow-x:auto"] table,
    .table-responsive table {
        -webkit-overflow-scrolling: touch;
    }

    /* Card body padding on article tiles */
    .article-card .card-body {
        padding: clamp(18px, 4vw, 26px) !important;
    }

    .article-card .card-img {
        height: clamp(160px, 38vw, 200px) !important;
    }

    .article-card .card-meta {
        flex-wrap: wrap !important;
        gap: 8px 14px !important;
    }
}

@media (max-width: 480px) {
    .footer-logo img {
        max-height: 72px !important;
    }

    .page-title h1 {
        font-size: clamp(1.45rem, 6.2vw + 0.45rem, 2.15rem) !important;
    }
}

/* 30-Day program: “Other programs vs This program” — readable on narrow phones */
@media (max-width: 640px) {
    .program-compare-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .program-compare-table tbody tr {
        display: block;
        margin-bottom: 14px;
        border: 1px solid rgba(0, 75, 4, 0.14);
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .program-compare-table tbody td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(0, 75, 4, 0.08);
        white-space: normal !important;
        text-align: left !important;
        padding: 12px 14px !important;
    }

    .program-compare-table tbody td:last-child {
        border-bottom: none;
    }

    .program-compare-table tbody td:first-child::before {
        content: "Other programs";
        display: block;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: #64748b;
        margin-bottom: 8px;
    }

    .program-compare-table tbody td:last-child::before {
        content: "This program";
        display: block;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: #0a7f1e;
        margin-bottom: 8px;
    }

    .program-compare-scroll {
        overflow: visible !important;
    }
}

/* ==========================================================================
   Completion layer — CMS blog HTML + embeds + safe overflow (all pages)
   ========================================================================== */

.article-admin-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    min-width: 0;
}

.article-admin-body img,
.article-admin-body video,
.article-admin-body iframe,
.article-admin-body svg {
    max-width: 100%;
    height: auto;
}

.article-admin-body table {
    max-width: 100%;
}

pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

iframe[src*='youtube.com'],
iframe[src*='youtu.be'],
iframe[src*='google.com/forms'],
iframe[src*='docs.google.com'] {
    max-width: 100%;
}

main input:not([type='checkbox']):not([type='radio']),
main select,
main textarea,
.content-card input:not([type='checkbox']):not([type='radio']),
.content-card select,
.content-card textarea {
    max-width: 100%;
}

/* CMS blog article (blog.php) — legacy fallback only */
body:not(.page-blog-article) .page-blog-main {
    padding-top: clamp(100px, 14vw, 120px);
    padding-bottom: clamp(48px, 8vw, 80px);
    background: var(--bg-light, #fdfdfd);
    min-height: 50vh;
}

.page-blog-article-card {
    max-width: min(760px, 100%);
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    padding: clamp(24px, 4vw, 40px);
    box-shadow: 0 12px 40px rgba(0, 75, 4, 0.06);
    border: 1px solid rgba(0, 115, 5, 0.1);
}

.page-blog-article__category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    margin: 0 0 8px;
}

.page-blog-article__title {
    font-size: clamp(2rem, 4vw, 2.6rem);
    color: var(--dark-green, #004b04);
    margin: 0 0 8px;
    line-height: 1.2;
}

.page-blog-article__date {
    color: #64748b;
    font-size: 0.92rem;
    display: block;
    margin-bottom: 20px;
}

.page-blog-article__figure {
    margin: 0 0 24px;
}

.page-blog-article__figure img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
}

.page-blog-article__body {
    line-height: 1.75;
    font-size: clamp(1rem, 2.8vw, 1.05rem);
    color: #1e293b;
    border-top: 1px solid rgba(0, 115, 5, 0.14);
    padding-top: 24px;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
}

/* Blog article → back to Insights / Knowledge Hub */
.blog-back-to-hub {
    margin: 0 0 20px;
    padding: 0 5%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.blog-back-to-hub--bottom {
    padding: 0;
    max-width: none;
}

.blog-back-to-hub__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-green, #007305);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    font-family: 'Inter', system-ui, sans-serif;
    transition: color 0.2s ease, gap 0.2s ease;
}

.blog-back-to-hub__link:hover {
    color: var(--dark-green, #004b04);
    gap: 10px;
}

body:not(:has(header)) .blog-back-to-hub {
    padding: 0;
    max-width: min(760px, 100%);
}

/* Testimonials dedicated page */
body.page-testimonials .page-hero {
    position: relative;
    overflow: visible;
    color: #fff;
    text-align: center;
    border-bottom: 4px solid var(--primary-green, #007305);
    background-color: var(--dark-green, #004b04);
    background-image:
        radial-gradient(circle at center, rgba(0, 115, 5, 0.22) 0%, rgba(0, 4, 0, 0.82) 100%),
        linear-gradient(165deg, #003d03 0%, #004b04 48%, #002a02 100%);
}

body.page-testimonials .hero-title {
    margin: 0 0 14px;
    color: #fff;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

body.page-testimonials #testimonials {
    display: block;
}

body.page-testimonials #testimonials[hidden] {
    display: block !important;
}

body.page-testimonials .testimonials-grid {
    max-width: 1200px;
    margin: 0 auto;
}

/* Testimonials (admin CMS → #testimonials-grid) */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(16px, 3vw, 24px);
    align-items: stretch;
}

.testimonial-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border: 1px solid rgba(0, 75, 4, 0.12);
    border-radius: 16px;
    padding: clamp(18px, 3vw, 24px);
    box-shadow: 0 8px 28px rgba(0, 75, 4, 0.06);
    min-width: 0;
}

.testimonial-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(0, 115, 5, 0.15);
}

.testimonial-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-card__avatar--placeholder {
    display: grid;
    place-items: center;
    background: rgba(0, 115, 5, 0.08);
    color: var(--primary-green, #007305);
    font-size: 1.4rem;
}

.testimonial-card__name {
    margin: 0 0 4px;
    font-size: 1.2rem;
    color: var(--dark-green, #004b04);
    line-height: 1.3;
}

.testimonial-card__background {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-green, #007305);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.testimonial-card__meta {
    margin: 0 0 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light, #64748b);
}

.testimonial-card__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dark-green, #004b04);
    margin-bottom: 4px;
}

.testimonial-card__quote {
    margin: 8px 0 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--text-main, #1e293b);
    font-style: italic;
}

.testimonial-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.testimonial-card__badge--google {
    background: rgba(66, 133, 244, 0.12);
    color: #1a73e8;
}

.testimonial-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-green, #007305);
    text-decoration: none;
}

.testimonial-card__link:hover {
    text-decoration: underline;
}

@media (min-width: 640px) {
    .testimonial-card {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Homepage testimonials carousel */
.testimonials-home .testimonials-carousel {
    margin-top: 4px;
}

.testimonials-carousel__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.testimonials-filter {
    border: 1px solid rgba(0, 115, 5, 0.22);
    background: #fff;
    color: #004b04;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.testimonials-filter:hover {
    border-color: rgba(0, 115, 5, 0.45);
    transform: translateY(-1px);
}

.testimonials-filter.is-active {
    background: var(--primary-green, #007305);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(0, 115, 5, 0.22);
}

.testimonials-carousel__shell {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(8px, 2vw, 16px);
}

.testimonials-carousel__viewport {
    overflow: hidden;
    width: 100%;
    outline: none;
    border-radius: 4px;
    cursor: grab;
}

.testimonials-carousel__viewport:active {
    cursor: grabbing;
}

.testimonials-carousel__viewport:focus-visible {
    outline: 2px solid rgba(0, 115, 5, 0.45);
    outline-offset: 4px;
}

.testimonials-carousel__track {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    gap: var(--testimonial-gap, 20px);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    align-items: stretch;
}

.testimonials-carousel__track .testimonial-card {
    flex: 0 0 var(--testimonial-slide-width, 100%);
    max-width: var(--testimonial-slide-width, 100%);
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 300px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.3s ease;
}

.testimonials-carousel__track .testimonial-card.is-filtered-out {
    display: none !important;
}

.testimonials-carousel__track .testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 75, 4, 0.12);
}

.testimonials-carousel__track .testimonial-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.testimonials-carousel__track .testimonial-card__quote {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.testimonial-card__stars {
    display: inline-flex;
    gap: 3px;
    color: #f5a623;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.testimonial-card__quote-icon {
    color: rgba(0, 115, 5, 0.2);
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.testimonials-carousel__arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 115, 5, 0.2);
    background: #fff;
    color: #004b04;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.testimonials-carousel__arrow:hover:not(:disabled) {
    background: var(--primary-green, #007305);
    color: #fff;
    border-color: transparent;
    transform: scale(1.05);
}

.testimonials-carousel__arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.testimonials-carousel__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.testimonials-carousel__status {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-light, #64748b);
    letter-spacing: 0.02em;
}

.testimonials-carousel__hint {
    margin: 0 0 8px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-light, #64748b);
}

.testimonials-carousel__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.testimonials-carousel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(0, 115, 5, 0.22);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.testimonials-carousel__dot.is-active {
    background: var(--primary-green, #007305);
    transform: scale(1.2);
}

.testimonials-carousel--ready .testimonials-carousel__track .testimonial-card.reveal,
.testimonials-home .testimonials-carousel__track .testimonial-card.reveal.active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

@media (max-width: 640px) {
    .testimonials-carousel__shell {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "viewport viewport"
            "prev next";
        gap: 12px;
    }

    .testimonials-carousel__viewport {
        grid-area: viewport;
        touch-action: pan-y pinch-zoom;
    }

    .testimonials-carousel__arrow--prev {
        grid-area: prev;
        justify-self: end;
        width: 100%;
        max-width: 140px;
        border-radius: 999px;
        height: 42px;
    }

    .testimonials-carousel__arrow--next {
        grid-area: next;
        justify-self: start;
        width: 100%;
        max-width: 140px;
        border-radius: 999px;
        height: 42px;
    }

    .testimonials-carousel__track .testimonial-card {
        min-height: 280px;
    }

    .testimonials-filter {
        padding: 9px 14px;
        font-size: 0.85rem;
    }

    .testimonials-home .testimonials-carousel__hint {
        display: block;
    }
}

@media (min-width: 641px) {
    .testimonials-home .testimonials-carousel__hint {
        display: none;
    }
}

/* ==========================================================================
   Site-wide spacing tighten (2026-07-20)
   Overrides legacy inline padding/margin on inner pages.
   ========================================================================== */

/* Main — comfortable bottom padding; mobile nav clearance handled in site-text-unified.css */
html.ha-unified body:not(.page-home) > main,
html.ha-unified body:not(.page-home) > main.container {
    padding-bottom: clamp(40px, 6vw, 64px) !important;
}

/* Inner content cards — unify 60–80px inline padding */
html.ha-unified body:not(.page-home):not(.page-program-detail) main .content-card,
html.ha-unified body:not(.page-home):not(.page-program-detail) main > .content-card {
    padding: clamp(22px, 3.5vw, 36px) clamp(18px, 3vw, 28px) !important;
}

/* Programs listing card */
html.ha-unified body.page-programs main .programs-page__card,
html.ha-unified body.page-programs main .content-card {
    padding: clamp(22px, 3.5vw, 36px) clamp(18px, 3vw, 28px) !important;
}

html.ha-unified body.page-programs main.container,
html.ha-unified body.page-programs main.programs-page {
    margin-top: 0 !important;
    padding-bottom: clamp(40px, 6vw, 64px) !important;
}

/* Global CTA blocks — inline 75px / 80px margin on many pages */
html.ha-unified .global-cta {
    padding: clamp(32px, 5vw, 48px) clamp(20px, 3.5vw, 36px) !important;
    margin: clamp(28px, 4vw, 40px) auto !important;
}

html.ha-unified .global-cta p {
    margin-bottom: clamp(18px, 2.5vw, 28px) !important;
}

/* How to enroll — first section (no page-hero) */
html.ha-unified body > header + #how-to-enroll.section-padding {
    padding: calc(var(--site-fixed-header-offset) + clamp(12px, 2vw, 24px)) 0 clamp(36px, 5vw, 56px) !important;
}

html.ha-unified #how-to-enroll .step-card {
    padding: clamp(20px, 3vw, 28px) !important;
    margin-bottom: clamp(14px, 2vw, 22px) !important;
}

html.ha-unified #how-to-enroll .enrollment-notes {
    padding: clamp(20px, 3vw, 28px) !important;
    margin-bottom: clamp(24px, 4vw, 36px) !important;
}

html.ha-unified #how-to-enroll .cta-section {
    padding: clamp(32px, 5vw, 48px) clamp(20px, 3.5vw, 32px) !important;
    margin-bottom: clamp(20px, 3vw, 28px) !important;
}

/* Legacy program detail — stacked sections inside single card */
body.page-program-detail .program-section {
    padding: clamp(18px, 2.5vw, 28px) 0 !important;
}

body.page-program-detail .program-section:first-child {
    padding-top: 0 !important;
}

body.page-program-detail .content-block {
    padding: clamp(12px, 2vw, 20px) 0 !important;
}

body.page-program-detail main .content-card:not(.content-card--power):not(.programs-page__card) {
    padding: clamp(20px, 3vw, 28px) clamp(16px, 2.5vw, 24px) !important;
}

/* How we train — internal block spacing */
html.ha-unified .train-intro {
    margin-bottom: clamp(24px, 4vw, 36px) !important;
}

html.ha-unified .stages-container {
    margin: clamp(24px, 4vw, 36px) 0 !important;
    gap: clamp(20px, 3vw, 28px) !important;
}

html.ha-unified .section-box {
    padding: clamp(24px, 4vw, 36px) clamp(20px, 3vw, 32px) !important;
    margin-bottom: clamp(24px, 4vw, 36px) !important;
}

/* Insights / partner grids */
html.ha-unified .featured-article,
html.ha-unified .insights-cta-block {
    margin-bottom: clamp(32px, 5vw, 48px) !important;
}

/* Calendar page sections */
html.ha-unified body:not(.page-home) > header + main.container .page-title {
    margin-bottom: clamp(20px, 3vw, 28px) !important;
}

html.ha-unified body:not(.page-home) > header + main.container > section,
html.ha-unified body:not(.page-home) > header + main.container > .calendar-section {
    margin-bottom: clamp(28px, 4vw, 40px) !important;
}

/* Section padding utility — desktop (mobile already in @1024) */
html.ha-unified body:not(.page-home) .section-padding {
    padding-block: clamp(40px, 6vw, 64px) !important;
}

/* ==========================================================================
   COMPLETE SITE MOBILE RESPONSIVE PASS (2026-07-21)
   ========================================================================== */

html.ha-unified {
    overflow-x: hidden;
}

html.ha-unified body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

html.ha-unified body > header#header,
html.ha-unified body > section.hero,
html.ha-unified body > section.page-hero,
html.ha-unified body > section.programs-hero,
html.ha-unified body > section.program-hero,
html.ha-unified body > section[class*="-hero"],
html.ha-unified body > footer {
    min-width: 0;
    max-width: none !important;
    width: 100% !important;
    margin-inline: 0 !important;
    box-sizing: border-box;
}

html.ha-unified main,
html.ha-unified main.container {
    min-width: 0;
    max-width: min(var(--container-max, 1280px), 100%) !important;
    width: 100% !important;
    margin-inline: auto !important;
    box-sizing: border-box;
}

html.ha-unified .content-card {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 768px) {
    header .nav-links#nav-links:not(.active) {
        display: none !important;
    }
}

@media (max-width: 500px) {
    .top-bar .top-action-btn {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .top-bar .top-action-btn a {
        min-height: 44px !important;
        font-size: clamp(0.68rem, 2.8vw, 0.8rem) !important;
        padding: 8px 6px !important;
        white-space: normal !important;
        line-height: 1.25 !important;
    }
}

@media (max-width: 640px) {
    main [style*="grid-template-columns: 1fr 1fr"],
    main [style*="grid-template-columns:1fr 1fr"],
    main [style*="grid-template-columns: repeat(2"],
    .info-grid,
    .forms-grid,
    .two-column {
        grid-template-columns: 1fr !important;
    }

    main div[style*="display: flex"][style*="flex-wrap: wrap"],
    main div[style*="display: flex"][style*="flex-wrap:wrap"],
    .content-card div[style*="display: flex"][style*="flex-wrap"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    main div[style*="display: flex"][style*="flex-wrap"] > div[style*="min-width"],
    main div[style*="display: flex"][style*="flex-wrap"] > div[style*="padding-left"] {
        min-width: 0 !important;
        width: 100% !important;
        padding-left: 0 !important;
        border-left: none !important;
    }
}

@media (max-width: 768px) {
    html.ha-unified .stage-card {
        flex-direction: column !important;
        gap: clamp(14px, 3vw, 20px) !important;
        padding: clamp(18px, 4vw, 26px) !important;
    }

    html.ha-unified .stage-number {
        font-size: clamp(2rem, 8vw, 2.75rem) !important;
        width: auto !important;
    }

    html.ha-unified .stage-content h3,
    html.ha-unified .stage-content h3[style] {
        font-size: clamp(1.15rem, 4.5vw, 1.5rem) !important;
    }

    html.ha-unified h3.serif-text[style*="font-size: 2rem"],
    html.ha-unified h3[style*="font-size: 2rem"],
    html.ha-unified h3[style*="font-size: 2.25rem"] {
        font-size: clamp(1.2rem, 5vw, 1.65rem) !important;
    }

    html.ha-unified .global-cta[style],
    html.ha-unified .past-engagement-card[style] {
        padding: clamp(24px, 5vw, 36px) clamp(16px, 4vw, 24px) !important;
        margin: clamp(24px, 5vw, 36px) auto !important;
    }

    html.ha-unified .global-cta h2,
    html.ha-unified .global-cta h3,
    html.ha-unified .global-cta h3.serif-text[style] {
        font-size: clamp(1.25rem, 5.2vw, 1.85rem) !important;
        line-height: 1.25 !important;
    }

    html.ha-unified .map-container[style] {
        height: clamp(240px, 55vw, 380px) !important;
    }

    html.ha-unified .proposal-form {
        padding: clamp(20px, 4vw, 28px) !important;
    }

    html.ha-unified .btn-group[style],
    html.ha-unified .cta-btn-group[style] {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 12px !important;
    }

    html.ha-unified .btn-group[style] .btn,
    html.ha-unified .btn-group[style] a,
    html.ha-unified .cta-btn-group[style] .btn,
    html.ha-unified .cta-btn-group[style] a {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    body.page-programs .programs-quick-nav,
    body.page-programs .programs-filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        scrollbar-width: thin;
    }

    body.page-programs .power-stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    body.page-programs .programs-hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.page-programs .programs-hero-actions .btn {
        width: 100% !important;
    }

    html.ha-unified .facility-content {
        padding: clamp(20px, 4vw, 28px) !important;
    }

    html.ha-unified .facility-grid {
        grid-template-columns: 1fr !important;
    }

    html.ha-unified #how-to-enroll .btn-group {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    html.ha-unified #how-to-enroll .btn-group .btn,
    html.ha-unified #how-to-enroll .btn-group a {
        width: 100% !important;
    }

    body.page-home .hero .btn-group {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    body.page-home .hero .btn-group .btn {
        width: 100% !important;
    }

    html.ha-unified .sticky-enroll .btn,
    html.ha-unified .sticky-enroll a.btn {
        width: 100% !important;
        justify-content: center !important;
    }

    html.ha-unified .refund-grid,
    html.ha-unified .values-grid,
    html.ha-unified .about-card-grid,
    html.ha-unified .info-grid {
        grid-template-columns: 1fr !important;
    }

    html.ha-unified .page-blog-article__body,
    html.ha-unified .blog-article-card {
        padding: clamp(18px, 4vw, 28px) !important;
    }
}

@media (max-width: 640px) {
    body.page-program-detail .program-hero-cta,
    body.page-program-detail .program-hero-cta--triple {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        padding-inline: clamp(12px, 3vw, 20px);
        box-sizing: border-box;
    }

    body.page-program-detail .program-hero-cta .program-hero-btn,
    body.page-program-detail .program-hero-cta--triple .program-hero-btn,
    body.page-program-detail .program-hero-cta .ha-book-counselling,
    body.page-program-detail .program-hero-cta--triple .ha-book-counselling,
    body.page-program-detail .program-hero-cta .ha-counselling-trigger,
    body.page-program-detail .program-hero-cta--triple .ha-counselling-trigger {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    body.page-program-detail .power-daily-grid {
        grid-template-columns: 1fr !important;
    }

    body.page-program-detail .why-choose-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.page-program-detail .takehome-grid {
        grid-template-columns: 1fr !important;
    }

    table.program-compare-table,
    table.program-batch-table,
    table.program-schedule-table {
        font-size: 0.85rem;
    }
}

@media (max-width: 481px) {
    html.ha-unified .framework-principles {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 380px) {
    body.page-program-detail .why-choose-grid {
        grid-template-columns: 1fr !important;
    }

    body.page-program-detail .power-stats-bar {
        grid-template-columns: 1fr !important;
    }
}

.program-batch-wrap,
.program-compare-wrap,
.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@supports (padding: max(0px)) {
    html.ha-unified header {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}
