/* Shared layout corrections, loaded after the existing page styles. */
@media screen {
  :root { --site-header-height: 84px; }
  html { scroll-padding-top: calc(var(--site-header-height) + 20px); }
  .shell { min-width: 0; width: 100%; padding-inline: clamp(16px, 4vw, 58px); }
  .page :is(h1, h2, h3, h4), .modal-body :is(h2, h3, h4) {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .page :is(.lead, .caption, .callout, .legal-content, .prose, .source-language-note) {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  :is(.content-layout, .document-grid, .engine-grid, .archive-stats) > *,
  :is(.section-head, .toolbar, .catalog-controls, .catalog-pager, .archive-tools, .footer-top, .footer-bottom) > * {
    min-width: 0;
  }
  :is(.source-list, .source-file-register) li > div { min-width: 0; }
  :is(.source-list, .source-file-register) :is(a, code) { overflow-wrap: anywhere; }
  .btn, .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .tag { line-height: 1.6; }
  .btn { text-align: center; line-height: 1.55; }
  .hero-actions .btn, .btn:not(.outline):not(.lime), .cs-hero .cs-button,
  #subscription #subscription-submit {
    background-image: linear-gradient(#0100052e, #0100052e), var(--gradient-pink);
    color: var(--white);
  }
  .analysis-release .ar-card-actions .btn {
    background-image: linear-gradient(#0100052e, #0100052e), var(--gradient-brand);
  }
  .hero-actions .btn:hover, .btn:not(.outline):not(.lime):hover, .cs-hero .cs-button:hover {
    background-image: linear-gradient(#0100052e, #0100052e), var(--gradient-brand);
  }
  .research-masthead .eyebrow { color: var(--pink-hot); }
  .toolbar { flex-wrap: wrap; }
  .search-field { min-width: 0; max-width: 100%; }
  .catalog-controls, .catalog-pager, .archive-tools, .footer-bottom { flex-wrap: wrap; }
  .catalog-row summary { align-items: flex-start; }
  .catalog-row summary > span { min-width: 0; overflow-wrap: anywhere; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engine-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .workflow { grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr); }
  .workflow-box { min-width: 0; overflow-wrap: anywhere; }
  .risk-strip { flex-wrap: wrap; }
  .risk-strip > span:not(.risk-label) { min-width: 0; flex: 1 1 240px; }
  .risk-strip > a { white-space: normal; }
  .footer-links a { min-height: 44px; display: inline-flex; align-items: center; overflow-wrap: anywhere; }
  .footer-bottom > * { max-width: 100%; overflow-wrap: anywhere; }

  /* Header controls remain usable on small phones and short landscape screens. */
  .header-inner { min-height: 84px; height: auto; gap: 16px; }
  .header .logo { min-width: 0; }
  .header .icon-button { width: 44px; height: 44px; flex: 0 0 44px; }
  .header .language-picker { min-width: 0; }
  .header #site-language { width: 96px; max-width: 100%; min-height: 44px; font-size: 16px; padding-inline: 3px; }
  .header .navigation { overscroll-behavior: contain; }
  .header .navigation a { overflow-wrap: anywhere; }
  .header .navigation.open {
    max-height: calc(100vh - var(--site-header-height) - 20px);
    max-height: calc(100dvh - var(--site-header-height) - 20px);
    overflow-y: auto;
  }

  /* Native dialogs scroll themselves; original tables scroll locally. */
  dialog.modal {
    box-sizing: border-box;
    width: min(1060px, calc(100% - 24px));
    max-width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0;
  }
  dialog.modal.search-modal { width: min(640px, calc(100% - 24px)); }
  dialog.modal.archive-modal { width: min(1120px, calc(100% - 24px)); }
  .modal-head { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: flex-start; }
  .modal-head .caption { min-width: 0; overflow-wrap: anywhere; }
  .modal-head .icon-button { flex: 0 0 44px; width: 44px; height: 44px; }
  .modal-body { min-width: 0; padding: clamp(16px, 3vw, 33px); }
  .modal-body > * { max-width: 100%; }
  .modal-body :is(select, input:not([type=checkbox]):not([type=radio]), textarea) { min-width: 0; max-width: 100%; }
  .modal-body .tabs { flex-wrap: wrap; }
  .modal-body .tab { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
  .archive-meta :is(div, dt, dd), .archive-document-info, .archive-related > button, .search-result {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .table-wrap, .rr-journal-table, .cs-table-wrap, .ap-reader-table { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  [data-scroll-region]:focus-visible { outline: 2px solid var(--pink-hot); outline-offset: -2px; }
  .archive-document :is(pre, .table-wrap), .archive-raw { max-width: 100%; overflow-x: auto; }
  .archive-document-picker select { max-width: 100%; min-width: 0; }
  #global-search { width: 100%; min-width: 0; max-width: 100%; }

  #subscription :is(form, fieldset, .signup-grid, .signup-company, .signup-profile-options) { min-width: 0; }
  #subscription .signup-profile label { min-width: 0; overflow-wrap: anywhere; }
  #subscription .signup-time { flex-wrap: wrap; }
  #subscription .consent { align-items: flex-start; }
  #subscription .consent > span { min-width: 0; overflow-wrap: anywhere; }
  #subscription :is(select, input:not([type=checkbox]):not([type=radio])) { min-width: 0; max-width: 100%; }
}
@media screen and (max-width: 1380px) {
  .header .navigation { top: 100%; }
  .header .navigation a { white-space: normal; }
}
@media screen and (max-width: 920px) {
  /* research-design.css previously restored narrow two-column heroes. */
  .research-hero { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .release-terminal { min-width: 0; max-width: 100%; }
  .hero-copy h1 { font-size: clamp(42px, 8vw, 74px); }
  .content-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .side-index { position: static; max-width: none; }
  .side-index nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
  .side-index nav a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .document-grid { grid-template-columns: minmax(0, 1fr); }
  .engine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 680px) {
  :root { --site-header-height: 72px; }
  .shell { padding-inline: 16px; }
  .header-inner { min-height: 72px; gap: 8px; }
  .header .logo-name { font-size: 26px; letter-spacing: -1.4px; }
  .header .logo-name small { font-size: 7px; letter-spacing: .12em; }
  .header .language-picker { margin-left: auto; gap: 3px; }
  .header #site-language { width: 86px; }
  .header .header-search { margin-left: 0; }
  .topline .shell { flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; padding-block: 7px; line-height: 1.6; }
  .risk-strip { gap: 8px 12px; }
  .risk-strip > span:not(.risk-label) { flex-basis: calc(100% - 88px); }
  .risk-strip > a { margin-left: 0; }
  .hero-copy h1 { font-size: clamp(38px, 9.5vw, 60px); line-height: 1.08; }
  .page-intro h1 { font-size: clamp(32px, 8.5vw, 46px); line-height: 1.14; }
  .page-intro, .section { padding-block: 36px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .section-head h2 { font-size: clamp(28px, 7.5vw, 36px); line-height: 1.15; }
  .modal-body h2 { font-size: clamp(28px, 7.8vw, 38px); line-height: 1.15; }
  .toolbar, .catalog-controls { align-items: stretch; }
  .toolbar .tabs { flex-wrap: wrap; }
  .tab { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
  .public-research-metrics { gap: 16px; }
  .public-research-metrics a { min-width: 0; }
  .public-research-metrics span { font-size: 10px; overflow-wrap: anywhere; }
  .public-dossier .hero-actions { min-width: 0; width: 100%; flex-wrap: wrap; }
  .public-dossier .hero-actions > * { max-width: 100%; }
  .document-card { padding: 22px 18px; }
  .document-card .actions { align-items: stretch; }
  .footer-top, .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-links { gap: 4px 18px; }
  .footer-links a { font-size: 12px; }
  .archive-filters { grid-template-columns: minmax(0, 1fr); }
  .archive-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .archive-stat { min-width: 0; padding: 16px 10px; }
  .archive-stat span { display: block; font-size: 10px; overflow-wrap: anywhere; }
  #subscription .subscription-panel { padding: 22px 18px; }
  #subscription h2 { font-size: clamp(32px, 8.8vw, 44px); overflow-wrap: anywhere; }
  #subscription .signup-grid { grid-template-columns: minmax(0, 1fr); }
  #subscription .signup-profile-options { flex-direction: column; }
  #subscription .signup-company { padding: 14px; }
  #subscription .signup-field :is(input, select) { font-size: 16px; }
  .page :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea),
  .modal :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) { font-size: 16px; }
}
@media screen and (max-width: 440px) {
  .header .language-picker svg { display: none; }
  .header #site-language { width: 84px; }
  .header .logo-name small { letter-spacing: .07em; }
  .workflow { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .workflow-arrow { transform: rotate(90deg); justify-self: center; }
  .engine-grid { grid-template-columns: minmax(0, 1fr); }
  .engine-card { border-left: 0; border-top: 1px solid var(--line); }
  .archive-meta { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .catalog-pager > .caption { flex-basis: 100%; order: 3; }
  .btn { gap: 10px; }
  .model-intro h1, .performance-intro h1 { font-size: clamp(31px, 8.5vw, 37px); line-height: 1.14; }
  .public-research-metrics { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .public-research-metrics a { display: flex; align-items: center; gap: 18px; }
  .public-research-metrics span { margin-top: 0; max-width: none; }
}
@media screen and (max-height: 500px) {
  .header-inner { min-height: 60px; }
  :root { --site-header-height: 60px; }
  .modal-head { padding-block: 12px; }
  .header .navigation.open { padding-block: 8px; }
  .side-index { position: static; }
}
