/* Shared small-screen behavior for the evidence pages and archived demos. */
@media (max-width: 700px) {
  main, main > *, section, .controls, .controls > *, .cards, .card { min-width: 0; }
  button, .button, summary, input, select { touch-action: manipulation; }
  button, .button, summary { min-height: 44px; }
  select, input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea { font-size: 16px; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]) { min-height: 44px; }
  select { min-height: 44px; max-width: 100%; }
  input[type=range] { min-height: 44px; }
  label:has(input[type=checkbox]), label:has(input[type=radio]) { min-height: 44px; cursor: pointer; }
  header:not(.topbar):not(.travel-head) .brand { display: inline-flex; align-items: center; min-height: 44px; }
  header nav[aria-label=Demo] { gap: 6px 12px; }
  header nav[aria-label=Demo] a { display: inline-flex; align-items: center; min-height: 44px; }
  .more-nav > summary { min-height: 44px; }
  .more-nav > div { min-width: min(280px, calc(100vw - 36px)); max-width: calc(100vw - 36px); max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; }
  .more-nav a, .more-nav button { min-height: 44px; white-space: normal; line-height: 1.5; }
  .controls > label { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .controls label:has(input[type=range]) { flex-basis: 100%; width: 100%; }
  .controls label:has(input[type=checkbox]), .controls label:has(input[type=radio]) { flex: 0 1 auto; min-width: 0; }
  .controls select, .controls input[type=range] { width: 100%; min-width: 0; max-width: 100%; }
  .controls .check, .controls .toggle { padding: 4px 0; }
  .controls input[type=checkbox], .controls input[type=radio] { flex: 0 0 auto; }
  .sample-actions, .sample-actions > label, .trace-risk-controls, .trace-risk-controls > label { min-width: 0; max-width: 100%; }
  .sample-actions label { flex-basis: 100%; }
  .trace-risk select { width: 100%; min-width: 0; max-width: 100%; }
  .trace-risk label { min-width: 0; }
  .trace-risk-controls > label:last-child { min-width: 0; width: 100%; }
  .cards > .card { display: block; overflow-wrap: anywhere; }
  .cards > .card small { max-width: none; }
  .cards > .card strong { margin-top: 8px; white-space: normal; }
  .card .button { display: flex; align-items: center; justify-content: space-between; white-space: normal; line-height: 1.5; min-height: 44px; }
  .table-scroll { max-width: 100%; overscroll-behavior-x: contain; }
  .next, footer { gap: 12px 20px; flex-wrap: wrap; }
  .next a, footer a { display: inline-flex; align-items: center; min-height: 44px; }
  dialog { max-width: calc(100vw - 24px); max-height: 85dvh; padding: 18px; }
  .dialog-head { align-items: flex-start; gap: 12px; }
  .dialog-head h2 { overflow-wrap: anywhere; }
  .dialog-head button { flex-shrink: 0; min-width: 44px; }
  .rg-detail-values { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .rg-detail-values dd { margin-bottom: 12px; }
  .retrieval-plot svg text { font-size: 24px; }
  .frontier-picker { display: grid; gap: 8px; margin: 24px 0; }
  .frontier-picker select { width: 100%; min-width: 0; }
  .topbar, .topbar-end, .travel-head { min-width: 0; max-width: 100%; }
  .topbar-end { flex-wrap: wrap; gap: 6px 10px; flex-basis: 100%; margin-left: 0; }
  .topbar .brand, .topbar .text-btn, .travel-head > a { display: inline-flex; align-items: center; min-height: 44px; }
  .topbar .controls select { max-width: 100%; }
  .topbar .icon-btn { min-width: 44px; min-height: 44px; }
  .step-rail { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; overflow: visible; }
  .step-rail li { min-width: 0; }
  .step-rail li + li::before { display: none; }
  .step-rail .step-btn { width: 100%; min-height: 44px; padding: 8px; white-space: normal; text-align: left; }
  .step-btn .n { flex-shrink: 0; }
  .density-legend { flex-wrap: wrap; row-gap: 8px; }
  .sheet-inner { padding: 16px; max-height: 85dvh; }
  .w-row { grid-template-columns: minmax(0,1fr) 100px; }
  .topology .node .node-label { font-size: 15px; }
  .topology .node .node-status { font-size: 13px; }
  .topology .node .node-tag { font-size: 12px; }
  .travel-head { flex-wrap: wrap; }
  .travel-head > a { white-space: normal; }
  .travel-head > div { flex-wrap: wrap; }
  .travel-controls label { min-width: 0; }
  .travel-controls select { height: auto; min-height: 44px; }
  .intake-card .readiness-options label { padding: 8px 0; }
}
@media (max-width: 700px) {
  .metric-row select, .effect-head select { min-height: 44px; }
  svg .plot-label { font-size: 26px; }
  svg .plot-sub, svg .plot-number { font-size: 24px; }
}

@media (max-width: 750px) {
 .research-page #research-risk-graph { height: auto; }
 .research-page .risk-model-label { font-size: 14px; }
 .research-page .risk-model-value { font-size: 20px; }
 .research-page .risk-model-small { font-size: 13px; }
}
