/* First important layer wins over historical scoped/page-specific !important rules. */
@layer site-typography {
  :root {
    /* Independent phone scale; matching PC values are deliberate, not inherited. */
    --type-sp-page-title: 28px;
    --type-sp-section-title: 20px;
    --type-sp-small-title: 18px;
    --type-sp-body-size: 16px;
    --type-sp-input-size: 16px;
    --type-sp-support-size: 14px;
    --type-sp-label-size: 12px;
    --type-sp-body-line: 1.85;
    --type-sp-support-line: 1.7;
    --type-sp-heading-line: 1.5;
    --type-sp-button-line: 1.5;
    --type-sp-label-line: 1.4;
    --type-sp-field-line: 1.6;
    /* Independent desktop scale. */
    --type-pc-page-title: 40px;
    --type-pc-section-title: 24px;
    --type-pc-small-title: 20px;
    --type-pc-body-size: 16px;
    --type-pc-input-size: 16px;
    --type-pc-support-size: 14px;
    --type-pc-label-size: 12px;
    --type-pc-body-line: 1.8;
    --type-pc-support-line: 1.8;
    --type-pc-heading-line: 1.4;
    --type-pc-button-line: 1.5;
    --type-pc-label-line: 1.5;
    --type-pc-field-line: 1.6;
    --type-page-title: var(--type-sp-page-title);
    --type-section-title: var(--type-sp-section-title);
    --type-small-title: var(--type-sp-small-title);
    --type-body-size: var(--type-sp-body-size);
    --type-input-size: var(--type-sp-input-size);
    --type-support-size: var(--type-sp-support-size);
    --type-label-size: var(--type-sp-label-size);
    --type-body-line: var(--type-sp-body-line);
    --type-support-line: var(--type-sp-support-line);
    --type-heading-line: var(--type-sp-heading-line);
    --type-button-line: var(--type-sp-button-line);
    --type-label-line: var(--type-sp-label-line);
    --type-field-line: var(--type-sp-field-line);
  }
  @media (min-width: 768px) {
    :root {
      --type-page-title: var(--type-pc-page-title);
      --type-section-title: var(--type-pc-section-title);
      --type-small-title: var(--type-pc-small-title);
      --type-body-size: var(--type-pc-body-size);
      --type-input-size: var(--type-pc-input-size);
      --type-support-size: var(--type-pc-support-size);
      --type-label-size: var(--type-pc-label-size);
      --type-body-line: var(--type-pc-body-line);
      --type-support-line: var(--type-pc-support-line);
      --type-heading-line: var(--type-pc-heading-line);
      --type-button-line: var(--type-pc-button-line);
      --type-label-line: var(--type-pc-label-line);
      --type-field-line: var(--type-pc-field-line);
    }
  }

  /* Shared navigation also applies on TOP; only its content keeps a separate scale. */
  #site-header .navigation a:not(.menu-brand) {
    font-family: var(--site-font-heading) !important;
    font-size: var(--type-body-size) !important;
    line-height: var(--type-button-line) !important;
    font-weight: 700 !important;
  }

  /* TOP content keeps its own scale. Dialogs use the shared scale even on TOP.
     Output artwork and decorative symbols are independent lower boundaries. */
  @scope (:is(body:not(.home):not([data-route="home"]):not(:has(.mock-home)), dialog, [role="dialog"], #app-load-fallback)) to (:is(.party-paper, .party-address, .party-greeting, .canonical-certificate, .award-paper, .preview-paper, .customized-paper, .share-image, canvas, svg, .flower-mark, .paper-stamp, .create-step-number, .web-number, .web-process-grid li > span[aria-hidden="true"], .web-process-number, .web-browser-dots)) {
    :scope {
      font-size: var(--type-body-size) !important;
      line-height: var(--type-body-line) !important;
    }
    :is(div, span, a, strong, b, em, small, time, code, pre, nav, section, article, header, footer, main, aside, form, fieldset, ul, ol, dl, table, caption, figcaption, details) {
      font-size: inherit !important;
      line-height: inherit !important;
    }
    :is(p, li, dt, dd, legend, label, summary, th, td, output, blockquote) {
      font-family: var(--site-font-body) !important;
      font-size: var(--type-body-size) !important;
      line-height: var(--type-body-line) !important;
    }
    :is(p, li, dd, td, blockquote) { font-weight: 400 !important; }
    :is(strong, b) { font-weight: 700 !important; }
    :is(label, legend, dt, th, .field-label) { font-weight: 500 !important; line-height: var(--type-field-line) !important; }
    :is(.checkbox-label, .purchase-label) { font-weight: 400 !important; line-height: var(--type-body-line) !important; }
    :is(h1, h2, h3, h4, h5, h6) {
      font-family: var(--site-font-heading) !important;
      line-height: var(--type-heading-line) !important;
      font-weight: 700 !important;
    }
    :is(h1, h2, h3, h4, h5, h6, button, .button) :is(strong, b, span, em) { font-weight: inherit !important; }
    h1 { font-size: var(--type-page-title) !important; }
    h2 { font-size: var(--type-section-title) !important; }
    :is(h3, h4, h5, h6) { font-size: var(--type-small-title) !important; }
    /* A card title and FAQ question are small headings regardless of HTML level. */
    :is(.public-award-card, .award-card, .draft-card, .guide-link) :is(h2, h3),
    :is(.help-faq-surface, .faq-list, .web-faq) details > summary,
    .guide-example blockquote > p:first-child {
      font-family: var(--site-font-heading) !important;
      font-size: var(--type-small-title) !important;
      line-height: var(--type-heading-line) !important;
      font-weight: 700 !important;
    }
    :is(button, .button, summary, .guide-button, .guide-copy, .guide-all, .guide-back, .guide-nav a, .text-button, .tabs a, .operator-navigation a, .navigation a, .page-return a, a.page-return, .web-text-link, .web-cta, .web-example-link, .public-award-read, .guest-creator-notice nav a, .web-service-title) {
      font-family: var(--site-font-heading) !important;
      font-size: var(--type-body-size) !important;
      line-height: var(--type-button-line) !important;
      font-weight: 700 !important;
    }
    /* FAQ questions remain headings when the general summary control rule matches too. */
    :is(.help-faq-surface, .faq-list, .web-faq) details > summary {
      font-family: var(--site-font-heading) !important;
      font-size: var(--type-small-title) !important;
      line-height: var(--type-heading-line) !important;
      font-weight: 700 !important;
    }
    :is(small, figcaption, .help, .field-note, .local-note, .footer-note, .eyebrow, .web-service-eyebrow, .guide-eyebrow, .guide-byline, .guide-tip, .guide-copy-row [role="status"], .web-note, .web-eyebrow, .web-devices figcaption, .operator-eyebrow, .field-adjustments label, .award-editor-fields label, .scope-choice small, .recipient-scope-choice small, .public-awards-count, .public-awards-status) {
      font-family: var(--site-font-body) !important;
      font-size: var(--type-support-size) !important;
      line-height: var(--type-support-line) !important;
    }
    :is(.help, .field-note, .local-note, .footer-note, .guide-tip, .web-note) :is(p, li, span, small, a:not(.button)) {
      font-size: inherit !important;
      line-height: inherit !important;
    }
    /* The first explanatory paragraph in a dialog is primary body copy. */
    .dialog-body > p.help:first-of-type {
      font-size: var(--type-body-size) !important;
      line-height: var(--type-body-line) !important;
    }
    :is(.required, .required-mark, .optional, .badge, .pill, .status-badge, .status-tag, .moderation-state, .saved, .mobile-save-state, .field-adjustments output, .award-editor-fields output) {
      font-family: var(--site-font-body) !important;
      font-size: var(--type-label-size) !important;
      line-height: var(--type-label-line) !important;
      font-weight: 700 !important;
    }
    :is(.footer-links, .guide-footer nav) :is(a, .analytics-settings-button) {
      font-family: var(--site-font-body) !important;
      font-size: var(--type-support-size) !important;
      line-height: var(--type-support-line) !important;
      font-weight: 400 !important;
    }
    /* Large price/step figures communicate status rather than reading hierarchy. */
    :is(.price-free, .purchase-price, .price) {
      font-size: 28px !important;
      line-height: 1.5 !important;
      font-weight: 700 !important;
    }
    /* This artboard is transformed; normalize the visible rather than logical size. */
    .party-actions :is(button, .button) {
      font-size: calc(var(--type-body-size) / var(--party-scale, 1)) !important;
      line-height: 1.5 !important;
    }
    .party-actions .theatre-note {
      font-size: calc(var(--type-support-size) / var(--party-scale, 1)) !important;
      line-height: var(--type-support-line) !important;
    }
    :is(dialog, [role="dialog"]) h1,
    :scope:is(dialog, [role="dialog"]) h1 { font-size: var(--type-section-title) !important; }
    /* Standard dialogs share an undecorated title, including the React logout dialog. */
    :is(dialog, [role="dialog"]) .dialog-head h2::before,
    :is(dialog, [role="dialog"]) .dialog-head h2::after,
    :scope:is(dialog, [role="dialog"]) .dialog-head h2::before,
    :scope:is(dialog, [role="dialog"]) .dialog-head h2::after {
      content: none !important;
      display: none !important;
    }
    /* A heading-only header has no close control whose space must be reserved. */
    .dialog-head:has(> h2:only-child) {
      padding-inline: 0 !important;
      justify-content: center !important;
    }
  }
}
