/* Shared typography for public, authentication, member and admin content.
   Load after component/home/page-banner CSS and design-system.css, before
   design-controls.css and color-modes.css. Navigation keeps its UI hierarchy. */
:root {
  --sans: "Noto Sans JP Variable", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --mono: var(--sans);
  --font-size-body: 1rem;
  --font-size-small: .875rem;
  --font-size-meta: .75rem;
  --font-size-page-title: clamp(2rem, 4.2vw, 3.5rem);
  --font-size-section-title: clamp(1.5rem, 2.6vw, 2.25rem);
  --font-size-card-title: 1.125rem;
  --font-size-member-title: clamp(1.75rem, 2.8vw, 2.4rem);
  --font-size-member-section: clamp(1.25rem, 1.9vw, 1.65rem);
  --font-size-hero-title: clamp(2rem, 4.8vw, 5rem);
  --font-size-priority-title: clamp(1.35rem, 2.2vw, 2rem);
  --font-weight-body: 400;
  --font-weight-heading: 700;
  --line-height-body: 1.85;
  --line-height-heading: 1.5;
  --surface: #fff;
  --surface-raised: #fff;
  --reading-surface: #f5f6f9;
  --heading-line: #d8dde4;
}
:root body { font-family: var(--sans); font-size: var(--font-size-body); font-weight: var(--font-weight-body); line-height: var(--line-height-body); }
:where(button, input, select, textarea) { font-family: var(--sans); }
:where(main h1, main h2, main h3, main h4, main h5, main p, main li, main dd) {
  line-break: strict;
  word-break: normal;
  overflow-wrap: break-word;
}
/* Give this layer sufficient specificity to replace the legacy panel rules. */
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content, .not-found) :is(h1, h2, h3, h4, h5) {
  font-family: var(--sans);
  font-style: normal;
  font-weight: var(--font-weight-heading);
  letter-spacing: 0;
  line-height: var(--line-height-heading);
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
  max-inline-size: 100%;
}
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content, .not-found) h1 {
  font-size: var(--font-size-page-title);
  padding-block-end: .45em;
  border-block-end: 1px solid var(--heading-line);
  margin-block-end: .7em;
}
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content, .not-found) h2 {
  font-size: var(--font-size-section-title);
  padding-block-end: .4em;
  border-block-end: 1px solid var(--heading-line);
  border-image: linear-gradient(to right, var(--brand) 0 3rem, var(--heading-line) 3rem) 1;
  margin-block: 0 .85em;
}
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content, .not-found) h3 {
  font-size: var(--font-size-card-title);
  border-inline-start: 2px solid var(--brand);
  padding-inline-start: .65em;
  margin-block: 1.1em .7em;
}
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content, .not-found) h4 {
  font-size: var(--font-size-body);
  background: var(--reading-surface);
  padding: .5em .75em;
  margin-block: 1.1em .6em;
}
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content, .not-found) h5 {
  font-size: var(--font-size-body);
  padding-block-end: .35em;
  border-block-end: 1px dashed var(--heading-line);
  margin-block: 1.1em .6em;
}
:root body :is(.app-content, .member-recovery-content) h1 { font-size: var(--font-size-member-title); }
:root body .app-content h2 { font-size: var(--font-size-member-section); }
:root body .app-content h3 { font-size: var(--font-size-card-title); }
:root body .hero h1 { font-size: var(--font-size-hero-title); max-inline-size: 12em; line-height: 1.45; }
:root body :is(.hero, .feature-copy, .case-banner) { --heading-line: #ffffff50; }
:root body :is(.hero, .feature-copy, .case-banner) h2 { border-image: linear-gradient(to right, #ffadc9 0 3rem, #ffffff50 3rem) 1; }
:root body .public-site .robot-card h3 { color: #fff; border: 0; padding: 0; font-size: var(--font-size-card-title); line-height: var(--line-height-heading); margin: .35rem 0 0; }
:root body .public-site .intent-card h3 { text-wrap: pretty; }
/* Learning and visit remain more prominent than ordinary intent cards. */
:root body .public-site .intent-card:nth-child(4) h3,
:root body .public-site .intent-card:nth-child(5) h3 { font-size: var(--font-size-priority-title); }
:root body .public-site .intro-layout h2 { font-size: var(--font-size-section-title); }
:root body .public-site .content-blocks h2 { font-size: var(--font-size-section-title); }
:root body .public-site .content-blocks h3 { font-size: var(--font-size-card-title); }
:root body .public-site .content-blocks .card-eyebrow { color: var(--brand); margin-block: .8rem .5rem !important; }
:root body .public-site .content-blocks > .block-label { font-size: var(--font-size-meta); color: var(--brand); margin-block: 0 .8rem; line-height: 1.6; }
:root body .public-site .journey > h2 { max-inline-size: 38rem; margin-block-end: 2rem; }
:root body .public-site .section-label { font-size: var(--font-size-meta); margin-block-end: 1.5rem; }
:root body .public-site :is(.text-phrase, .title-line) {
  display: inline;
  vertical-align: baseline;
  white-space: normal;
  word-break: normal;
  text-wrap: inherit;
}
/* Only the authored main campaign retains its two-line structure. */
:root body .hero h1 > span, body .hero h1 > em { display: block; }
:root body .hero-manifesto { font: var(--font-weight-body) var(--font-size-small)/var(--line-height-body) var(--sans); letter-spacing: .02em; }
:root body :is(.public-site, .app-content) p:not(.kicker):not(.card-eyebrow):not(.block-label) { text-wrap: pretty; }
:root body :is(.public-site, .app-content) .kicker { font-size: var(--font-size-meta); line-height: 1.7; letter-spacing: .1em; }
:root body .app-content .portal-card .kicker { color: var(--brand); }
:root body .public-site :is(.journey-path, .program-list, .intent-card, .content-blocks) p:not(.card-eyebrow):not(.block-label) { text-wrap: pretty; }
:root body .reading-panel {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  word-break: normal;
  overflow-wrap: anywhere;
}
:root body .public-site .reading-panel > p,
:root body .public-site p.reading-panel {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  text-indent: 1em;
  color: var(--ink);
  text-wrap: pretty;
}
:root body .public-site .reading-panel > p { margin: 0 0 1.4em; }
:root body .public-site .reading-panel > p:last-child { margin-block-end: 0; }
:root body .public-site .reading-panel > h2 { font-size: var(--font-size-section-title); margin-block-end: 1.25rem; }
:root body :is(.app-content, .member-recovery-content) .reading-panel :is(p, li, dd) {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  text-indent: 0;
}
:root body .public-site .content-lead { color: var(--ink); font-size: var(--font-size-body); line-height: var(--line-height-body); margin-block-start: 1.4rem; }
/* Preserve paragraph/newline authorship. Do not indent messages, labels or status. */
:root body[data-member-portal-shell="true"] :is(.conversation p, .support-message p, .an-body, .an-preview-body, .room-message p) {
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  text-indent: 0;
}
:root body .app-content .ai-draft { font: var(--font-weight-body) var(--font-size-body)/var(--line-height-body) var(--sans); white-space: pre-wrap; }
:root body .public-site .news-item p { background: var(--reading-surface); padding: 1rem 1.25rem; color: var(--ink); font-size: var(--font-size-body); white-space: pre-wrap; }
:root body .support-panel .support-lead { font-size: var(--font-size-member-section); letter-spacing: 0; line-height: var(--line-height-heading); }
:root body .support-panel :is(.support-muted, .support-note) { font-size: var(--font-size-small); line-height: var(--line-height-body); }
:root body .support-panel .support-ticket-description { font-size: var(--font-size-small); }
:root body .support-panel .button { font: var(--font-weight-heading) var(--font-size-body)/1.6 var(--sans); }
:root body .support-panel .button-primary { color: #fff; }
:root body .support-panel .button-dark { color: #fff; }
:root body .support-panel .button-quiet-dark { color: var(--ink); }
:root body .support-intro::after { height: 3px; bottom: -2px; }
/* Visible, comfortably sized actions; text links remain links, not fake buttons. */
:root body .button { min-block-size: 44px; border-radius: .2rem; line-height: 1.6; letter-spacing: .01em; max-inline-size: 100%; }
:root body .text-button { border: 1px solid var(--ink); background: var(--surface); border-radius: .2rem; padding: .6rem .85rem; min-block-size: 44px; }
:root body .text-button:disabled { border: 1px solid var(--line); }
:root body .related-links a { border-color: var(--line); border-radius: .2rem; }
:root body :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
:root body .appearance-control { display: inline-flex; align-items: center; gap: .65rem; flex-wrap: wrap; font: var(--font-weight-body) var(--font-size-small)/1.7 var(--sans); max-inline-size: 100%; }
:root body .appearance-control select { font: inherit; min-block-size: 44px; max-inline-size: 100%; border: 1px solid currentColor; padding: .55rem 1.6rem .55rem .7rem; border-radius: .2rem; background: var(--surface); color: var(--ink); }
:root body .site-footer .appearance-control { margin-block-start: 1rem; }
:root body .appearance-control[hidden] { display: none; }
@media (max-width: 640px) {
  :root body .public-site :is(.feature-copy, .case-banner, .membership-call, .programs, .intent-section, .robot-showcase-head) h2 { font-size: var(--font-size-section-title); }
  :root body .public-site .hero-copy { font-size: var(--font-size-body); }
  :root body .public-site .copy-break { display: none; }
  :root body .public-site .intro-humanoid { margin-block-start: 2rem; }
}
@media (forced-colors: active) {
  body :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible { outline-color: Highlight; }
  body .button { border-color: ButtonText; }
}

/* Keep the requested photograph below the right-hand prose, never behind it. */
:root body .public-site .intro-layout { min-block-size: 0; }
:root body .public-site .intro-humanoid { position: relative; inset: auto; margin: 2rem 0 0 auto; width: min(100%, 420px); height: auto; aspect-ratio: 1; }
:root body .public-site .intro-humanoid img { position: absolute; inset: 0; }

:root body main :is(h1, h2, h3, h4, h5) em { font-style: normal; }
:root body .public-site .intent-card h3 { text-wrap: balance; }
:root body .breadcrumbs a { text-decoration: underline; text-underline-offset: .2em; }
:root body .skip-link { top: 0; transform: translateY(-120%); }
:root body .skip-link:focus { top: 1rem; transform: none; }

/* Page banners are the real route headings, including authentication pages.
   Member/admin banners use the compact workspace scale, not the public scale. */
:root body :is(.page-banner, .email-auth-intro) h1 {
  font-family: var(--sans);
  font-size: var(--font-size-page-title);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  letter-spacing: 0;
}
:root body :is(.app-content, .member-recovery-content) .page-banner h1 { font-size: var(--font-size-member-title); }
:root body .email-auth-card h2 {
  font-family: var(--sans);
  font-size: var(--font-size-section-title);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  letter-spacing: 0;
}
/* Resolve nested component selectors without introducing new heading decoration. */
:root body .public-site :is(.events-panel, .an, .mc) h2 { font-size: var(--font-size-section-title); }
:root body .app-content :is(.portal-card, .member-dashboard, .events-panel, .support-card, .an, .mc, [data-billing-panel], [data-member-admin], [data-membership-plan-admin]) h2 { font-size: var(--font-size-member-section); }
:root body :is(.public-site, .app-content, .mc-directory) :is(.events-panel, .member-dashboard, .three-layer-model, .portal-card, .support-card, .an, .mc, [data-billing-panel], [data-member-admin], [data-membership-plan-admin]) h3 { font-size: var(--font-size-card-title); }
:root body :is(.public-site, .app-content) :is(.events-panel, .member-dashboard, .portal-card, .an, [data-billing-panel]) h4 { font-size: var(--font-size-card-title); }
/* Reset component-level leading so inherited module text uses the body rhythm. */
:root body :is(.events-panel, .member-dashboard, .account-help, .account-settings, .account-faq, .identity-record, .an, .mc, .support-panel, [data-billing-panel], [data-member-admin], [data-membership-plan-admin]) {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}
/* Main prose is body-sized; notes, labels and metadata have explicit roles below.
   Do not target all small elements: UI captions and copyright remain independent. */
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content, .not-found) :is(p, li, dd):not(:where(.kicker, .card-eyebrow, .block-label, .section-label, .hero-manifesto, .an-kicker, .mc-kicker, .bl-eyebrow)) {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}
:root body .page-banner .page-banner-copy,
:root body .email-auth-page :is(.email-auth-lead, .email-auth-status, .email-auth-steps li),
:root body .app-content :is(.account-lead, .account-summary dt, .account-summary dd, .identity-record p),
:root body .public-site :is(.hero-copy, .content-lead, .public-program dd, .public-news-body) {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}
/* Supplementary explanatory text, dates and ordinary form labels. */
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content) :is(
  .public-scope-note, .public-news-fallback, .public-news-item time,
  .public-program dt, .three-layer-model small, .three-layer-model dl,
  .email-auth-membership-note, .email-auth-divider, .email-auth-hint,
  .email-auth-service-note, .email-auth-notice, .email-auth-field-error,
  .email-auth-field label, .email-auth-links a,
  .md-note, .member-dashboard time, .md-badge, .ev-note, .ev-meta dt,
  .an-note, .an-feedback, .an-field-error, .an-context,
  .mc-note, .mc-feedback, .mc-saved-state, .mc-result-count, .mc-official,
  .bl-note, .bl-summary dt, .bl-legal a, .pa-note,
  .support-muted, .support-note, .support-ticket-description,
  .support-live, .support-feedback, .support-ticket-meta,
  .support-internal-warning, .support-lifecycle p, .support-history li,
  .member-page-guide p, .member-process li, .member-related a,
  .portal-form label, .directory-search > label,
  .an-search label, .an-form label, .support-form label,
  .mc-org-select > label, .mc-form fieldset > label:not(.mc-check),
  .mc-admin-order label, .member-admin-hub a small
) {
  font-size: var(--font-size-small);
  line-height: var(--line-height-body);
}
/* Metadata stays distinct from prose and from actionable labels. */
:root body :is(.public-site, .mc-directory, .app-content, .member-recovery-content) :is(
  .kicker, .card-eyebrow, .block-label, .section-label, .an-kicker, .mc-kicker,
  .bl-eyebrow, .pa-eyebrow, .step-mark, .layer-number, .program-number,
  .an-badge, .mc-badge, .support-badge, .support-unread,
  .support-message time, .support-message-visibility, .support-history li span,
  .support-form label > span, .conversation time,
  .email-auth-required, .email-auth-legal, .member-process li > span,
  .member-related > span, .opportunity-status
) { font-size: var(--font-size-meta); }
/* Actions share a readable UI scale without changing their dimensions or colors. */
:root body :is(.public-site, .app-content, .member-recovery-content) :is(.button, .an-button, .mc-button, .pa-button, .account-links a, .md-next, .md-essential a),
:root body .email-auth-page :is(.email-auth-submit, .email-auth-google) { font-size: var(--font-size-body); }
:root body :is(.public-site, .app-content) :is(.text-link, .app-grid a, .md-heading button, .md-section-heading button) { font-size: var(--font-size-small); }
/* Account menu is interface text, not a page/article title. */
:root body[data-member-portal-shell="true"] .member-account > summary,
:root body[data-member-portal-shell="true"] .member-account-panel :is(a, button) {
  font-size: var(--font-size-small);
  line-height: var(--line-height-body);
}
:root body[data-member-portal-shell="true"] :is(.member-account-caption, .member-account-status) { font-size: var(--font-size-meta); }
/* Keep authored event/news/dashboard message newlines after the prose rules. */
:root body :is(.public-site, .app-content) :is(.ev-body, .ev-meta dd, .md-article-body, .public-news-body) {
  white-space: pre-wrap;
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  text-indent: 0;
}
:root body :is(.public-site, .mc-directory) p:not(.kicker):not(.card-eyebrow):not(.block-label) { word-break: normal; overflow-wrap: break-word; }
/* Company names are card identifiers, not article section headings. */
:root body :is(.public-site .mc, .mc-directory, .app-content .mc) .mc-company-name {
  font-size: var(--font-size-body);
  line-height: 1.7;
  margin: 0 0 .35rem;
  border-inline-start: 0;
  padding-inline-start: 0;
}
:root body :is(.public-site .mc, .mc-directory, .app-content .mc) :is(h2, h3).mc-company-name { font-size: var(--font-size-body); }
/* Native select intrinsic width must not expand a narrow footer grid track. */
:root body .site-footer > *,
:root body .appearance-control,
:root body .appearance-control select { min-inline-size: 0; }
/* Visually hidden headings retain the module's screen-reader-only geometry. */
:root body .mc .mc-sr-only {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Generic hidden headings must not acquire visible heading spacing or wrapping. */
:root body main :is(h1, h2, h3, h4, h5):is(.sr-only, .mc-sr-only) {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* New helpers use the same Japanese scale as the forms they enhance. */
:root body :is(.member-form-review, .member-tag-picker, .member-row-editor, .member-completion-list) {
  font-family: var(--sans);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
:root body .member-form-review :is(h2, h3) {
  font-size: var(--font-size-member-section);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
}
:root body :is(.member-field-error, .member-form-hint, .member-completion-detail, .member-completion-checked-at) {
  font-size: var(--font-size-small);
  line-height: var(--line-height-body);
}
:root body .member-form-review :is(dd, pre),
:root body .member-form-ai-draft {
  font: var(--font-weight-body) var(--font-size-body)/var(--line-height-body) var(--sans);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-indent: 0;
}
:root body .member-completion-title { font-weight: var(--font-weight-heading); }
:root body .member-completion-state { font-size: var(--font-size-small); font-weight: 700; }

:root body .member-form-ai-candidate {
  font: var(--font-weight-body) var(--font-size-body)/var(--line-height-body) var(--sans);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-indent: 0;
}
