/* Responsive guard for recovered page families.
   The recovered rules carry the original fixed-column grids, which were
   written before the current breakpoints. Rather than hand-editing every
   recovered grid, collapse multi-column layouts below the tablet breakpoint
   and let genuinely wide data scroll inside its own container. */

@media (max-width: 900px) {
  .stack-row, .stack-grid, .gen-grid, .dim-gen-grid, .substrate-grid,
  .belief-grid, .metric-grid, .stat-row, .compass, .ashby,
  .theory-grid, .mode-grid, .arch-grid, .spectrum, .to-grid,
  .pi-grid, .leg-asks, .cluster, .dim-row, .exec-grid {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }
  .stack-row > *, .gen-grid > *, .substrate-grid > *, .belief-grid > * { min-width: 0 !important; }
}

@media (max-width: 820px) {
  /* Any recovered element still asserting a wide minimum yields. */
  .stack-card, .gen-card, .theory-card, .substrate-card, .belief-card,
  .stat-card, .policy-box, .dim-gen-card, .metric, .scenario, .product-card {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }
  /* Wide analytical tables scroll inside themselves rather than the page. */
  .indicators-table, .radar-table, .calls-table, .transition-table,
  table.rel, table.regtable {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 560px) {
  .stack-r, .ev-r, .lad, .cyc, .reg-r, .integ-r, .princ-r, .dl-r {
    grid-template-columns: 1fr !important;
  }
  /* Recovered inline SVG diagrams scale rather than clip. */
  svg { max-width: 100%; height: auto; }
}

/* Remaining recovered containers with hard minimums or flex rows that do not
   wrap. Named individually because each is a real layout, not a stray rule. */
@media (max-width: 900px) {
  .ashby { display: grid !important; grid-template-columns: 1fr !important; }
  .ashby-panel { min-width: 0 !important; max-width: 100% !important; }
  .tension, .tension-row { display: grid !important; grid-template-columns: 1fr !important; gap: 12px; }
  .tension-side { min-width: 0 !important; max-width: 100% !important; }
  .tension-vs { justify-self: start; }
  .arch-row { grid-template-columns: 1fr !important; gap: 6px; }
  .arch-go { text-align: left !important; }
}

@media (max-width: 900px) {
  /* Counters positioned to the right of a wider original container. */
  .ashby-items li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding-right: 0 !important; }
  .ashby-count { position: static !important; right: auto !important; flex: 0 0 auto; }
  .bm-card, .action-card { min-width: 0 !important; max-width: 100% !important; }
}

@media (max-width: 900px) {
  .cc-row, .cc-grid, .cc-panels { display: grid !important; grid-template-columns: 1fr !important; }
  .cc-panel { min-width: 0 !important; max-width: 100% !important; }
}

@media (max-width: 900px) {
  /* Charts drawn at a fixed pixel width in the original page CSS. */
  .constraint-chart, .chart-wrap, .curve, .payoff, .phase-chart {
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .constraint-chart > *, .chart-wrap > * { max-width: 100%; }
}

/* Shared interaction floor for recovered and intentionally archived pages.
   Current pages also receive these rules through fp1.css; keeping the guard
   complete prevents older page families from losing keyboard or motion care. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #2E7D63;
  outline-offset: 2px;
}

button, input:not([type="hidden"]), select, textarea, summary {
  min-height: 24px;
}

nav a, footer a, .actions a, .article-breadcrumb a, .article-nav a {
  min-height: 24px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 680px) {
  /* The recovered visualizations used 8–9 px metadata. Ten pixels is the
     absolute floor; form labels and footer headings get a more readable 11 px. */
  .hero-meta span, .legend-role, .status-pill, .scope-legend-item,
  .rotate-hint, .sd-conf, .sd-fals-label, .sd-hint,
  .pattern-correspondent-desk, .cycle-era, .cycle-collapse,
  .signal-cat, .signal-risk, .method-corr-desk, .c-names,
  .dispatch-desk, .eq-label, .eq-note-inline, .nc-desk, .nc-claim,
  .register-status, .ctype, .pq-attr, .dm-title, .dm-locates,
  .dm-fix-label, .dm-footnote, .readout-status, .rtl-title, .rtl-sub,
  .rtl-lsub, .rtl-hint, .rtl-play, .readout-tier, .readout-move,
  .readout-marker, .ledger-tier, .ledger-desk, .ledger-tag,
  .ledger-src, .verdict-chip, .nottripped, .band, .seam-desk-role,
  .seam-axis-desc, .seam-axis-state, body .bs-label, body .tl-sub, body .time-hint {
    font-size: 10px !important;
  }
  .input-group label, footer h5, footer .footer-motto span { font-size: 11px !important; }
}
