/* ONHEAD responsive correction. Load last; retain original design/assets. */
html { font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.phase1-public, body.admin-shell { font-size: 17px; line-height: 1.65; }
body :is(main, section, article, aside, form, fieldset, .container) { min-width: 0; }
body :is(main p, main li, .lead, .phase1-form-aside p, .phase1-section-description,
  .phase1-submit-row p, .phase1-security-boundary p, .admin-lead, .admin-note p,
  .admin-boundary p, .admin-empty p, .admin-detail-card p) {
  font-size: 17px !important;
  line-height: 1.65 !important;
  overflow-wrap: break-word;
}
body :is(h1,h2,h3,h4) { max-width: 100%; overflow-wrap: break-word; }
body :is(h1,.page-hero h1,.phase1-hero h1,.phase1-coming-soon h1,
  .phase1-auth-card h1,.phase1-receipt-card h1,.admin-page-intro h1) {
  font-size: clamp(28px, 3.3vw, 46px) !important;
  line-height: 1.15;
  letter-spacing: -.035em;
}
body .hybrid-hero h1 { font-size: clamp(34px, 4vw, 56px) !important; line-height: 1.1; }
body :is(h2,.section-heading h2,.article-section h2,.feedback-copy h2,
  .showcase-copy h2,.future-section h2,.contact-band h2,.phase1-form-heading h2,
  .positioning-layout h2,.overview-intro h2,.professional-main h2) {
  font-size: clamp(25px, 2.4vw, 34px) !important;
  line-height: 1.22;
}
body :is(h3,.capability-card h3,.quick-capability h3,.evoked-card h3,
  .patient-panel h3,.phase1-card h3) { font-size: clamp(20px, 1.8vw, 25px) !important; line-height: 1.28; }
body h4 { font-size: 20px !important; line-height: 1.3; }
body :is(.eyebrow,.footer-top h2,.article-aside h2,.quick-index,.card-caption,
  figcaption,.source-note,.source-note p) { font-size: 12px !important; line-height: 1.6; }
body :is(.breadcrumbs,.breadcrumb,[class*="breadcrumb"]) { font-size: 14px !important; line-height: 1.55 !important; }
body :is(.breadcrumbs,.breadcrumb) a { font-size: inherit !important; }
body :is(.article-aside nav a,.aside-note,.faq-item summary,.faq-filter button,
  .button,.text-link,.admin-button,.admin-text-link,.admin-back-link) {
  font-size: 16px !important;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: break-word;
}
body :is(.button,.admin-button,.menu-toggle) { min-height: 44px; max-width: 100%; padding: 11px 17px; }
body :is(.actions,.phase1-submit-row,.admin-form-actions,.admin-filter-actions) { flex-wrap: wrap; min-width: 0; }
body :is(.phase1-field label,.phase1-checkbox-row label,.admin-field label,
  .admin-check-row span,.phase1-fieldset legend,.phase1-acknowledgements legend) {
  font-size: 16px !important; line-height: 1.55;
}
body :is(.phase1-field input:not([type="checkbox"]),.phase1-field textarea,
  .phase1-field select,.admin-field input,.admin-field textarea,.admin-field select) {
  font-size: 16px !important; min-width: 0; width: 100%; max-width: 100%; min-height: 44px;
}
body :is(.phase1-field-help,.phase1-multi-help,.phase1-field-error,
  .admin-field-help,.phase1-error-summary li) { font-size: 14px !important; line-height: 1.55 !important; }
body :is(.phase1-fieldset,.phase1-acknowledgements) { min-inline-size: 0; max-width: 100%; }
body :is(.phase1-form-panel,.phase1-auth-card,.phase1-coming-soon,.admin-detail-card) { min-width: 0; }
body :is(.phase1-field input[type="file"],.admin-field input[type="file"]) { padding: 8px; }
body .phase1-field input[type="file"]::file-selector-button { font-size: 14px; max-width: 100%; margin-right: 8px; }
body :is(.phase1-review-strip,.footer-note,.scope-note,.footer-bottom,.admin-footer) { font-size: 14px; line-height: 1.55; }
body :is(.footer-top a:not(.brand),.footer-position,.footer-email,.footer-bottom a) { font-size: 16px !important; line-height: 1.55; overflow-wrap: break-word; }
body :is(.email-large,.footer-email) { max-width: 100%; overflow-wrap: anywhere; }
body .technical-detail summary h2 { font-size: 19px !important; }
body .study-hero-code { font-size: clamp(32px,4vw,48px); }

/* A compact header; scaling only, never a different logo. */
.phase1-header .header-inner { min-height: 88px; padding-top: 10px; padding-bottom: 10px; gap: 20px; }
.phase1-header .brand.legacy-brand { width: 210px; max-width: 210px; }
.phase1-header .brand.legacy-brand img { width: 100%; height: auto; object-fit: contain; }
.phase1-header .phase1-nav { flex: 1; min-width: 0; gap: 12px; }
.phase1-header .phase1-nav :is(a,button,summary) {
  font-size: 16px !important; font-weight: 600 !important; line-height: 1.4 !important;
  white-space: normal; overflow-wrap: break-word;
}
.phase1-header .phase1-nav>a { min-width: 0; padding: 11px 0; }
.phase1-header .phase1-nav .nav-contact { padding: 10px 13px; min-height: 44px; }
.phase1-header .phase1-services-menu summary { min-height: 44px; padding: 11px 0; }
.phase1-header .capability-menu { max-width: min(340px,calc(100vw - 40px)); }
.phase1-header .capability-menu small { font-size: 12px; line-height: 1.5; }
.site-footer .brand.legacy-brand { width: 230px; max-width: 100%; }
.admin-shell .admin-nav { flex-wrap: wrap; overflow: visible; }
.admin-shell .admin-nav :is(a,summary) { font-size: 16px !important; min-height: 44px; white-space: normal; }
.admin-shell :is(.admin-table th,.admin-table td,.admin-data-list dt,.admin-data-list dd) { font-size: 16px; overflow-wrap: anywhere; }
.admin-shell .admin-table-wrap { max-width: 100%; }
.admin-shell :is(.admin-account-name,.admin-status,.admin-role,.admin-reference) { overflow-wrap: anywhere; }
.admin-shell .admin-nav-menu { min-width: 0; width: 260px; max-width: calc(100vw - 36px); }

@media (max-width: 1180px) {
  .phase1-header .header-inner {
    display: grid; grid-template-columns: minmax(0,1fr) auto;
    gap: 8px 14px; min-height: 78px; padding-top: 8px; padding-bottom: 8px;
  }
  .phase1-header .brand.legacy-brand { width: 195px; max-width: 100%; }
  .phase1-header .menu-toggle { display: inline-flex; font-size: 16px; gap: 8px; padding: 8px 11px; }
  .phase1-header .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0; width: auto;
    display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    padding: 14px var(--gutter) 20px; margin: 0; gap: 3px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: min(70vh,640px); max-height: min(70dvh,640px);
    overflow-y: auto; overscroll-behavior: contain;
    box-shadow: 0 14px 24px #102e3512;
  }
  .js .phase1-header .primary-nav { display: none; }
  .js .phase1-header .primary-nav.is-open { display: flex; }
  .phase1-header .phase1-nav :is(a,button,summary) { font-size: 17px !important; line-height: 1.45 !important; text-align: left; min-height: 44px; }
  .phase1-header .phase1-nav>a { padding: 10px 0; max-width: 100%; }
  .phase1-header .phase1-nav .nav-contact { align-self: stretch; margin: 7px 0 0; justify-content: center; }
  .phase1-header .capability-menu { position: static; width: 100%; max-width: none; margin: 0 0 8px; padding: 9px 16px; box-shadow: none; }
  .phase1-header .phase1-services-menu summary { justify-content: space-between; }
  html:not(.js) .phase1-header { position: static; }
  html:not(.js) .phase1-header .primary-nav { position: static; grid-column: 1/-1; max-height: none; overflow: visible; box-shadow: none; padding: 12px 0; }
  html:not(.js) .phase1-header .menu-toggle { display: none; }
  .admin-shell .admin-nav { gap: 0; padding-inline: 18px; }
  .admin-shell .admin-nav-menu { position: static; width: 100%; max-width: 100%; box-shadow: none; }
}

