/* OS RESET v2 (2026-07-20) — readability layer, loaded AFTER each page's inline styles so it wins.
   Source of every rule: ops/research/OS-RESET-SPEC-2026-07-20.md (D2 type scale, D3 overflow, D7 a11y).
   Impeccable rules cited: skill-color-verify-contrast, skill-typo-line-length.
   Vercel Web Interface Guidelines cited: tabular numbers, resilient content, no dead ends.
   check-os-readability.py enforces this layer stays applied. */

/* D2: kill the sub-11px microcap system. Every 7-10px label promotes to >= 11px. */
.cs-lab, .cs-gate-lbl, .ac-tag, .lane-badge, .as, .task-st, .gc-venture,
.tick-lab, .sk-runtime, .invoke-out .tag, .ot,
details.sec-detail summary, details.sec-detail summary::before,
.cs-anchor, .sec-num, .sf-nav-section-label, .sf-pal-group, #sf-nav-kbtn kbd {
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
}
.ph h2 { font-size: 13px !important; letter-spacing: 0.06em !important; }
.sec-title { font-size: 15px !important; letter-spacing: 0.06em !important; }
.cs-name { letter-spacing: 0.12em !important; }

/* D2: content prose floors. */
.pb, .ac-why, .ac-steps, .gc-desc, .lane-funnel, .task-text, .drill-body, .fc-stage, .fc-pct { font-size: 13px !important; line-height: 1.55 !important; }
.ac-title, .gc-title { font-size: 15px !important; line-height: 1.4 !important; }
table { font-size: 13px !important; }

/* D2: AA contrast. --faint (#6E7E8F ~3.9:1) is decorative-only; body copy uses readable ink. */
:root { --text-2: #4B5563; }
.pb, .ac-why, .gc-desc, .task-text, .lane-funnel, .fc-stage { color: var(--text-2) !important; }
.freshness { font-size: 11px !important; color: var(--text-2) !important; }

/* D2: numerics always tabular (WIG). */
.hv, .kpi-v, .fc-pct, .lane-metric, .cs-mrr, .cs-item, .num { font-variant-numeric: tabular-nums; }

/* D3: overflow contract. Tables + wide content scroll inside their own container; URLs wrap. */
.scroll-x { overflow-x: auto; max-width: 100%; }
.pb a, .drill-body a, .links a { word-break: break-word; overflow-wrap: anywhere; }
.ac-tag, .as { overflow: hidden; text-overflow: ellipsis; max-width: 18ch; }
.task-text { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* D7: focus visibility + reduced motion (WIG). */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--sf-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* D1: sidebar text bump for readability. */
#sf-nav-sidebar { font-size: 14px !important; }
#sf-nav-sidebar .sf-nav-venture-head { font-size: 13.5px !important; }

/* R4 walk round 2: remaining sub-11px classes found by the live font probe. */
.cs-gate-badge, .cs-ts, .conn-pill, .conn-pill *, .ac-toggle, .lane-sub, .lane-seen,
.lane-expand-btn, .funnel-row *, .fc-row *, #sf-palette-foot span, .drill-src a {
  font-size: 11px !important;
}
/* Tables inside panels scroll in place instead of widening the page (D3). */
.panel table, .pb table { display: block; overflow-x: auto; max-width: 100%; }
/* progress: entries with long unbroken tokens (commit ids, filenames) wrap. */
.entry, .entry *, .prog-body, .prog-body * { overflow-wrap: anywhere; }
/* keep readable column widths; wrapping above handles the wide tokens */

/* R4 walk round 3: final sub-11px classes + grid clamps for 390px. */
.meta, .at, .an, .tick-badge, .footnote, .src, .agent-row *, .log-tail, .log-tail * {
  font-size: 11px !important;
}
.footnote, .src { line-height: 1.5 !important; }
/* Grids must never force tracks wider than the viewport (390px case). */
.funnel-analytics { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)) !important; }
.lanes { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)) !important; }
.gate-cards { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)) !important; }
.skill-cards { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)) !important; }
.kpis, .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)) !important; }
.fc-bar, .fc-fill { max-width: 100% !important; }
.action-card, .ac-head, .rail, .rail a { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }

/* R4 walk round 4: one-click skill rows + inline-styled micro text. */
.sk-invoke, .sk-copy-btn { font-size: 11px !important; }
[style*="font-size: 8px"], [style*="font-size:8px"],
[style*="font-size: 9px"], [style*="font-size:9px"],
[style*="font-size: 10px"], [style*="font-size:10px"] { font-size: 11px !important; }

/* R4 walk round 5: last two. */
.ostat, .ostat *, #orchStat { font-size: 11px !important; }
.kpis > *, .kpi-grid > * { min-width: 0; overflow-wrap: anywhere; }

/* R4 walk round 6: step numerals, source-footer tags, live pills. Complete. */
.ac-steps li .n, .src-item, .src-item *, .src-footer, .src-footer *, .ok, .err, .warn {
  font-size: 11px !important;
}
