/* Shared workbench typography. One UI scale and a separate long-form reading scale.
 * Serif reading + sans-serif UI; no remote font request.
 * Windows falls back to SimSun; macOS to Songti SC. Installed Noto/Source Han
 * fonts take precedence. Keep operational metadata readable at 12px or above.
 */
:root {
  --font-ui: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-reading: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN",
    "Songti SC", STSong, SimSun, Georgia, "Times New Roman", serif;
  --type-page: 24px;
  --type-section: 18px;
  --type-story: 18px;
  --type-card: 17px;
  --type-reading: 16.5px;
  --type-prose: 18px;
  --type-ui: 14px;
  --type-support: 13px;
  --type-meta: 12px;
  font-family: var(--font-ui);
}

body,
body .main-content,
body .overview-page,
body[data-opinion-prefix] {
  font-family: var(--font-ui);
  font-size: var(--type-ui);
}

body :is(button, input, select, textarea),
body .main-content :is(button, input, select, textarea),
body[data-opinion-prefix] :is(button, input, select, textarea) {
  font-family: var(--font-ui);
}

/* Chrome, filters and actions stay sans-serif, separate from reading text. */
body .sidebar .nav-item,
body .workspace-submenu .nav-item,
body .main-content .button,
body .topbar .button,
body .main-content :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
body .main-content :is(.analysis-tabs a, .prep-tabs a),
body[data-opinion-prefix] :is(.button, input:not([type="checkbox"]), select, textarea) {
  font-size: var(--type-ui);
}

body .sidebar :is(.nav-group-label, .nav-label, .logout-button),
body .topbar :is(.breadcrumb, .health-pill, .last-sync),
body .site-footer,
body[data-opinion-prefix] :is(.topbar, .sidebar-foot, footer) {
  font-size: var(--type-meta);
}

/* Page and section headings belong to the UI; documents keep reading typography. */
body .main-content :is(.page-heading h1, .compact-heading h1, .overview-welcome-line h1),
body[data-opinion-prefix] .page-heading h1,
body.login-page .login-card-heading h1 {
  font-family: var(--font-ui);
  font-size: var(--type-page);
  font-weight: 600;
  font-synthesis: weight;
  line-height: 1.35;
}

body .main-content :is(.panel-header h2, .feed-toolbar h2, .section-heading h2,
  .pipeline-heading h2, .schedule-summary h2, .analysis-report-header h2,
  .analysis-task-status-line h2, .overview-section-heading h2, .overview-about h2),
body[data-opinion-prefix] :is(.panel h2, .section-heading h2) {
  font-family: var(--font-ui);
  font-size: var(--type-section);
  font-weight: 600;
  font-synthesis: weight;
  line-height: 1.5;
}

body .main-content :is(.analysis-task-card h2,
  .analysis-material-list h3, .analysis-task-question, .material-preview-heading h2),
body[data-opinion-prefix] :is(.source-card .section-heading h2, .mention-heading h2,
  .report-row strong, .dimension-grid h3, .method-grid h3, .dimension-detail h3,
  .event-card h3) {
  font-family: var(--font-ui);
  font-size: var(--type-card);
  font-weight: 600;
  font-synthesis: weight;
  line-height: 1.5;
}

/* Lists are for scanning; the opened text uses the long-form reading scale. */
body .main-content .intel-item h2 {
  font-family: var(--font-ui);
  font-size: var(--type-story);
  font-weight: 600;
  font-synthesis: weight;
  line-height: 1.4;
}

/* Keep multilingual titles in the same interface family. */
body .main-content .intel-item [data-material-title] {
  font-family: var(--font-ui);
}

body .main-content .material-title-translation[data-title-status="ready"] {
  font-family: var(--font-ui);
  font-size: var(--type-story);
  font-weight: 600;
  font-synthesis: weight;
  line-height: 1.6;
}

/* Introductory text follows the reference homepage's 16.5px lead summary. */
body .main-content :is(.overview-headline, .overview-positioning,
  .overview-about p, .overview-about li),
body[data-opinion-prefix] :is(.lead-text, .finding p, .readable-list) {
  font-family: var(--font-reading);
  font-size: var(--type-reading);
  font-weight: 400;
  line-height: 1.8;
}

