/* Shared presentation rules, loaded after the feature styles. */
:root {
  --reading-muted: #b8bbc0;
  --reading-line: #414448;
}
button, select, input, textarea { font: inherit; }
button, select, summary, .text-link { min-height: 44px; }
button, select { max-width: 100%; }
select { font-size: 16px; line-height: 1.5; }
button { line-height: 1.5; }
summary { line-height: 1.5; padding-block: 10px; }
summary:focus-visible { outline-offset: 3px; }
main p, main li { overflow-wrap: break-word; }
main h2, main h3, main h4 { text-wrap: pretty; }
.section-heading { align-items: flex-start; gap: 24px; }
.section-heading > * { min-width: 0; }
.section-heading > p { max-width: 440px; line-height: 1.7; }
.eyebrow, .mono { line-height: 1.7; }
.desk-small { font-size: 14px !important; line-height: 1.75 !important; color: var(--reading-muted) !important; }
.text-link, .source-link { text-underline-offset: 4px; }
.desktop-nav { gap: clamp(14px, 1.8vw, 28px); }
.desktop-nav a, .header-contact { white-space: nowrap; min-height: 44px; align-items: center; }
.brand { flex-shrink: 0; }
.mobile-nav:not([hidden]) { max-height: calc(100dvh - 86px); overflow-y: auto; }

