/* TensorLynx · Surrogate modelling and uncertainty assessment. Page-only styles, scoped under .tx-p-sur. */
.tx-p-sur { --sur-c: var(--accent); --sur-a: var(--accent-2); --sur-g: #8b97a1; --sur-r: var(--diag); --sur-ok: #4fd18b; }

/* ---- shared SVG vocabulary ---- */
.tx-p-sur svg { font-family: var(--font-mono); }
.tx-p-sur .sur-t { font-size: 16px; fill: var(--text-secondary); letter-spacing: .02em; }
.tx-p-sur .sur-t--lg { font-family: var(--font-sans); font-size: 20px; font-weight: 600; }
.tx-p-sur .sur-t--ink { fill: var(--text-primary); }
.tx-p-sur .sur-t--muted { fill: var(--text-secondary); }
.tx-p-sur .sur-t--c { fill: var(--sur-c); }
.tx-p-sur .sur-t--a { fill: var(--sur-a); }
.tx-p-sur .sur-t--g { fill: #c3ccd3; }
.tx-p-sur .sur-t--r { fill: var(--sur-r); }
.tx-p-sur .sur-plotbg { fill: rgba(255,255,255,.015); stroke: var(--border-subtle); }
.tx-p-sur .sur-trainzone { fill: rgba(57,208,224,.05); }
.tx-p-sur .sur-st-c { stop-color: var(--sur-c); stop-opacity: .3; }
.tx-p-sur .sur-st-a { stop-color: var(--sur-a); stop-opacity: .3; }
.tx-p-sur .sur-st-g { stop-color: var(--sur-g); stop-opacity: .12; }
.tx-p-sur .sur-hatch { stroke: rgba(139,151,161,.28); stroke-width: 2; }
.tx-p-sur .sur-hero-pts circle, .tx-p-sur .sur-legend-pt { fill: var(--surface-0); stroke: var(--text-primary); stroke-width: 2.5; }
.tx-p-sur .sur-hero-mean { fill: none; stroke: var(--sur-c); stroke-width: 3; stroke-linecap: round; }
.tx-p-sur .sur-hero-mean--off { stroke: var(--sur-g); stroke-dasharray: 3 9; stroke-width: 2.5; opacity: .7; }
.tx-p-sur .sur-tick { stroke: var(--border-strong); stroke-width: 2; }
.tx-p-sur .sur-tick--a { stroke: var(--sur-a); }
.tx-p-sur .sur-route-line { fill: none; stroke: var(--sur-c); stroke-width: 2.5; }
.tx-p-sur .sur-solver { fill: var(--accent-soft); stroke: var(--accent-border); stroke-width: 1.5; }
.tx-p-sur .sur-mesh path { fill: none; stroke: var(--sur-c); stroke-width: 1.6; stroke-linejoin: round; }
.tx-p-sur .sur-legend-band { fill: rgba(57,208,224,.3); }
.tx-p-sur .sur-box { fill: var(--surface-2); stroke: var(--border-strong); }
.tx-p-sur .sur-box--tray { stroke: rgba(242,163,58,.45); stroke-dasharray: 6 6; fill: transparent; }
.tx-p-sur .sur-box--verdict { stroke: rgba(255,90,78,.5); fill: rgba(255,90,78,.06); }

/* ---- hero ---- */
.tx-p-sur .sur-h1 { max-width: 20ch; }
.tx-p-sur .sur-hero-frame { aspect-ratio: 600 / 500; min-height: 0; }
.tx-p-sur .sur-hero-band { stroke: none; transform-box: fill-box; transform-origin: 50% 50%; animation: sur-tighten 1.4s var(--ease-out) .9s both; }
.tx-p-sur .sur-hero-prior { fill: rgba(139,151,161,.12); opacity: 0; animation: sur-prior 2.2s var(--ease-out) both; }
.tx-p-sur .sur-hero-void { animation: sur-fade .8s var(--ease-out) 2s both; }
.tx-p-sur .sur-hero-pts circle { animation: sur-drop .7s var(--ease-out) calc(.15s + var(--i, 0) * 90ms) both; transform-box: fill-box; transform-origin: center; }
.tx-p-sur .sur-hero-mean--on { stroke-dasharray: 1; animation: sur-draw 1.6s var(--ease-out) 1s both; }
.tx-p-sur .sur-hero-gate .sur-gate-post { stroke: var(--sur-g); stroke-width: 2; stroke-dasharray: 4 6; }
.tx-p-sur .sur-gate-bar { fill: #c3ccd3; transform-box: fill-box; }
.tx-p-sur .sur-gate-bar--top { animation: sur-gate-top 1s var(--ease-out) 2.1s both; }
.tx-p-sur .sur-gate-bar--bot { animation: sur-gate-bot 1s var(--ease-out) 2.1s both; }
.tx-p-sur .sur-hero-route, .tx-p-sur .sur-hero-zones { animation: sur-fade .9s var(--ease-out) 2.5s both; }
.tx-p-sur .sur-q-line { stroke: var(--text-primary); stroke-width: 1.5; stroke-dasharray: 2 5; opacity: .6; }
.tx-p-sur .sur-q-dot { fill: var(--sur-c); stroke: var(--surface-0); stroke-width: 3; transition: opacity .3s; }
.tx-p-sur .sur-q-whisk { fill: none; stroke: var(--sur-c); stroke-width: 2.5; transition: opacity .3s; }
.tx-p-sur .sur-q[data-zone="edge"] .sur-q-dot { fill: var(--sur-a); }
.tx-p-sur .sur-q[data-zone="edge"] .sur-q-whisk { stroke: var(--sur-a); }
.tx-p-sur .sur-q[data-zone="out"] .sur-q-dot, .tx-p-sur .sur-q[data-zone="out"] .sur-q-whisk { opacity: 0; }
.tx-p-sur .sur-chip rect { fill: rgba(10,12,15,.92); stroke: var(--sur-c); stroke-width: 1.5; transition: stroke .3s; }
.tx-p-sur .sur-chip-t { font-size: 17px; fill: var(--sur-c); letter-spacing: .04em; transition: fill .3s; }
.tx-p-sur .sur-chip[data-zone="edge"] rect { stroke: var(--sur-a); }
.tx-p-sur .sur-chip[data-zone="edge"] .sur-chip-t { fill: var(--sur-a); }
.tx-p-sur .sur-chip[data-zone="out"] rect { stroke: #c3ccd3; stroke-dasharray: 5 4; }
.tx-p-sur .sur-chip[data-zone="out"] .sur-chip-t { fill: #e2e7ea; }
.tx-p-sur .sur-q, .tx-p-sur .sur-chip { animation: sur-fade .6s var(--ease-out) 1.8s both; }
.tx-p-sur .sur-ctl { display: none; align-items: center; gap: .9rem; margin-top: .6rem; font-size: var(--step-xs); color: var(--text-secondary); font-family: var(--font-mono); }
.js .tx-p-sur .sur-ctl { display: flex; }
.tx-p-sur .sur-ctl input { flex: 1; accent-color: var(--accent); min-width: 0; }
.tx-p-sur .sur-ctl input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }
.tx-p-sur .sur-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tx-p-sur .sur-cap { margin-top: .7rem; font-size: var(--step-xs); color: var(--text-secondary); display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }

@keyframes sur-tighten { from { opacity: 0; transform: scaleY(1.9); } to { opacity: 1; transform: none; } }
@keyframes sur-prior { 0% { opacity: 1; } 55% { opacity: .9; } 100% { opacity: 0; } }
@keyframes sur-fade { from { opacity: 0; } }
@keyframes sur-drop { from { opacity: 0; transform: translateY(-26px) scale(.4); } }
@keyframes sur-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sur-gate-top { from { transform: translateY(-80px); opacity: 0; } }
@keyframes sur-gate-bot { from { transform: translateY(80px); opacity: 0; } }

/* ---- problem ---- */
.tx-p-sur .sur-pull { font-size: var(--step-md); color: var(--text-primary); border-left: 3px solid var(--accent-2); padding-left: 1rem; margin-top: 1.6rem; }
.tx-p-sur .sur-prob-band { fill: rgba(57,208,224,.22); }
.tx-p-sur .sur-prob-model { fill: none; stroke: var(--sur-c); stroke-width: 3; }
.tx-p-sur .sur-prob-truth { fill: none; stroke: var(--text-primary); stroke-width: 2.5; stroke-dasharray: 1; }
.tx-p-sur .sur-prob-legend { stroke-dasharray: none; }
.tx-p-sur .sur-prob-miss line { stroke: var(--sur-r); stroke-width: 3; }
.tx-p-sur .sur-prob-miss circle { fill: var(--sur-r); }
.tx-p-sur .sur-prob-miss, .tx-p-sur .sur-prob-misslabel { opacity: clamp(0, calc(var(--p, 1) * 4 - 2.4), 1); transition: opacity .3s; }
.tx-p-sur .sur-prob-misslabel { fill: var(--sur-r); }
.tx-p-sur .sur-prob-fig [data-tx-scrub-path] { stroke-dashoffset: calc(1 - min(1, var(--p, 1) * 1.7)); }
.tx-reduced .tx-p-sur .sur-prob-fig [data-tx-scrub-path] { stroke-dashoffset: 0; }
.tx-p-sur .sur-kpis { margin-top: 1.4rem; }
.tx-p-sur .sur-kpis .tx-kpi-v { font-size: var(--step-xl); }
.tx-p-sur .sur-kpis a, .tx-p-sur .tx-muted a { color: var(--accent); text-decoration: none; }
.tx-p-sur .sur-note { margin-top: .8rem; font-size: var(--step-xs); color: var(--text-secondary); display: flex; gap: .6rem; flex-wrap: wrap; align-items: baseline; }

/* ---- how: sticky stage scenes ---- */
.tx-p-sur .sur-stage svg { max-height: 100%; }
.tx-p-sur .sur-scene { opacity: 0; transition: opacity .55s var(--ease-out); pointer-events: none; }
.tx-p-sur .sur-steps[data-active="1"] .sur-scene--1, .tx-p-sur .sur-steps[data-active="2"] .sur-scene--2,
.tx-p-sur .sur-steps[data-active="3"] .sur-scene--3, .tx-p-sur .sur-steps[data-active="4"] .sur-scene--4,
.tx-p-sur .sur-steps[data-active="5"] .sur-scene--5, .tx-p-sur .sur-steps[data-active="6"] .sur-scene--6 { opacity: 1; }
.tx-p-sur .sur-rib rect { fill: var(--surface-2); stroke: var(--border-subtle); transition: fill .4s, stroke .4s; }
.tx-p-sur .sur-rib text { font-size: 15px; fill: var(--text-secondary); transition: fill .4s; }
.tx-p-sur .sur-steps[data-active="1"] .sur-rib--1 rect, .tx-p-sur .sur-steps[data-active="2"] .sur-rib--2 rect,
.tx-p-sur .sur-steps[data-active="3"] .sur-rib--3 rect, .tx-p-sur .sur-steps[data-active="4"] .sur-rib--4 rect,
.tx-p-sur .sur-steps[data-active="5"] .sur-rib--5 rect, .tx-p-sur .sur-steps[data-active="6"] .sur-rib--6 rect { fill: var(--accent); stroke: var(--accent); }
.tx-p-sur .sur-steps[data-active="1"] .sur-rib--1 text, .tx-p-sur .sur-steps[data-active="2"] .sur-rib--2 text,
.tx-p-sur .sur-steps[data-active="3"] .sur-rib--3 text, .tx-p-sur .sur-steps[data-active="4"] .sur-rib--4 text,
.tx-p-sur .sur-steps[data-active="5"] .sur-rib--5 text, .tx-p-sur .sur-steps[data-active="6"] .sur-rib--6 text { fill: var(--text-on-accent); font-weight: 600; }

/* scene 1: rows slide through the status filter */
.tx-p-sur .sur-row rect { fill: var(--surface-2); stroke: var(--border-subtle); }
.tx-p-sur .sur-row--no rect { stroke: rgba(242,163,58,.45); stroke-dasharray: 4 4; }
.tx-p-sur .sur-filter { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 10 6; }
.tx-p-sur .sur-pass { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .7; }
.tx-p-sur .sur-scene--1 .sur-row { transition: translate .7s var(--ease-out) calc(var(--i) * 60ms), opacity .7s; }
/* `translate`, not `transform`: the rows are placed by their SVG transform attribute, which a CSS transform would replace. */
.js .tx-p-sur .sur-steps:not([data-active="1"]) .sur-scene--1 .sur-row { translate: -30px 0; }
/* scene 2: bars grow on entry */
.tx-p-sur .sur-bar rect { fill: var(--border-strong); transform-box: fill-box; transform-origin: left center; transition: transform .8s var(--ease-out) calc(var(--i) * 50ms); }
.tx-p-sur .sur-bar--win rect { fill: var(--accent); }
.tx-p-sur .sur-bar--win text { fill: var(--text-primary); }
.js .tx-p-sur .sur-steps:not([data-active="2"]) .sur-bar rect { transform: scaleX(.05); }
/* scene 3: the band opens to its calibrated width */
.tx-p-sur .sur-raw-band { fill: rgba(57,208,224,.35); }
.tx-p-sur .sur-cal-band { fill: rgba(57,208,224,.14); stroke: var(--accent-border); stroke-dasharray: 5 5; transform-box: fill-box; transform-origin: 50% 50%; transition: transform 1s var(--ease-out) .25s, opacity .8s .25s; }
.js .tx-p-sur .sur-steps:not([data-active="3"]) .sur-cal-band { transform: scaleY(.3); opacity: 0; }
.tx-p-sur .sur-held circle { fill: none; stroke: var(--accent-2); stroke-width: 2.5; }
/* scene 4: meters */
.tx-p-sur .sur-meter-track { fill: var(--surface-2); stroke: var(--border-subtle); }
.tx-p-sur .sur-meter-pass { fill: rgba(79,209,139,.22); }
.tx-p-sur .sur-meter-bar { stroke: var(--border-strong); stroke-width: 2; }
.tx-p-sur .sur-meter-target { stroke: var(--accent-2); stroke-width: 2.5; stroke-dasharray: 5 4; }
.tx-p-sur .sur-meter-ci { stroke: var(--sur-r); stroke-width: 5; stroke-linecap: round; }
.tx-p-sur .sur-meter-val { stroke: var(--surface-0); stroke-width: 3; }
.tx-p-sur circle.sur-t--c { fill: var(--sur-c); }
.tx-p-sur circle.sur-t--r { fill: var(--sur-r); }
.tx-p-sur .sur-scene--4 .sur-meter { transition: opacity .6s var(--ease-out); }
/* scene 5: domain */
.tx-p-sur .sur-range { fill: none; stroke: var(--border-strong); stroke-dasharray: 6 5; }
.tx-p-sur .sur-cloud circle { fill: var(--text-secondary); opacity: .75; }
.tx-p-sur .sur-nn { stroke-width: 2; stroke-dasharray: 3 4; }
.tx-p-sur .sur-nn--a { stroke: var(--accent-2); }
.tx-p-sur .sur-nn--g { stroke: #c3ccd3; }
.tx-p-sur .sur-qpt circle { fill: none; stroke-width: 3.5; }
.tx-p-sur .sur-qpt--c circle { stroke: var(--sur-c); }
.tx-p-sur .sur-qpt--a circle { stroke: var(--sur-a); }
.tx-p-sur .sur-qpt--g circle { stroke: #c3ccd3; stroke-dasharray: 4 3; }
.tx-p-sur .sur-steps[data-active="5"] .sur-qpt circle { animation: sur-ping 2.4s var(--ease-out) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sur-ping { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
/* scene 6: labels */
.tx-p-sur .sur-lab rect { fill: var(--surface-2); stroke-width: 1.5; }
.tx-p-sur .sur-lab--c rect { stroke: var(--accent); }
.tx-p-sur .sur-lab--a rect { stroke: var(--accent-2); }
.tx-p-sur .sur-lab--g rect { stroke: #8b97a1; stroke-dasharray: 5 4; }
.tx-p-sur .sur-scene--6 .sur-lab { transition: transform .6s var(--ease-out) calc(var(--i) * 80ms); }
.js .tx-p-sur .sur-steps:not([data-active="6"]) .sur-lab { transform: translateX(-24px); }
.tx-reduced .tx-p-sur .sur-scene * { transform: none !important; }

/* ---- depth ---- */
.tx-p-sur .sur-depth { margin-top: 2.4rem; }
.tx-p-sur .sur-gate-fig svg { padding: 1rem .5rem .2rem; }
.tx-p-sur .sur-tower { fill: var(--surface-0); stroke: var(--border-strong); stroke-width: 1.5; }
.tx-p-sur .sur-lamp { outline: none; }
.tx-p-sur .sur-lamp-ring { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 2; transition: stroke .3s; }
.tx-p-sur .sur-lamp-glass { fill: rgba(79,209,139,.18); stroke: var(--sur-ok); stroke-width: 2.5; animation: sur-lamp 6s ease-in-out infinite; }
.tx-p-sur .sur-lamp--2 .sur-lamp-glass { animation-delay: 1.5s; }
.tx-p-sur .sur-lamp--3 .sur-lamp-glass { animation-delay: 3s; fill: rgba(242,163,58,.18); stroke: var(--accent-2); }
.tx-p-sur .sur-lamp--4 .sur-lamp-glass { animation-delay: 4.5s; fill: rgba(57,208,224,.18); stroke: var(--accent); }
.tx-p-sur .sur-lamp:hover .sur-lamp-ring, .tx-p-sur .sur-lamp:focus-visible .sur-lamp-ring { stroke: var(--accent-2); stroke-width: 3; }
.tx-p-sur .sur-lamp:focus-visible .sur-t--lg { fill: var(--accent-2); text-decoration: underline; }
@keyframes sur-lamp { 0%, 30%, 100% { stroke-width: 2.5; } 12% { stroke-width: 8; } }
.tx-p-sur .sur-panel { animation: sur-fade .45s var(--ease-out); }
.tx-p-sur .sur-panel p, .tx-p-sur .sur-panel li { font-size: var(--step-sm); }
.tx-p-sur .sur-eq { font-family: var(--font-mono); font-size: var(--step-sm); color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: .8rem 1rem; overflow-x: auto; }
.tx-p-sur .sur-eq a { color: var(--accent); text-decoration: none; }
.tx-p-sur .sur-small { font-size: var(--step-xs) !important; color: var(--text-secondary); margin-top: 1rem; }
.tx-p-sur .sur-bars td, .tx-p-sur .sur-bars th { padding: .7rem .8rem; }
.tx-p-sur .sur-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- proof ---- */
.tx-p-sur .sur-proof { margin-top: 2.4rem; align-items: center; }
.tx-p-sur .sur-proof figure svg { padding: .8rem .4rem 0; }
.tx-p-sur .sur-cov-pass { fill: rgba(79,209,139,.12); }
.tx-p-sur .sur-axis { stroke: var(--border-strong); stroke-width: 1.5; }
.tx-p-sur .sur-cov-ci { fill: none; stroke: var(--sur-r); stroke-width: 4; stroke-linecap: round; }
.tx-p-sur .sur-cov-pt { fill: var(--sur-r); stroke: var(--surface-1); stroke-width: 3; }
.tx-p-sur .sur-proof-cards { display: grid; gap: 1rem; }
.tx-p-sur .sur-proof-cards .tx-card p { font-size: var(--step-sm); }
.tx-p-sur .sur-proof-cards .tx-badge { margin-left: .3rem; vertical-align: middle; }
.tx-p-sur .sur-callout { margin-top: 2rem; }
.tx-p-sur .sur-callout p { margin: 0; }
.tx-p-sur .sur-facts { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.tx-p-sur .sur-facts li { display: flex; gap: 1rem; align-items: baseline; padding: 1rem 1.2rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-0); font-size: var(--step-sm); color: var(--text-secondary); }
.tx-p-sur .sur-facts-n { font-size: var(--step-xl); font-weight: 600; color: var(--text-primary); letter-spacing: -.02em; }

/* ---- value ---- */
.tx-p-sur .sur-subh { margin-top: 3rem; }
.tx-p-sur .sur-apps { margin-top: 1rem; }
.tx-p-sur .sur-app { padding: 1.2rem 1.3rem; border-top: 2px solid var(--accent-border); }
.tx-p-sur .sur-app-k { font-family: var(--font-mono); font-size: var(--step-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); }
.tx-p-sur .sur-app p { color: var(--text-secondary); font-size: var(--step-sm); margin: .5rem 0 0; }
.tx-p-sur .sur-cmp { margin-top: 2.6rem; }
.tx-p-sur .sur-links { margin-top: 2rem; max-width: 72ch; color: var(--text-secondary); }
.tx-p-sur .sur-links a, .tx-p-sur .tx-step a { color: var(--accent); }

@media (max-width: 999px) {
  .tx-p-sur .sur-stage { aspect-ratio: 640 / 540; }
}
@media (prefers-reduced-motion: reduce) {
  .tx-p-sur .sur-scene * { transform: none !important; }
  .tx-p-sur .sur-prob-fig [data-tx-scrub-path] { stroke-dashoffset: 0; }
}