@media (max-width: 1024px) {
  .phase1-form-layout { grid-template-columns: 1fr; }
  .phase1-form-aside { position: static; }
  .admin-shell .admin-filter-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-shell .admin-field-search { grid-column: 1/-1; }
  .admin-shell .admin-table-wrap { border: 0; background: transparent; }
  .admin-shell .admin-table { min-width: 0; width: 100%; }
  .admin-shell .admin-table.table-labelled thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .admin-shell .admin-table.table-labelled :is(tbody,tr,td) { display: block; width: 100%; }
  .admin-shell .admin-table.table-labelled tr { padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--admin-line); background: #fff; }
  .admin-shell .admin-table.table-labelled td { padding: 10px 0; }
  .admin-shell .admin-table.table-labelled td[data-label]::before { content: attr(data-label); display: block; font-weight: 600; font-size: 14px; color: var(--admin-slate); margin-bottom: 4px; }
}

@media (max-width: 760px) {
  body.phase1-public, body.admin-shell { font-size: 16px; }
  body :is(main p,main li,.lead,.phase1-form-aside p,.phase1-submit-row p,
    .admin-boundary p,.admin-detail-card p,.admin-empty p) { font-size: 16px !important; line-height: 1.65 !important; }
  .phase1-header .header-inner { min-height: 70px; padding: 7px 18px; }
  .phase1-header .brand.legacy-brand { width: 170px; max-width: calc(100vw - 124px); }
  .site-footer .brand.legacy-brand { width: 190px; }
  .phase1-review-strip { font-size: 12px; padding: 8px 18px; }
  .phase1-review-strip a { margin-left: 4px; }
  body :is(h1,.page-hero h1,.phase1-hero h1,.phase1-coming-soon h1,.phase1-auth-card h1,.admin-page-intro h1) { font-size: clamp(27px,6.7vw,32px) !important; }
  body .hybrid-hero h1 { font-size: clamp(32px,8vw,37px) !important; }
  body .modality-hero h1 { font-size: clamp(23px,6.1vw,29px) !important; }
  body :is(h2,.section-heading h2,.article-section h2,.feedback-copy h2,.showcase-copy h2,
    .future-section h2,.contact-band h2,.phase1-form-heading h2,.overview-intro h2) { font-size: clamp(24px,6vw,28px) !important; }
  body :is(h3,.capability-card h3,.quick-capability h3,.evoked-card h3,.patient-panel h3) { font-size: 21px !important; }
  body :is(.eyebrow,.footer-top h2,.article-aside h2,figcaption) { font-size: 12px !important; }
  .quick-capability-grid .quick-capability { grid-template-columns: 85px minmax(0,1fr); }
  .quick-capability-copy { padding: 16px; }
  .quick-capability .text-link { display: flex; align-items: flex-start; }
  .quick-capability .text-link svg { width: 18px; height: 18px; margin-top: 4px; }
  .phase1-field-grid,.admin-shell .admin-filter-form { grid-template-columns: 1fr; }
  .phase1-form-aside { display: block; }
  .phase1-form-panel { margin: 0; padding: 22px 18px; border-inline: 1px solid var(--line); }
  .phase1-coming-soon,.phase1-auth-card { padding: 26px 20px; }
  .phase1-submit-row { display: block; }
  .phase1-submit-row .button { width: 100%; justify-content: center; }
  .phase1-submit-row p { margin-top: 16px; }
  .hero-foundation { flex-wrap: wrap; }
  .admin-shell .admin-brand img { width: 145px; max-height: none; }
  .admin-shell .admin-account-name { max-width: 140px; white-space: normal; overflow: visible; text-overflow: clip; }
  .admin-shell .admin-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-shell .admin-nav :is(a,summary) { font-size: 16px !important; padding: 10px 8px; }
  .admin-shell .admin-nav-group[open] { grid-column: 1/-1; }
  .admin-shell .admin-field-search { grid-column: auto; }
  .admin-shell .admin-opportunity-actions :is(form,a,button) { max-width: 100%; }
  .admin-shell .admin-footer { font-size: 14px; }
  body :is(.phase1-recovery-codes code,.admin-data-list dd,.admin-reference) { overflow-wrap: anywhere; word-break: break-word; }
}