/* Give the chart and its numbers usable space, without squeezing three panels. */
.desk-layout { grid-template-columns: 260px minmax(0, 1fr); }
.desk-main { padding: 28px; }
.evidence-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
.evidence-stats { border-left: 0; border-top: 1px solid var(--reading-line); padding: 24px 0 0; overflow: visible; }
.evidence-stats > label { margin-top: 14px; font-size: 14px; }
.evidence-stats select { max-width: 360px; font: 16px/1.5 var(--sans); min-height: 48px; padding: 11px 12px; }
.evidence-stats .desk-small { font-size: 14px !important; }
.mandate-panel { padding: 24px; }
.mandate-panel h3 { font-size: 26px; line-height: 1.3; }
.mandate-panel > p, .mandate-facts p { font-size: 14px; line-height: 1.7; }
.mandate-panel select { font: 16px/1.5 var(--sans); min-height: 48px; padding: 11px 8px; }
.mandate-panel label, .carry-lab label, .dc-controls label {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 6px 16px; font-size: 14px; line-height: 1.6;
}
.mandate-panel output, .carry-lab output, .dc-controls output {
  float: none; flex-shrink: 0; font: 14px/1.6 var(--mono); font-variant-numeric: tabular-nums; color: #eee;
}
input[type="range"] { min-height: 44px; accent-color: #eee; }
.desk-primary, .desk-secondary { font-size: 14px; min-height: 46px; }
.desk-intro span { font-size: 14px; }
.desk-chart-head h3 { font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.chart-choices { display: flex; gap: 6px; margin-top: 16px; }
.chart-choices button { font-size: 14px; padding: 10px 14px; border-color: #414448; min-height: 44px; }
.chart-choices button[aria-pressed="true"] { background: #e9e9e7; color: #111; border-color: #e9e9e7; }
.chart-legend-overlay, .yen-legend { font-size: 13px; line-height: 1.6; gap: 10px 20px; }
.chart-legend-overlay > span { min-width: 0; }
.chart-under { font: 13px/1.7 var(--mono); min-height: 58px; }
.chart-under span { font-size: 12px; color: #b4b7bb; }
.chart-tooltip { font-size: 13px; width: 310px; min-width: 0; max-width: calc(100% - 8px); padding: 12px; }
.chart-tooltip div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding-block: 3px; }
.chart-tooltip span { overflow-wrap: break-word; }
.chart-tooltip b { font-variant-numeric: tabular-nums; }
.market-chart { height: 330px; }

/* Real table semantics, consistent precision and room for complete numbers. */
.evidence-stats table, .candidate-table, .data-disclosure table {
  width: 100%; min-width: 0; border-collapse: collapse; table-layout: auto;
  font: 14px/1.55 var(--mono); font-variant-numeric: tabular-nums;
}
.evidence-stats caption, .candidate-table caption, .data-disclosure caption {
  position: static; width: auto; height: auto; clip-path: none; overflow: visible;
  text-align: left; padding: 0 0 14px; font: 13px/1.6 var(--mono); color: #b9bdc2;
}
.evidence-stats th, .evidence-stats td, .candidate-table th, .candidate-table td,
.data-disclosure th, .data-disclosure td {
  font: inherit; padding: 14px 12px; border-bottom: 1px solid #383b3e;
  text-align: right; vertical-align: middle; color: #c5c8cd;
  overflow-wrap: normal; word-break: normal; white-space: nowrap;
}
.evidence-stats th:first-child, .candidate-table th:first-child, .data-disclosure th:first-child {
  width: auto; text-align: left; font-size: inherit;
}
.evidence-stats th[scope="row"], .candidate-table th[scope="row"] { white-space: normal; font-weight: 400; }
.evidence-stats thead th, .evidence-stats thead tr:first-child th,
.candidate-table thead th, .data-disclosure thead th {
  font: 12px/1.6 var(--mono); font-weight: 400; color: #c2c6cc; background: #191b1e;
  padding: 12px; white-space: normal; border-block: 1px solid #45494e;
}
.evidence-stats tbody tr:first-child th { font: inherit; color: #c5c8cd; padding: 14px 12px; }
.evidence-stats td:nth-child(2) { color: #fff; }
.evidence-stats td:last-child { font-size: inherit; }
.evidence-stats tbody tr:hover, .data-disclosure tbody tr:hover { background: #ffffff06; }
.candidate-table { margin-top: 16px; }
.candidate-table tr[data-selected="true"] { background: #ffffff07; }
.table-selection { display: block; width: fit-content; margin-top: 5px; font: 12px/1.5 var(--sans); color: #e5e7e9; }
.data-disclosure { font-size: 14px; }
.data-disclosure summary { color: #d7dade; }
.data-scroll { max-width: 100%; max-height: 300px; overflow: auto; overscroll-behavior: contain; scrollbar-color: #777 #151719; }
.data-scroll:focus-visible { outline: 2px solid #d5d7da; outline-offset: 3px; }
.data-scroll table { min-width: 430px; }
.data-scroll thead { position: sticky; top: 0; z-index: 1; }
.data-scroll caption { padding-top: 4px; }
.data-disclosure #chart-data td:last-child { text-align: left; }
.review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.review-grid > article { min-width: 0; }
.review-grid ul, #agent-log { padding-left: 22px; font-size: 15px; line-height: 1.8; color: #bfc3c9; }
.review-grid li + li, #agent-log li + li { margin-top: 10px; }
.results-heading { flex-wrap: wrap; }
.results-heading h3 { line-height: 1.25; }
#run-summary { font-size: 14px; }
.result-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.result-metrics strong, .dc-metrics strong, .dc-folds strong, .yen-watch strong, .stress-result strong {
  font-variant-numeric: lining-nums tabular-nums;
}
.result-metrics span, .result-metrics small { font-size: 13px; line-height: 1.7; }

#historical-baseline .agent-bubble:empty { min-height: 0; padding-block: 0; margin-top: 0; border: 0; }

/* Market observations: value, units, change, date and source in a stable order. */
#global-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#global-grid article { display: flex; flex-direction: column; padding: 22px; }
#global-grid h3 { font-size: 15px; line-height: 1.5; min-height: 3em; margin: 0; }
#global-grid .indicator-value {
  font: 34px/1.25 var(--serif); font-variant-numeric: lining-nums tabular-nums;
  color: #f3f3f1; margin-top: 16px; overflow-wrap: normal; white-space: nowrap;
}
#global-grid article[data-state="unavailable"] .indicator-value { font-size: 27px; }
#global-grid .indicator-unit { margin-top: 4px; font-size: 14px; color: #c5c9ce; }
#global-grid .indicator-change, #global-grid .indicator-notice { font-size: 14px; line-height: 1.65; color: #b9bec5; margin: 16px 0; }
#global-grid .indicator-observation { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin: 0 0 10px; font: 13px/1.65 var(--mono); color: #c5c9ce; }
#global-grid .indicator-observation > span { font-size: 13px; }
#global-grid .indicator-observation time { white-space: nowrap; }
#global-grid .data-badge { display: inline-block; width: fit-content; border: 1px solid #64686d; padding: 2px 7px; color: #dce0e5; }
#global-grid article > a { margin-top: auto; padding: 12px 0 0; min-height: 44px; line-height: 1.7; }
.global-toolbar { flex-wrap: wrap; }
.global-toolbar button { min-height: 46px; border-color: #777; }
.status-grid { align-items: stretch; }
.status-grid article { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.status-grid h4 { margin: 0; font-size: 23px; line-height: 1.35; }
.status-grid p { margin: 0; font-size: 15px; }
.status-grid strong { font-size: 13px; line-height: 1.6; }
.status-grid a { margin-top: auto; min-height: 44px; padding-top: 12px; line-height: 1.6; }
#event-calendar strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.domino-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.domino-grid details { padding: 16px 20px; }
.domino-grid summary { font-size: 16px; line-height: 1.5; }
.domino-grid p + p { margin-top: 16px; }
.macro-toolbar, .macro-periods { flex-wrap: wrap; }
.macro-periods button { min-width: 48px; font-size: 14px; }
.yen-watch span, .yen-watch small { font-size: 13px; line-height: 1.65; }
.yen-legend small { font-size: 12px; }
#yen-source > span { display: block; margin-block: 5px; }
.yen-scenarios { gap: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scenario-buttons button { font-size: 14px; }
.carry-lab { padding: 24px; }
.stress-result { flex-wrap: wrap; gap: 12px; }
.stress-result span { font-size: 13px; }
.observed-marker::after { top: 42px; font-size: 12px; transform: translateX(calc(var(--observed-position, .5) * -100%)); }
.observed-track { margin-bottom: 32px; }

/* Research and supporting pages use the same quiet, readable hierarchy. */
.dc-controls > div { flex-basis: 200px; }
.dc-cost-control { min-width: 180px; }
.decennium-section .dc-meta, .dc-lens-status { font-size: 13px; line-height: 1.75; }
.dc-folds small, .dc-metrics small, .dc-metrics span { font-size: 13px; line-height: 1.65; }
.dc-heading h2 span { color: #a8a8a8; }
.dc-folds article { padding: 16px; }
.lab-tabs button { min-width: 0; font-size: 14px; }
.research-feature h3, .decision-grid h3 { line-height: 1.35; }
.decision-details summary { font-size: 22px; line-height: 1.5; }
.replication-links a { min-height: 44px; line-height: 1.7; }
.journal-entry summary { padding-right: 28px; }
.journal-entry summary > .eyebrow { display: block; padding-right: 64px; }
.journal-toggle { font-size: 13px; }
.contact-links > div { min-width: 0; }
.contact-links a { overflow-wrap: anywhere; }
.project-expand { height: auto; min-height: 44px; }

/* Light sections need their own ink colors; never inherit dark-panel labels. */
#overview .decision-grid p, #overview .research-meta { color: #484d52 !important; }
#overview .eyebrow, #overview .transfer-list span { color: #555a60; }
#overview .recruiter-grid p, #overview .profile-value p { color: #454b50; }
#overview .profile-footer > span, #overview .recruiter-grid p { font-size: 14px; }
#overview .decision-grid a, #overview .text-link { color: #17191c; }
#collaboration .collab-note, #collaboration .collab-principles span { font-size: 13px; color: #50555a; }
#collaboration .collab-heading p, #collaboration .eyebrow { color: #50555a; }
#collaboration textarea { font-size: 16px; }
.collab-principles { flex-wrap: wrap; line-height: 1.7; }

@media (max-width: 1100px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: block; min-height: 44px; }
  .header-contact { margin-left: auto; }
  #global-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-grid, .domino-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .desk-main { padding: 24px; }
  .mandate-panel { padding: 20px; }
  .review-grid { gap: 24px; }
  .evidence-stats th, .evidence-stats td { padding-inline: 8px; }
}
@media (min-width: 801px) and (max-width: 1100px) {
  .mobile-nav:not([hidden]) { top: 86px; }
}
@media (max-width: 900px) {
  .desk-layout { grid-template-columns: minmax(0, 1fr); }
  .mandate-panel { border-right: 0; border-bottom: 1px solid var(--reading-line); }
  .mandate-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .yen-workbench { grid-template-columns: minmax(0, 1fr); }
  .yen-watch { border-left: 0; border-top: 1px solid var(--reading-line); }
  #yen-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .yen-scenarios { grid-template-columns: minmax(0, 1fr); }
  .result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .site-header { gap: 12px; }
  .header-contact { display: none; }
  .mobile-nav:not([hidden]) { max-height: calc(100dvh - 76px); }
  .section-heading > p { max-width: none; }
  .section-heading > p br { display: none; }
  .desk-main, .yen-evidence { padding: 22px 16px; }
  .desk-results { padding: 24px 16px; }
  .review-grid, .status-grid, .domino-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-choices button { flex: 1; padding-inline: 10px; }
  .market-chart, .yen-chart { height: 290px; }
  .chart-under { min-height: 76px; }
  .evidence-stats select { max-width: 100%; }
  .candidate-table { font-size: 13px; }
  .candidate-table th, .candidate-table td { padding: 12px 8px; }
  .candidate-table thead th { padding: 10px 8px; }
  .dc-controls > div { flex-basis: 100%; }
  .dc-controls > button { flex: 1; }
  .lab-tabs { grid-template-columns: minmax(0, 1fr); }
  .lab-tabs button { text-align: left; }
  .lab-tabs button + button { border-left: 0; border-top: 1px solid var(--reading-line); }
  .carry-lab { padding: 20px; }
  .status-grid article { padding: 20px; }
}
@media (max-width: 600px) {
  #global-grid { grid-template-columns: minmax(0, 1fr); }
  #global-grid article { padding: 22px; }
  #global-grid h3 { min-height: 0; font-size: 16px; }
  #global-grid .indicator-value { font-size: 38px; margin-top: 12px; }
  #global-grid article[data-state="unavailable"] .indicator-value { font-size: 29px; }
  #global-grid .indicator-change { margin: 12px 0; }
  .evidence-stats table, .evidence-stats tbody { display: block; }
  .evidence-stats caption { display: block; }
  .evidence-stats thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .evidence-stats tbody tr { display: block; border-bottom: 1px solid #44484d; padding: 16px 0; }
  .evidence-stats tbody th[scope="row"], .evidence-stats tbody tr:first-child th {
    display: block; width: 100%; padding: 0 0 10px; border: 0;
    font: 16px/1.5 var(--serif); color: #f0f0ee; text-align: left;
  }
  .evidence-stats tbody td {
    display: flex; justify-content: space-between; gap: 18px; border: 0;
    padding: 5px 0; font-size: 14px; line-height: 1.6; white-space: nowrap;
  }
  .evidence-stats td::before { content: attr(data-label); font: 13px/1.7 var(--mono); color: #b2b7bf; white-space: normal; }
  .evidence-stats td:last-child { font-size: 14px; }
  .result-metrics strong { font-size: 27px; }
  .result-metrics article { min-width: 0; padding: 18px 10px; }
  .result-metrics article:nth-child(odd) { padding-left: 0; }
  .dc-metrics strong { font-size: 25px; }
}
@media (max-width: 380px) {
  .brand-sub { display: none; }
  .recruiter-opening h1 { font-size: 2.9rem; }
  .mandate-facts, #yen-metrics { grid-template-columns: minmax(0, 1fr); }
  .dc-metrics > div { grid-template-columns: minmax(0, 1fr); }
  .dc-metrics strong { white-space: normal; }
}
