/* SCAVL T8D: viewport and scrolling correction for Training Centre only.
 * Parent T8C, accepted Core stylesheet, Historical Replay controls and engine
 * remain byte-identical. QA selector is inert in production.
 */

/* Core intentionally uses a fixed, no-scroll outer shell. Only the active
 * Training Centre page gets its own scroll region. Never unlock the entire OCC. */
.workspace > .page.standard-page.historical-replay-page.tc6-page.active {
  display:block!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior-y:contain;
  scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}
.workspace > .page.historical-replay-page.tc6-page.active > [data-tc6-pane]:not([hidden]) {
  display:block;
  min-width:0;
  height:auto;
  overflow:visible;
}
/* Keep tab accessibility and the archive pane's existing IDs/behaviour. */
.tc6-page .tc6-heading{
  padding:6px 10px!important;
  gap:10px;
  margin-bottom:6px!important;
  min-height:44px;
}
.tc6-page .tc6-heading h2{font-size:15px!important;line-height:1.1;margin:0!important}
.tc6-page .tc6-heading p.eyebrow{font-size:8px!important;line-height:1.1;letter-spacing:.25px}
.tc6-page .tc6-heading p:not(.eyebrow){display:none}
.tc6-page .tc6-heading .pill{font-size:8px!important;padding:4px 7px!important;white-space:nowrap}
.tc6-page .tc6-tabbar{margin:0 0 6px!important;padding-bottom:4px!important;gap:5px!important}
.tc6-page .tc6-tabbar button{font-size:10px!important;min-height:31px;padding:6px 11px!important;border-radius:5px!important}

/* One page title is enough. Hide the second (duplicate) title in the
 * practice tab, not any controls or source evidence. */
.tc6-page #tc6Practice .t8b-kicker{display:none!important}
.tc6-page #tc6Practice .t8b-root > .t8b-hold{
  padding:5px 9px!important;
  margin:0 0 6px!important;
  border-radius:5px;
  font-size:10px!important;
  line-height:1.3!important;
}
/* Route + frozen scenario select in the same compact row as Core Live AVL. */
.tc6-page #tc6Practice .t8c-route-selector{margin:0 0 6px!important}
.tc6-page #tc6Practice .t8c-route-selector .t8b-card{
  grid-template-columns:156px minmax(300px,1fr)!important;
  padding:6px 10px!important;
  column-gap:10px!important;
  row-gap:3px!important;
}
.tc6-page #tc6Practice .t8c-route-selector .t8b-card-head{margin:0!important}
.tc6-page #tc6Practice .t8c-route-selector .t8b-card-head .eyebrow{font-size:7px!important}
.tc6-page #tc6Practice .t8c-route-selector .t8b-card-head h3{font-size:12px!important;margin:0!important;line-height:1.2!important}
.tc6-page #tc6Practice .t8c-route-selector .t8b-selectors{gap:8px!important}
.tc6-page #tc6Practice .t8c-route-selector .t8b-field{gap:2px!important;font-size:9px!important}
.tc6-page #tc6Practice .t8c-route-selector .t8b-field select{
  height:29px!important;
  min-height:29px!important;
  padding:4px 8px!important;
  font-size:10px!important;
}
.tc6-page #tc6Practice .t8c-route-selector .t8b-muted{display:none!important}

/* Make the actual two-rail Core corridor the primary content, not a footer. */
.tc6-page #tc6Practice .t8c-board-host{margin:0 0 8px!important}
.tc6-page #tc6Practice .t8c-banner{
  min-height:39px!important;
  padding:5px 10px!important;
  gap:10px!important;
}
.tc6-page #tc6Practice .t8c-banner .eyebrow,
.tc6-page #tc6Practice .t8c-banner p{display:none!important}
.tc6-page #tc6Practice .t8c-banner h3{font-size:13px!important;line-height:1.2;margin:0!important}
.tc6-page #tc6Practice .t8c-label{font-size:9px!important;padding:5px 8px!important}
.tc6-page #tc6Practice .t8c-controls{min-height:33px;padding:4px 9px!important;gap:7px!important}
.tc6-page #tc6Practice .t8c-controls button{min-height:25px!important}
.tc6-page #tc6Practice .t8c-frame .t8c-kpis article{padding:5px 8px!important}
.tc6-page #tc6Practice .t8c-evidence-watch{min-height:26px!important;padding:3px 9px!important;gap:7px!important}
.tc6-page #tc6Practice .t8c-live-board{
  height:clamp(246px,33vh,295px)!important;
  min-height:clamp(246px,33vh,295px)!important;
  max-height:clamp(246px,33vh,295px)!important;
}
.tc6-page #tc6Practice .t8c-bottom-dock{padding:4px 7px!important}
.tc6-page #tc6Practice .t8c-dock-tab{padding:4px 8px!important}
.tc6-page #tc6Practice .t8b-layout{margin-top:6px}

/* Offline fixture imports Core's fixed-viewport CSS for parity. Its HTML is
 * a normal standalone document and MUST restore document scrolling. Scoped
 * to the explicit QA marker; no impact on the genuine OCC application. */
html:has(> body[data-qa="SYNTHETIC_QA_ONLY"]){
  height:auto!important;
  min-height:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scroll-behavior:auto!important;
}
body[data-qa="SYNTHETIC_QA_ONLY"]{
  height:auto!important;
  min-height:100vh!important;
  overflow-y:visible!important;
  overflow-x:hidden!important;
}
body[data-qa="SYNTHETIC_QA_ONLY"] .qa-shell{
  height:auto!important;
  min-height:100vh!important;
  align-items:stretch;
}
body[data-qa="SYNTHETIC_QA_ONLY"] .qa-main{
  height:auto!important;
  min-height:100vh!important;
  overflow:visible!important;
}
body[data-qa="SYNTHETIC_QA_ONLY"] .qa-main .tc6-page{
  display:block!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
body[data-qa="SYNTHETIC_QA_ONLY"] .qa-main .qa-header{
  height:39px!important;
  min-height:39px!important;
  margin-bottom:6px!important;
}
body[data-qa="SYNTHETIC_QA_ONLY"] .qa-sidebar{height:auto;min-height:100vh}

@media(max-width:1000px){
  .tc6-page #tc6Practice .t8c-route-selector .t8b-card{grid-template-columns:1fr!important}
  .tc6-page #tc6Practice .t8c-route-selector .t8b-card-head .eyebrow{display:none}
}
@media(max-width:760px){
  .tc6-page .tc6-heading{align-items:flex-start;flex-wrap:wrap}
  .tc6-page #tc6Practice .t8c-controls{flex-wrap:wrap}
  .tc6-page #tc6Practice .t8c-route-selector .t8b-selectors{grid-template-columns:1fr!important}
  .tc6-page #tc6Practice .t8c-live-board{height:300px!important;min-height:300px!important;max-height:300px!important}
}
@media print{
  .workspace > .page.standard-page.historical-replay-page.tc6-page.active{height:auto!important;max-height:none!important;overflow:visible!important}
  body[data-qa="SYNTHETIC_QA_ONLY"] .qa-shell{display:block}
  .tc6-page #tc6Practice .t8c-live-board{break-inside:avoid}
}