@media (min-width:1181px) {
  .phase1-header .phase1-nav { gap: 10px; }
  .phase1-header .phase1-nav>a { min-width: min-content; overflow-wrap: normal; }
  .phase1-header .phase1-nav>a:first-child { flex-shrink: 0; white-space: nowrap; }
  .phase1-header .phase1-services-menu summary { overflow-wrap: normal; }
}

/* October29 alignment pass: shared rails and genuine local overflow repairs. */
.phase1-header .header-inner,
.admin-shell .admin-header-inner,
.admin-shell .admin-nav { max-width: 1440px; }
.phase1-field select[multiple] :is(optgroup, option) {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  max-width: 100% !important;
}
.phase1-field select[multiple] optgroup { font-weight: 500; }
.admin-shell .admin-pagination :is(nav, nav > div, nav > div > div, nav > div > div > span) {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}
.admin-shell .admin-action-code { white-space: normal; overflow-wrap: anywhere; }
:is(.hero-layout, .positioning-layout, .showcase-layout, .professional-layout,
  .feedback-layout, .page-hero-inner, .admin-detail-heading, .admin-document-card) > * { min-width: 0; }
@media (min-width: 541px) and (max-width: 900px) {
  .site-footer .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .site-footer .footer-top > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .admin-shell .admin-header-inner { gap: 10px; }
  .admin-shell .admin-account { gap: 4px; }
  .admin-shell .admin-account-name { max-width: 100px; overflow-wrap: anywhere; }
}

