:root {
    --site-font-family: "Be Vietnam Pro", sans-serif;
    --site-type-title: clamp(1.25rem, 1.05rem + 0.85vw, 1.75rem);
    --site-type-body: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
    --site-type-info: clamp(0.875rem, 0.84rem + 0.16vw, 0.9375rem);
    --site-type-caption: clamp(0.75rem, 0.72rem + 0.13vw, 0.8125rem);
}

:where(body) {
    font-family: var(--site-font-family);
    line-height: 1.65;
}

:where(button, input, select, textarea) {
    font-family: inherit;
}

:root body:where(:not(#page-top)) {
    font-size: var(--site-type-body);
}

:root body:where(:not(#page-top)) :is(h1, h2):not(:where(dialog *)) {
    font-size: var(--site-type-title);
    line-height: 1.25;
}

:root body:where(:not(#page-top)) h3 {
    font-size: max(1.125rem, var(--site-type-body));
    line-height: 1.35;
}

:root body:where(:not(#page-top)) :is(p, li):not(:where(nav *, [role="status"], [role="alert"])) {
    font-size: var(--site-type-body);
    line-height: 1.55;
}

:root body:where(:not(#page-top)) label {
    font-size: var(--site-type-info);
    line-height: 1.35;
}

:root body:where(:not(#page-top)) small {
    font-size: var(--site-type-caption);
    line-height: 1.35;
}

:root body:where(:not(#page-top)) :where(.btn, .back-home, .source-action, button[type="submit"]) {
    font-size: max(.875rem, var(--site-type-info));
}

/* Popup sizing follows the homepage notice. */
:root {
    --site-popup-width: 520px;
    --site-popup-gutter: 18px;
    --site-popup-padding: 28px 25px 24px;
    --site-popup-radius: 26px;
    --site-popup-title: 1.75rem;
    --site-popup-text: 1rem;
    --site-popup-line: 1.55;
}

@media (max-width: 560px) {
    :root {
        --site-popup-gutter: 9px;
        --site-popup-padding: 16px 13px 13px;
        --site-popup-radius: 20px;
        --site-popup-title: 1.5rem;
        --site-popup-text: .9375rem;
        --site-popup-line: 1.5;
    }
}

:root body :is(.lock-screen, .partnerOverlay, .authOverlay, .checkinOverlay,
    .custom-modal-overlay, .welcome-modal-overlay, .voucher-info-overlay,
    .menu-confirm-overlay, .experience-consult-modal, .voucher-modal,
    .free-setup-modal, .source-confirm, .builder-export-modal) {
    padding: var(--site-popup-gutter);
}

:root body :is(.popup, .partnerModal, .authModal, .checkinModal, .custom-modal,
    .welcome-modal-container, .voucher-info-box, .menu-confirm-box,
    .experience-consult-box, .voucher-box, .free-setup-intro, .source-confirm-box,
    .signature-dialog, .builder-export-box:not(.is-contract-step)) {
    box-sizing: border-box;
    width: min(100%, var(--site-popup-width));
    max-width: calc(100vw - 2 * var(--site-popup-gutter));
    max-height: calc(100dvh - 2 * var(--site-popup-gutter));
    border-radius: var(--site-popup-radius);
    overflow-y: auto;
    overscroll-behavior: contain;
}

:root body :is(.popup, .checkinModal, .custom-modal, .welcome-modal-container,
    .menu-confirm-box, .experience-consult-box, .voucher-box, .free-setup-intro,
    .source-confirm-box, .builder-export-box:not(.is-contract-step),
    .signature-dialog .signature-dialog-inner, .voucher-info-box .voucher-info-content,
    .authPopup .box, .firewall-details-content) {
    padding: var(--site-popup-padding);
}

:root body :is(.popup, .partnerModal, .checkinModal, .custom-modal,
    .welcome-modal-container, .voucher-info-box, .menu-confirm-box,
    .experience-consult-box, .voucher-box, .free-setup-intro, .source-confirm-box,
    .signature-dialog, .firewall-details-box, .builder-export-box:not(.is-contract-step),
    .authPopup .box) {
    font-family: var(--site-font-family);
    font-size: var(--site-popup-text);
    line-height: var(--site-popup-line);

    & :is(h1, h2, h3):not(.sr-only) {
        font-size: var(--site-popup-title);
        line-height: 1.2;
    }

    & :where(p, li, label, .modal-message, .popup-text,
        .voucher-info-item-copy, .free-setup-notes, .welcome-point) {
        font-size: var(--site-popup-text);
        line-height: var(--site-popup-line);
    }

    & :where(button[type="submit"], input:not([type="checkbox"], [type="radio"]),
        select, textarea, .gift-modal-btn) {
        font-size: max(.875rem, var(--site-popup-text));
    }
}

/* The embedded account form scrolls inside its own frame. */
:root body .authOverlay .authModal {
    overflow: hidden;
}
:root.authPopup,
:root.authPopup body {
    overflow-y: auto;
}


/* Screenshot labels must remain legible in two-column mobile galleries. */
:root body .gallery-item .caption {
    font-size: var(--site-type-caption);
    line-height: 1.45;
    overflow-wrap: anywhere;
}