/* The reference article reader uses 18px; preserve comfortable long-form text. */
body .main-content :is(.material-preview-copy, .analysis-model-output,
  .analysis-report-section, .analysis-report-section li p,
  .analysis-evidence-result li p, .analysis-material-evidence),
body[data-opinion-prefix] :is(.mention-text, .report-document, .report-document pre,
  .report-document p, .report-document li) {
  font-family: var(--font-reading);
  font-size: var(--type-prose);
  font-weight: 400;
  line-height: 1.85;
}

body .main-content :is(.analysis-report-section h3, .analysis-evidence-result h4,
  .analysis-material-evidence h4),
body[data-opinion-prefix] .report-document :is(h1, h2, h3, h4) {
  font-family: var(--font-reading);
  font-size: var(--type-section);
  font-weight: 700;
  font-synthesis: weight;
  line-height: 1.5;
}

body .main-content .analysis-report-section :is(h4, h5),
body[data-opinion-prefix] .report-document :is(h3, h4) {
  font-size: var(--type-card);
}

/* Tables remain UI text: scanning sources, dates and queue state is not prose. */
body .main-content :is(table, .source-cell strong, .endpoint-identity strong,
  .endpoint-section strong, .endpoint-frequency strong),
body[data-opinion-prefix] table {
  font-family: var(--font-ui);
  font-size: var(--type-ui);
}

body .main-content :is(.heading-kicker, .panel-eyebrow, .result-count,
  .filters label > span, .filter-help, .item-tags span, .intel-index > span,
  .intel-index time, .intel-meta, .source-button, .material-preview-button,
  .material-title-translation.is-pending, .material-title-translation.is-unavailable,
  .material-content-state, .muted-small, th, .cell-subline,
  .outline-tag, .mode-tag, .status, .content-access-status, .source-cell small,
  .settings-form > label span, .running-indicator, .latest-run-heading > span,
  .run-kpis span, .run-progress-label, .run-id, .run-time, .run-detail-header,
  .source-run-row, .source-run-row strong, .source-run-row .status,
  .selection-row-meta, .analysis-task-id, .analysis-task-card-meta,
  .analysis-material-meta, .analysis-task-facts dt, .analysis-citations,
  .material-preview-kicker, .material-preview-meta, .material-preview-footer,
  .material-preview-footer a, .preview-label, .material-preview-status) {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
}

body .main-content td::before {
  font-size: var(--type-meta);
}

/* Preparation pages were outside the older workspace typography layer. */
body .main-content :is(.prep-policy-strip strong, .prep-policy-strip p span,
  .prep-system-notice, .prep-connection-notice, .prep-metrics span, .prep-metrics small,
  .prep-filters label > span, .prep-run-filters label > span, .prep-bulk-form,
  .prep-noscript-note, .prep-table th, .prep-material-cell > span,
  .prep-material-cell > em, .prep-cell-note, .prep-table time, .prep-state,
  .prep-row-actions .button, .prep-detail-list dt, .prep-detail-list dd,
  .prep-detail-callout strong, .prep-detail-callout p, .prep-detail-statuses > div > span,
  .prep-quality-grid dt, .prep-reason-list code, .prep-reason-list strong,
  .prep-reason-list p, .prep-receipt-note, .prep-detail-empty, .prep-attempt-index,
  .prep-attempt-list strong, .prep-attempt-list p, .prep-attempt-list small) {
  font-size: var(--type-meta);
}

body .main-content .prep-material-cell > a,
body .main-content .prep-material-cell > strong {
  font-family: var(--font-reading);
  font-size: var(--type-reading);
  line-height: 1.5;
}

body.login-page .login-intro h2 {
  font-family: var(--font-reading);
  font-weight: 700;
  font-synthesis: weight;
}

body.login-page :is(.login-field label, .login-card-eyebrow, .login-eyebrow) {
  font-family: var(--font-ui);
  font-size: var(--type-support);
}

body.login-page :is(.login-field input, .login-submit) {
  font-family: var(--font-ui);
  font-size: 16px;
}

@media (max-width: 760px) {
  :root {
    --type-page: 22px;
    --type-story: 17px;
    --type-reading: 16px;
    --type-prose: 17px;
  }

  /* Keep mobile form text legible and avoid browser focus zoom. */
  body .main-content :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
  body[data-opinion-prefix] :is(input:not([type="checkbox"]), select, textarea) {
    font-size: 16px;
  }
}