/* Result-count text is not a pagination button. */
.admin-shell .admin-pagination nav > div:last-child > div:first-child span {
  display: inline;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
}
.admin-shell .admin-pagination nav > div:last-child > div:first-child { margin-bottom: 10px; }
.admin-shell .admin-pagination nav > div:last-child > div:first-child p { margin-bottom: 0; }

/* Mobile footer polish only; preserve logo and all wider-screen styles. */
@media (max-width: 760px) {
  .site-footer .footer-top > div { min-width: 0; }
  .site-footer :is(.footer-top a:not(.brand), .footer-position, .footer-bottom a) {
    font-size: 15px !important;
    line-height: 1.5;
  }
  .site-footer .footer-top h2 { margin-bottom: 8px; }
  .site-footer .footer-top > div > a:not(.brand) {
    display: flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    padding-block: 6px;
    margin-bottom: 0;
  }
  .site-footer .footer-top .footer-email {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .site-footer .footer-note {
    max-width: 100%;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
  }
  .site-footer .footer-bottom nav {
    gap: 0 16px;
    min-width: 0;
    max-width: 100%;
  }
  .site-footer .footer-bottom nav a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    white-space: nowrap;
  }
}

@media (max-width: 540px) {
  .site-footer .footer-top { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* Desktop-only polish: shared rails, card baselines and form hierarchy. */
@media (min-width: 1181px) {
  .phase1-header .phase1-nav .nav-contact { white-space: nowrap !important; }
  .phase1-public .container.article-layout { max-width: 1440px; }
  .phase1-public main > .container.section { padding-inline: var(--gutter); }
  .phase1-public .p1-pathways a small { margin-top: auto; }
  .phase1-public .quick-capability { display: flex; flex-direction: column; }
  .phase1-public .quick-image-link { flex: 0 0 auto; }
  .phase1-public .quick-capability-copy { display: flex; flex-direction: column; flex: 1; }
  .phase1-public .quick-capability h3 { min-height: 2.56em; }
  .phase1-public .quick-capability .text-link { align-self: flex-start; margin-top: auto; }
  .phase1-public :is(.phase1-fieldset, .phase1-acknowledgements) legend {
    font-size: 20px !important;
    line-height: 1.35;
  }
  .phase1-public .phase1-form-aside h2 { font-size: 24px !important; line-height: 1.25; }
  .phase1-public .phase1-form-aside p { font-size: 16px !important; line-height: 1.55 !important; }
}
