/* BitSize Statistical Tests — builds on python_patterns/patterns.css + python_data/data.css (the same
   lesson components) with a deep-cyan accent, the testviz.js pictures and the Test Atlas. */
.px.tt, .px-panel.tt { --px-accent: #0E7490; --px-accent-2: #06B6D4; --px-soft-bg: #E6F6FA;
  --tv-a: #2563EB; --tv-b: #EA580C; --tv-hit: #0E7490; --tv-out: #DC2626; --tv-ok: #15803D; --tv-soft: #94A3B8; --tv-ink: #0F1C22;
  --e-ratio: #0284C7; --e-var: #6D28D9; --e-count: #D97706; --e-rank: #059669; --e-exact: #DB2777;
  --l-less: #EA580C; --l-more: #2563EB; --l-same: #0F1C22; --l-limit: #0E7490; --l-follow: #64748B; --l-check: #DC2626; }
.px.tt code { background: #E3F2F6; }
.tt .px-callout--teal { background: #E6F6FA; border-color: #C3E6EF; color: #0B3D4C; }

/* ── tones ── */
.tv-tone-a { --c: var(--tv-a); } .tv-tone-b { --c: var(--tv-b); } .tv-tone-hit { --c: var(--tv-hit); }
.tv-tone-out { --c: var(--tv-out); } .tv-tone-ok { --c: var(--tv-ok); } .tv-tone-soft { --c: var(--tv-soft); }

/* ── a scene ── */
.tv-host { display: grid; gap: 10px; margin: 4px 0 2px; align-content: start; }   /* held tall by steady.js: spare room goes below */
.tv-svg { display: block; width: 100%; height: auto; background: #fff; border: 1px solid #DCEBEF; border-radius: 14px; font-family: var(--px-mono); }
.tv-ctl { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(180deg, #F4FBFD, #E8F5F9); border: 1px solid #CFE8EF; transition: opacity .25s; }
.tv-host.is-locked .tv-ctl { opacity: .38; pointer-events: none; filter: saturate(.4); }
.tv-host.is-locked .tv-ctl::before { content: '🔒 Answer the prediction above to unlock the controls'; flex-basis: 100%; font-size: 12.5px; font-weight: 700; color: #0B3D4C; }
.tv-slider { display: grid; gap: 3px; min-width: 190px; flex: 1 1 190px; font-size: 12.5px; color: #475569; }
.tv-slider > span { display: flex; justify-content: space-between; gap: 8px; }
.tv-slider b { font: 800 13px var(--px-mono); color: var(--px-accent); }
.tv-slider input { width: 100%; accent-color: var(--px-accent); height: 22px; cursor: pointer; }
.tv-seg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tv-seg__lab { font-size: 12.5px; color: #475569; margin-right: 4px; }
.tv-seg button, .tv-btn { border: 1px solid #BFDDE6; background: #fff; color: #0F1C22; border-radius: 999px; padding: 5px 12px; font: 600 13px inherit; cursor: pointer; }
.tv-seg button.is-on { background: var(--px-accent); border-color: var(--px-accent); color: #fff; }
.tv-btn:hover, .tv-seg button:hover { border-color: var(--px-accent); }
.tv-btn--go { background: var(--px-accent); border-color: var(--px-accent); color: #fff; text-decoration: none; display: inline-block; }
.tv-btn:disabled { opacity: .5; cursor: wait; }
.tv-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tv-say { margin: 0; min-height: calc(4.5em + 24px); padding: 11px 14px; border-radius: 12px; background: #E6F6FA; border: 1px solid #C3E6EF; color: #0B3D4C; font-size: 15px; line-height: 1.5; }

/* svg marks */
.tv-curve { fill: none; stroke: var(--c, var(--tv-ink)); stroke-width: 2.2; stroke-linejoin: round; }
.tv-curve.is-ghost { stroke: #94A3B8; stroke-width: 1.6; stroke-dasharray: 5 4; }
.tv-area { fill: var(--c, var(--tv-hit)); fill-opacity: .42; }
.tv-area.is-light { fill-opacity: .12; }
.tv-tone-soft.tv-area { fill-opacity: .3; }
.tv-axis { stroke: #94A3B8; stroke-width: 1.2; }
.tv-tick { font-size: 11px; fill: #64748B; }
.tv-lab { font-size: 12px; font-weight: 700; fill: var(--c, #334155); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.tv-big { font-size: 17px; font-weight: 800; fill: var(--c, #0F1C22); }
.tv-vline { stroke: var(--c, #334155); stroke-width: 2.4; }
.tv-vline.is-ghost { stroke-dasharray: 4 4; opacity: .6; }
.tv-dot { fill: var(--c, var(--tv-a)); fill-opacity: .72; stroke: #fff; stroke-width: 1; }
.tv-dot.is-dim { fill-opacity: .22; }
.tv-ring { fill: none; stroke: #0F1C22; stroke-width: 1.8; }
.tv-mean { stroke: var(--c); stroke-width: 3.4; stroke-linecap: round; }
.tv-bar { fill: var(--c, #64748B); fill-opacity: .7; }
.tv-ghost { fill: none; stroke: #64748B; stroke-width: 1.4; stroke-dasharray: 4 3; }
.tv-tile { fill: var(--px-accent); fill-opacity: .85; }
.tv-band { fill: #94A3B8; fill-opacity: .22; }
.tv-ci { stroke: var(--c, #334155); stroke-width: 4; stroke-linecap: round; }
.tv-rank { font-size: 10px; font-weight: 800; fill: #fff; pointer-events: none; }

/* meters and tables */
.tv-meters { display: grid; gap: 7px; padding: 12px 14px; border: 1px solid #DCEBEF; border-radius: 14px; background: #fff; }
.tv-meter { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 66px; gap: 10px; align-items: center; font-size: 14px; }
.tv-meter__bar { position: relative; height: 22px; border-radius: 6px; background: #EEF3F5; overflow: hidden; }
.tv-meter__bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--c); transition: width .12s; }
.tv-meter__tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #0F1C22; }
.tv-meter__val { font: 800 14px var(--px-mono); text-align: right; }
.tv-meter__note { font-size: 12px; color: #64748B; }
.tv-ptable { display: flex; flex-wrap: wrap; gap: 6px; }
.tv-ptable span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 6px 11px; border-radius: 999px; border: 1px solid #DCEBEF; background: #fff; opacity: .6; }
.tv-ptable span.is-on { opacity: 1; border-color: var(--px-accent); box-shadow: 0 0 0 2px #E6F6FA; }
.tv-ptable b { font-family: var(--px-mono); }
.tv-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: #475569; }
.tv-legend span { display: inline-flex; gap: 6px; align-items: center; }
.tv-k { width: 11px; height: 11px; border-radius: 50%; background: var(--c); display: inline-block; }
.tv-k.is-ring { background: none; border: 2px solid #0F1C22; }
.tv-engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.tv-engines div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #DCEBEF; border-radius: 12px; background: #fff; font-size: 13px; }
.tv-engines b { font-size: 14px; }
.tv-engines span { color: #64748B; }
.tv-eng { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tv-eng-ratio { background: var(--e-ratio); fill: var(--e-ratio); } .tv-eng-var { background: var(--e-var); fill: var(--e-var); }
.tv-eng-count { background: var(--e-count); fill: var(--e-count); } .tv-eng-rank { background: var(--e-rank); fill: var(--e-rank); }
.tv-eng-exact { background: var(--e-exact); fill: var(--e-exact); }
.tv-glyph { display: block; width: 80px; height: 52px; flex: none; }

/* ── the Atlas ── */
.tv-atlas { display: block; font-family: var(--px-font, system-ui, sans-serif); }
.tv-atlas--mini, .tv-atlas--thumb { width: 100%; height: auto; }
.tv-band-row { fill: #F1F8FB; } .tv-band-1 { fill: #F0F8F3; } .tv-band-2 { fill: #FBF2F6; }
.tv-rowlab { font-size: 13px; font-weight: 800; fill: #475569; }
.tv-collab { font-size: 13px; font-weight: 800; fill: #0F1C22; }
.tv-colsub { font-size: 11.5px; fill: #64748B; }
.tv-colline { stroke: #DCE6EA; }
.tv-st { cursor: pointer; transition: opacity .2s; }
.tv-st rect { fill: #fff; stroke: #CBD8DD; stroke-width: 1.4; transition: stroke .2s, fill .2s; }
.tv-st text { font-size: 12px; fill: #0F1C22; pointer-events: none; }
.tv-st.is-soon rect { stroke-dasharray: 4 3; fill: #FAFCFD; }
.tv-st.is-soon text { fill: #64748B; }
.tv-st.is-passed rect { fill: #E6F6FA; stroke: var(--px-accent); }
.tv-st__tick { font-weight: 900; fill: var(--px-accent) !important; }
.tv-st:hover rect, .tv-st:focus rect { stroke: var(--px-accent); }
.tv-st:focus { outline: none; }
.tv-st.is-hub rect { stroke: #0F1C22; stroke-width: 2.6; }
.tv-st.is-best rect { stroke: var(--tv-ok); stroke-width: 3; fill: #E9F7EE; }
.tv-st.is-alt rect { stroke: var(--tv-ok); stroke-width: 1.8; stroke-dasharray: 4 3; }
.tv-st.is-tempt rect { stroke: var(--tv-out); stroke-width: 2.2; fill: #FDECEC; }
.tv-st.is-tempt text { text-decoration: line-through; }
.tv-st.is-lm rect { stroke: var(--e-var); stroke-width: 2.6; fill: #F1ECFC; }
.tv-edge { transition: opacity .25s; opacity: .45; }
.tv-edge path { fill: none; }
.tv-edge__line { stroke: var(--lc); stroke-width: 1.7; }
.tv-l-limit .tv-edge__line { stroke-dasharray: 2 4; }
.tv-l-check .tv-edge__line { stroke-dasharray: 6 4; }
.tv-l-follow .tv-edge__line { stroke-width: 1.2; }
.tv-edge__dbl { stroke: var(--lc); stroke-width: 5; }
.tv-edge__gap { stroke: #fff; stroke-width: 1.8; }
.tv-l-less { --lc: var(--l-less); } .tv-l-more { --lc: var(--l-more); } .tv-l-same { --lc: var(--l-same); }
.tv-l-limit { --lc: var(--l-limit); } .tv-l-follow { --lc: var(--l-follow); } .tv-l-check { --lc: var(--l-check); }
.tv-ar { fill: var(--lc); }
.tv-edge__lab { font-size: 11px; font-weight: 700; fill: var(--lc); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; opacity: 0; pointer-events: none; transition: opacity .25s; }
.tv-atlas.is-focus .tv-edge { opacity: .06; }
.tv-atlas.is-focus .tv-edge.is-on { opacity: 1; }
.tv-atlas.is-focus .tv-edge.is-on .tv-edge__line { stroke-width: 2.6; }
.tv-atlas.is-focus .tv-edge__lab.is-on { opacity: 1; }
.tv-atlas.is-focus .tv-st { opacity: .26; }
.tv-atlas.is-focus .tv-st.is-on { opacity: 1; }
.tv-atlas--thumb .tv-edge { opacity: .3; }
.tv-atlas--thumb .tv-st { cursor: default; }

/* the Atlas page */
.tt-atlas-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.tt-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #CFE0E6; background: #fff; border-radius: 999px; padding: 5px 12px; font: 600 13px inherit; color: #0F1C22; cursor: pointer; }
.tt-chip.is-on { border-color: #0F1C22; background: #EEF5F7; }
.tt-chip i { width: 20px; height: 0; border-top: 3px solid var(--lc); display: inline-block; }
.tt-chip i.dot { border-top-style: dotted; } .tt-chip i.dash { border-top-style: dashed; } .tt-chip i.dbl { border-top: 4px double var(--lc); }
.tt-map { overflow: auto; border: 1px solid #D5E6EC; border-radius: 16px; background: #fff; max-height: 78vh; -webkit-overflow-scrolling: touch; cursor: grab; }
.tt-map.is-drag { cursor: grabbing; user-select: none; }
.tt-zoom { display: inline-flex; gap: 4px; margin-left: auto; }
.tt-zoom button { width: 34px; height: 30px; border-radius: 8px; border: 1px solid #CFE0E6; background: #fff; font: 700 15px inherit; cursor: pointer; }
.tt-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 820px) { .tt-panel { grid-template-columns: 1fr; } }
.tt-card { background: #fff; border: 1px solid #DCEBEF; border-radius: 16px; padding: 16px 18px; }
.tt-card h2, .tt-card h3 { margin: 0 0 8px; }
.tt-sel { display: grid; gap: 6px; }
.tt-sel label { font-size: 13px; color: #64748B; font-weight: 600; }
.tt-sel select { border: 1px solid #CFE0E6; border-radius: 10px; padding: 8px 10px; font: inherit; background: #fff; }
.tt-route { margin-top: 12px; border-left: 4px solid var(--tv-ok); background: #F3FAF5; border-radius: 0 12px 12px 0; padding: 10px 14px; font-size: 14px; }
.tt-route .is-bad { color: var(--tv-out); }
.tt-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 10px 0; }
.tt-kv b { color: #64748B; }
.tt-links { display: grid; gap: 4px; font-size: 13.5px; margin: 8px 0 12px; }
.tt-links b.tv-l { color: var(--lc); }
.tt-engine { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; border-radius: 999px; padding: 3px 10px; background: #EEF5F7; }
.tt-found { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.tt-found a, .tt-found span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid #CFE0E6; background: #fff; color: #0F1C22; text-decoration: none; }
.tt-found span { color: #94A3B8; border-style: dashed; }
.tt-found .is-passed { background: #E6F6FA; border-color: var(--px-accent); }

/* ── the lesson ── */
.tt-ask { margin: 0 0 12px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(120deg, #0B3D4C, #0E7490 65%, #06B6D4); color: #fff; }
.tt-ask span { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; margin-bottom: 4px; }
.tt-ask b { font-size: 21px; line-height: 1.3; }
.tt-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tt-facts span { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: #EEF5F7; }
.tt-facts b { color: #475569; font-weight: 700; margin-right: 4px; }
.tt-mini { border: 1px solid #DCEBEF; border-radius: 14px; overflow: hidden; background: #fff; margin-top: 12px; }
.tt-mini__h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 8px 12px; border-bottom: 1px solid #E6EEF1; color: #475569; }
.tt-predict { border: 2px dashed var(--px-accent); border-radius: 14px; padding: 12px 14px; margin: 8px 0 12px; background: #FBFEFF; }
.tt-predict.is-done { border-style: solid; border-color: #C3E6EF; }
.tt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.tt-wcard { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid #DCEBEF; border-radius: 12px; background: #fff; font-size: 14.5px; }
.tt-wcard.is-no { border-color: #F3C9C9; background: #FFFAFA; }
.tt-wcard a { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--px-accent); }
.tt-colh { font-weight: 800; margin: 14px 0 8px; font-size: 15px; }
.tt-colh.is-yes { color: var(--tv-ok); } .tt-colh.is-no { color: var(--tv-out); }
.tt-honest { margin-top: 12px; border-left: 4px solid var(--tv-ok); background: #F3FAF5; border-radius: 0 12px 12px 0; padding: 10px 14px; font-size: 14.5px; }
.tt-fam { display: grid; gap: 6px; margin: 10px 0 14px; }
.tt-fam a, .tt-fam div { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border: 1px solid #DCEBEF; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; font-size: 14px; }
.tt-fam a:hover { border-color: var(--px-accent); }
.tt-fam em { font-style: normal; font-weight: 800; color: var(--lc); white-space: nowrap; font-size: 12.5px; }
.tt-fam small { color: #64748B; margin-left: auto; white-space: nowrap; }
.tt-qpic { margin: 4px 0 8px; }
.tt-qpic .tv-glyph { width: 120px; height: 78px; }

/* the home page */
.tt-thumb { display: block; border: 1px solid #D5E6EC; border-radius: 16px; overflow: hidden; background: #fff; text-decoration: none; }
.tt-thumb__cap { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 13px; color: #475569; border-top: 1px solid #E6EEF1; }
.tt-thumb__cap b { color: var(--px-accent); }
.tt-soon summary { cursor: pointer; font-weight: 700; color: #475569; }
.tt-soon ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; color: #64748B; }
.tt-soon ol li { display: flex; gap: 10px; }
.tt-soon ol span { font-family: var(--px-mono); color: #94A3B8; min-width: 2ch; }

@media (max-width: 560px) {
  .tv-meter { grid-template-columns: 1fr 60px; } .tv-meter__lab { grid-column: 1 / -1; }
  .tt-ask b { font-size: 18px; }
  .tv-tick { font-size: 13px; } .tv-lab { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .tv-meter__bar > span, .tv-edge, .tv-st { transition: none; } }

/* the Trap Gallery */
.tt-traps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 14px; margin-top: 14px; }
.tt-trap { display: grid; gap: 8px; align-content: start; }
.tt-trap__intro { margin: 0; color: #334155; font-size: 14.5px; }
.tt-trap__honest summary { cursor: pointer; font-weight: 700; color: var(--tv-ok); }
.tt-trap__honest p { margin: 6px 0 0; font-size: 14px; }
.tt-trap__link { font-weight: 700; color: var(--px-accent); font-size: 14px; }

/* the Equivalence Lab */
.tt-labsides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.tt-labsides > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid #DCEBEF; background: #F4FBFD; }
.tt-labsides span { font-size: 13px; color: #334155; }
.tt-labsides b { font-family: var(--px-mono); font-size: 20px; color: #0E7490; overflow-wrap: anywhere; }
.tt-labsides small { font-family: var(--px-mono); font-size: 12.5px; color: #64748B; }
.tt-labsides > i { font-style: normal; font-size: 26px; font-weight: 800; color: #0E7490; }
.tt-labpair h3 { margin: 0 0 8px; font-size: 15px; }
.tt-labdiff { margin: 6px 0 0; font-size: 13px; color: var(--tv-ok); font-weight: 600; }
.tt-lab__eq { color: #0E7490; padding: 0 4px; }
.tt-lab__links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 14px; }
.tt-lab__links a { font-weight: 700; color: var(--px-accent); }
.tt-lab__links span { color: #64748B; }
@media (max-width: 560px) { .tt-labsides { grid-template-columns: 1fr; } .tt-labsides > i { text-align: center; } }

/* everything is a linear model: the design matrix */
.tt-lm__f { margin: 0 0 8px; font-family: var(--px-mono); font-weight: 700; color: #0E7490; }
.tt-lm__grid { overflow-x: auto; }
.tt-lm__grid table { border-collapse: collapse; font-family: var(--px-mono); font-size: 13px; }
.tt-lm__grid th, .tt-lm__grid td { padding: 3px 12px; text-align: right; border-bottom: 1px solid #E2EEF1; }
.tt-lm__grid th { color: #475569; font-weight: 700; }
.tt-lm__grid td.is-x { color: #0E7490; background: #F0FAFC; }
.tt-lm__grid th:first-child, .tt-lm__grid td:first-child { border-right: 2px solid #CBD5E1; }
