:root {
    --gmm-button-green: #07875d;
    --gmm-button-green-hover: #075446;
    --gmm-button-ink: #103f4b;
    --gmm-button-border: #8fc9b6;
    --gmm-button-soft: #edf8f4;
    --gmm-button-danger: #a93838;
}

/* Shared geometry for text CTAs. Icon-only controls, tabs and navigation are intentionally excluded. */
:where(
    .gmm-primary-button, .gmm-secondary-button, .gmm-primary-btn,
    .gmm-forecast-primary-btn, .gmm-forecast-secondary-btn,
    .home-button, .internal-primary-button, .cr-primary, .cr-secondary,
    .gmm-green-button, .gmm-submit-btn, .gmm-pricing-button,
    .market-support-submit, .global-market-button, .industry-cta,
    .mega-detail__cta, .btn_demo, .forecast-actions .btn,
    .contact-submit, .clear-filter-button, .mobile-filter-button
) {
    min-height: 44px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .68rem 1.05rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

/* Primary actions always retain readable white text, including nested spans/icons. */
:where(
    .gmm-primary-button, .gmm-primary-btn, .gmm-forecast-primary-btn,
    .home-button-primary, .internal-primary-button, .cr-primary,
    .gmm-green-button, .gmm-submit-btn, .gmm-pricing-button,
    .market-support-submit, .global-market-button, .industry-cta,
    .mega-detail__cta, .btn_demo, .forecast-actions .btn:not(.secondary),
    .contact-submit, .gmm-header-demo
) {
    border: 1px solid var(--gmm-button-green) !important;
    background: var(--gmm-button-green) !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(7, 135, 93, .18);
}

:where(
    .gmm-primary-button, .gmm-primary-btn, .gmm-forecast-primary-btn,
    .home-button-primary, .internal-primary-button, .cr-primary,
    .gmm-green-button, .gmm-submit-btn, .gmm-pricing-button,
    .market-support-submit, .global-market-button, .industry-cta,
    .mega-detail__cta, .btn_demo, .forecast-actions .btn:not(.secondary),
    .contact-submit, .gmm-header-demo
):hover {
    border-color: var(--gmm-button-green-hover) !important;
    background: var(--gmm-button-green-hover) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(7, 84, 70, .24);
    transform: translateY(-1px);
}

:where(
    .gmm-secondary-button, .gmm-forecast-secondary-btn,
    .home-button-secondary, .cr-secondary, .forecast-actions .btn.secondary,
    .clear-filter-button, .mobile-filter-button
) {
    border: 1px solid var(--gmm-button-border) !important;
    background: #fff !important;
    color: var(--gmm-button-ink) !important;
    box-shadow: none;
}

:where(
    .gmm-secondary-button, .gmm-forecast-secondary-btn,
    .home-button-secondary, .cr-secondary, .forecast-actions .btn.secondary,
    .clear-filter-button, .mobile-filter-button
):hover {
    border-color: var(--gmm-button-green) !important;
    background: var(--gmm-button-soft) !important;
    color: #07543e !important;
    transform: translateY(-1px);
}

:where(
    .gmm-primary-button, .gmm-secondary-button, .gmm-primary-btn,
    .gmm-forecast-primary-btn, .gmm-forecast-secondary-btn,
    .home-button, .internal-primary-button, .cr-primary, .cr-secondary,
    .gmm-green-button, .gmm-submit-btn, .gmm-pricing-button,
    .market-support-submit, .global-market-button, .industry-cta,
    .mega-detail__cta, .btn_demo, .forecast-actions .btn,
    .contact-submit, .clear-filter-button, .mobile-filter-button
) :where(span, strong, b, i, svg) {
    color: inherit !important;
}

:where(
    .analytics-actions, .analytics-result-actions, .commodity-head-actions,
    .market-values-actions, .market-result-actions, .insights-filter-actions,
    .insights-top-actions, .site-result-actions, .report-actions, .cr-actions
) :where(a, button) {
    min-height: 40px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

:where(button, a)[disabled], :where(button, a)[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

:where(
    .gmm-primary-button, .gmm-secondary-button, .gmm-primary-btn,
    .gmm-forecast-primary-btn, .gmm-forecast-secondary-btn,
    .home-button, .internal-primary-button, .cr-primary, .cr-secondary,
    .gmm-green-button, .gmm-submit-btn, .gmm-pricing-button,
    .market-support-submit, .global-market-button, .industry-cta,
    .mega-detail__cta, .btn_demo, .forecast-actions .btn,
    .contact-submit, .clear-filter-button, .mobile-filter-button
):focus-visible {
    outline: 3px solid rgba(24, 165, 103, .32);
    outline-offset: 3px;
}

/* A consistent keyboard focus indicator for controls that are not styled as CTAs. */
:where(.gmm-internal-page, .gmm-external-page) :where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(0, 160, 112, .38);
    outline-offset: 3px;
}

:where(.gmm-internal-page, .gmm-external-page) :where(input, select, textarea)[aria-invalid="true"] {
    border-color: #b42318 !important;
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .12) !important;
}

@media (max-width: 600px) {
    :where(.home-hero-actions, .gmm-about-hero-buttons, .gmm-forecast-buttons, .forecast-actions, .cr-actions) :where(a, button) {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(a, button) { transition: none !important; }
}

/* Site-wide primary actions use one GMM green treatment. Icon-only and
   informational controls keep their semantic colours. */
:where(
    [data-market-run], [data-global-request-submit],
    .market-result-actions [data-market-request],
    .report-preview-link, .report-search button[type="submit"],
    .insights-content-search button[type="submit"],
    .site-search-form button[type="submit"],
    .dashboard-search button[type="submit"], .site-open
) {
    min-height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid var(--gmm-button-green) !important;
    border-radius: 8px;
    background: var(--gmm-button-green) !important;
    color: #fff !important;
    font-family: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

:where(
    [data-market-run], [data-global-request-submit],
    .market-result-actions [data-market-request],
    .report-preview-link, .report-search button[type="submit"],
    .insights-content-search button[type="submit"],
    .site-search-form button[type="submit"],
    .dashboard-search button[type="submit"], .site-open
):hover {
    border-color: var(--gmm-button-green-hover) !important;
    background: var(--gmm-button-green-hover) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(7, 84, 70, .24);
    transform: translateY(-1px);
}
