/* ========================================================================
   MAIN_SYSTEM_BUILDER_003A — PREMIUM WORKSPACE AND VIEWPORT CLOSEOUT
   Scope: Main System Builder only.

   This layer applies the accepted Race Profiler / Race Universe Premium Glass
   geometry to the Main System Builder without changing filters, report logic,
   saved-system state, reset semantics or analytical behaviour.
   ======================================================================== */

body[data-workspace-mode="system_builder"]{
  --msb-ink:#10213d;
  --msb-copy:#526985;
  --msb-muted:#71839a;
  --msb-line:rgba(44,111,214,.30);
  --msb-line-strong:rgba(35,126,211,.43);
  --msb-panel:rgba(255,255,255,.86);
  --msb-panel-soft:rgba(246,249,255,.82);
  --msb-teal:#0d918d;
  --msb-blue:#2d63d6;
  --msb-violet:#6948db;
  --msb-shadow:0 14px 34px rgba(17,34,72,.075),inset 0 1px 0 rgba(255,255,255,.80);
}

body[data-workspace-mode="system_builder"] #page-builder{
  padding-bottom:106px!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .topbar{
  margin-bottom:12px!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section,
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck{
  box-sizing:border-box!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(
  .card,.range-card,.time-block,.stat-mini,.chips,.chip,.pill-range-input,
  .equal-buttons-2,.equal-buttons-3,.equal-buttons-4,.inline-inputs,
  .grid,.layout-grid
){
  min-width:0!important;
}

/* ========================================================================
   CURRENT SYSTEM SETUP — COMPACT DARK COMMAND SURFACE
   ======================================================================== */
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck{
  position:relative!important;
  overflow:hidden!important;
  width:100%!important;
  margin:0 0 14px!important;
  padding:15px 16px 16px!important;
  border:1px solid rgba(97,145,241,.34)!important;
  border-radius:23px!important;
  color:#fff!important;
  background:
    radial-gradient(circle at 91% 8%,rgba(45,212,191,.22),transparent 33%),
    radial-gradient(circle at 38% 112%,rgba(99,102,241,.30),transparent 46%),
    linear-gradient(132deg,rgba(6,18,42,.99),rgba(28,54,139,.97) 58%,rgba(35,99,187,.93))!important;
  box-shadow:0 26px 62px rgba(14,28,68,.20),inset 0 1px 0 rgba(255,255,255,.22)!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck::after{
  content:""!important;
  position:absolute!important;
  inset:0 18px auto!important;
  height:1px!important;
  pointer-events:none!important;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.88),rgba(97,230,244,.42),transparent)!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:16px!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-workflow-kicker{
  color:#7cf1ee!important;
  font-size:9px!important;
  line-height:1.1!important;
  font-weight:950!important;
  letter-spacing:.16em!important;
  text-transform:uppercase!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck h2{
  margin:2px 0 4px!important;
  color:#fff!important;
  font-size:clamp(20px,1.4vw,25px)!important;
  line-height:1.05!important;
  letter-spacing:-.025em!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-head p{
  max-width:860px!important;
  margin:5px 0 0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  color:rgba(232,241,255,.86)!important;
  font-size:11.5px!important;
  line-height:1.38!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  max-width:720px!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-actions button{
  min-height:34px!important;
  padding:7px 11px!important;
  border:1px solid rgba(255,255,255,.20)!important;
  border-radius:11px!important;
  background:rgba(255,255,255,.09)!important;
  color:#fff!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14)!important;
  font-size:10.5px!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-actions button:hover{
  transform:translateY(-1px)!important;
  border-color:rgba(255,255,255,.36)!important;
  background:rgba(255,255,255,.16)!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-start-guide{
  min-width:210px!important;
  color:#064e3b!important;
  border-color:rgba(153,246,228,.55)!important;
  background:linear-gradient(180deg,#d5fbef,#ecfdf8)!important;
  box-shadow:0 10px 24px rgba(16,185,129,.13)!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-chips{
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:6px!important;
  margin:9px 0 0!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-chips > *{
  min-height:25px!important;
  padding:5px 8px!important;
  border:1px solid rgba(147,197,253,.19)!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.085)!important;
  color:rgba(241,247,255,.91)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10)!important;
  font-size:9.5px!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness{
  display:grid!important;
  grid-template-columns:minmax(280px,1.15fr) minmax(420px,.85fr)!important;
  align-items:center!important;
  gap:10px!important;
  margin:9px 0!important;
  padding:9px 10px!important;
  border:1px solid rgba(147,197,253,.16)!important;
  border-radius:15px!important;
  background:rgba(5,16,40,.27)!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-main strong{
  color:#fff!important;
  font-size:13px!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-main p{
  margin:2px 0 0!important;
  color:rgba(229,239,255,.78)!important;
  font-size:10px!important;
  line-height:1.28!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-kicker{
  color:#a8f3ee!important;
  font-size:8px!important;
  letter-spacing:.14em!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-metrics{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-metrics > span{
  min-height:46px!important;
  padding:7px 8px!important;
  border:1px solid rgba(147,197,253,.15)!important;
  border-radius:10px!important;
  background:rgba(255,255,255,.065)!important;
  text-align:center!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-metrics strong{
  color:#fff!important;
  font-size:15px!important;
  line-height:1!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-metrics em{
  margin-top:3px!important;
  color:rgba(224,236,255,.72)!important;
  font-size:8.5px!important;
  line-height:1.15!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:7px!important;
  margin:8px 0 0!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map button{
  display:grid!important;
  grid-template-columns:25px minmax(0,1fr)!important;
  grid-template-areas:"step title" "step copy"!important;
  align-content:center!important;
  min-height:62px!important;
  padding:8px 9px!important;
  gap:2px 7px!important;
  border:1px solid rgba(147,197,253,.15)!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.055)!important;
  color:#fff!important;
  text-align:left!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08)!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map button:hover{
  transform:translateY(-1px)!important;
  border-color:rgba(103,232,249,.36)!important;
  background:rgba(255,255,255,.11)!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map button > span{
  grid-area:step!important;
  align-self:start!important;
  display:grid!important;
  place-items:center!important;
  width:25px!important;
  height:25px!important;
  border-radius:8px!important;
  color:#dffaff!important;
  background:linear-gradient(135deg,rgba(50,120,224,.72),rgba(47,205,194,.52))!important;
  font-size:9px!important;
  font-weight:950!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map button strong{
  grid-area:title!important;
  color:#fff!important;
  font-size:10.5px!important;
  line-height:1.15!important;
}
body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map button em{
  grid-area:copy!important;
  overflow:hidden!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  color:rgba(220,233,251,.72)!important;
  font-size:8.5px!important;
  line-height:1.22!important;
}

/* ========================================================================
   SHARED PREMIUM SECTION SHELL
   ======================================================================== */
body[data-workspace-mode="system_builder"] #page-builder > .section{
  position:relative!important;
  overflow:hidden!important;
  margin:11px 0!important;
  border:1px solid var(--msb-line)!important;
  border-radius:19px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.91),rgba(247,250,255,.84))!important;
  box-shadow:var(--msb-shadow)!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section:hover{
  border-color:var(--msb-line-strong)!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section > .section-header{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  min-height:58px!important;
  padding:10px 14px 10px 18px!important;
  border:0!important;
  border-bottom:1px solid rgba(42,105,207,.20)!important;
  color:var(--msb-ink)!important;
  background:
    radial-gradient(circle at 96% 0%,rgba(45,212,191,.16),transparent 34%),
    linear-gradient(108deg,rgba(222,245,255,.97),rgba(232,236,255,.96) 58%,rgba(222,251,246,.94))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92),inset 0 -1px 0 rgba(67,111,202,.06)!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section > .section-header::before{
  content:""!important;
  position:absolute!important;
  inset:9px auto 9px 0!important;
  width:4px!important;
  border-radius:0 5px 5px 0!important;
  background:linear-gradient(180deg,#27d4cc,#3c72e3 58%,#7757e8)!important;
  box-shadow:0 0 16px rgba(45,155,224,.28)!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section > .section-header::after{
  content:""!important;
  position:absolute!important;
  inset:0 18px auto!important;
  height:1px!important;
  pointer-events:none!important;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.96),rgba(75,148,232,.34),transparent)!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section > .section-header > div:first-child{
  min-width:0!important;
}
body[data-workspace-mode="system_builder"] #page-builder .section-kicker{
  color:#3170af!important;
  font-size:8px!important;
  line-height:1.1!important;
  font-weight:950!important;
  letter-spacing:.15em!important;
  text-transform:uppercase!important;
}
body[data-workspace-mode="system_builder"] #page-builder .section-title-row{
  gap:7px!important;
}
body[data-workspace-mode="system_builder"] #page-builder .section-title{
  margin:2px 0 0!important;
  color:var(--msb-ink)!important;
  font-size:clamp(18px,1.3vw,22px)!important;
  line-height:1.06!important;
  letter-spacing:-.025em!important;
}
body[data-workspace-mode="system_builder"] #page-builder .section-description{
  max-width:900px!important;
  margin:3px 0 0!important;
  color:var(--msb-copy)!important;
  font-size:10.5px!important;
  line-height:1.32!important;
}
body[data-workspace-mode="system_builder"] #page-builder .section-header-actions,
body[data-workspace-mode="system_builder"] #page-builder .profiler-header-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex:0 0 auto!important;
  gap:8px!important;
  margin:0!important;
  min-width:0!important;
  width:auto!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(.profiler-section-toggle,.section-reset-button,.section-guide-button){
  width:auto!important;
  min-width:126px!important;
  min-height:34px!important;
  padding:7px 12px!important;
  border:1px solid rgba(63,106,207,.22)!important;
  border-radius:10px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(240,246,255,.86))!important;
  color:#204d8e!important;
  box-shadow:0 7px 17px rgba(34,68,130,.07),inset 0 1px 0 rgba(255,255,255,.86)!important;
  font-size:9.5px!important;
  font-weight:900!important;
  letter-spacing:0!important;
  text-transform:none!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(.profiler-section-toggle,.section-reset-button,.section-guide-button):hover{
  transform:translateY(-1px)!important;
  border-color:rgba(43,104,221,.38)!important;
  background:#fff!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section > .section-body{
  padding:12px!important;
  background:transparent!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section :is(.card,.time-block,.range-card,.selection-tile){
  border:1px solid rgba(73,109,203,.15)!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.90),rgba(247,250,255,.76))!important;
  box-shadow:0 7px 18px rgba(29,54,105,.045),inset 0 1px 0 rgba(255,255,255,.80)!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section :is(.card,.time-block){
  padding:10px!important;
}
body[data-workspace-mode="system_builder"] #page-builder .card-title,
body[data-workspace-mode="system_builder"] #page-builder .range-title{
  color:#3e5578!important;
  font-size:9px!important;
  line-height:1.15!important;
  font-weight:950!important;
  letter-spacing:.105em!important;
  text-transform:uppercase!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(.note,.race-profiler-mini-note,.card-copy){
  color:#71839a!important;
  font-size:8.5px!important;
  line-height:1.28!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(.grid,.layout-grid){
  gap:9px!important;
}
body[data-workspace-mode="system_builder"] #page-builder .chip{
  min-height:29px!important;
  padding:6px 10px!important;
  border:1px solid rgba(94,117,173,.20)!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.88)!important;
  color:#213b62!important;
  box-shadow:0 5px 12px rgba(29,52,100,.035),inset 0 1px 0 rgba(255,255,255,.86)!important;
  font-size:9.5px!important;
  font-weight:850!important;
}
body[data-workspace-mode="system_builder"] #page-builder .chip.selected:not(.disabled),
body[data-workspace-mode="system_builder"] #page-builder .chip.active:not(.disabled){
  border-color:rgba(13,145,141,.45)!important;
  background:linear-gradient(180deg,rgba(230,253,249,.98),rgba(213,248,241,.90))!important;
  color:#08746f!important;
  box-shadow:0 7px 16px rgba(13,145,141,.09),inset 0 1px 0 rgba(255,255,255,.90)!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(.chip.disabled,.control-disabled .chip){
  opacity:.58!important;
  color:#8796aa!important;
  border-color:rgba(125,145,178,.13)!important;
  background:rgba(240,244,250,.68)!important;
}

/* ========================================================================
   REPORT SETUP
   ======================================================================== */
body[data-workspace-mode="system_builder"] #builder-actions .section-guide-cta{
  display:none!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .builder-action-grid.report-groups-layout{
  display:grid!important;
  grid-template-columns:minmax(245px,.50fr) minmax(600px,1.50fr)!important;
  align-items:start!important;
  gap:10px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-control-card.polished-report-card{
  align-self:start!important;
  min-height:0!important;
  padding:10px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-card-heading{
  margin-bottom:8px!important;
  font-size:9px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-option-list{
  display:grid!important;
  gap:8px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-option{
  min-height:0!important;
  padding:9px 10px!important;
  border-radius:12px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-option button{
  min-height:34px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-option-copy{
  margin-top:7px!important;
  font-size:9.5px!important;
  line-height:1.34!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-table-groups-card.polished-groups-card{
  min-height:0!important;
  padding:10px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-table-groups-header{
  margin-bottom:8px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions :is(.report-table-groups-header p,.report-table-groups-intro){
  max-width:780px!important;
  font-size:9.5px!important;
  line-height:1.35!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-table-groups-list{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-group-toggle{
  min-height:34px!important;
  padding:7px 9px!important;
  border-radius:10px!important;
  font-size:9.5px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-table-group-count{
  min-height:25px!important;
  padding:5px 8px!important;
  font-size:8.5px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .report-table-groups-note{
  margin-top:7px!important;
  padding:6px 8px!important;
  font-size:8.5px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .system-management-card{
  grid-column:1/-1!important;
  display:grid!important;
  grid-template-columns:minmax(220px,.42fr) minmax(0,1.58fr)!important;
  align-items:center!important;
  gap:12px!important;
  padding:10px 12px!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .system-management-card .management-copy{
  margin:0!important;
  font-size:9.5px!important;
  line-height:1.35!important;
}
body[data-workspace-mode="system_builder"] #builder-actions .system-management-card .action-row{
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:7px!important;
}

/* ========================================================================
   SELECTION LOGIC
   ======================================================================== */
body[data-workspace-mode="system_builder"] #system .ranked-mode-prompt{
  max-width:460px!important;
  margin-left:auto!important;
  margin-right:4px!important;
  padding:7px 10px!important;
  border-radius:10px!important;
  font-size:9px!important;
  line-height:1.3!important;
}
body[data-workspace-mode="system_builder"] #system .ranked-guide-cta{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
}
body[data-workspace-mode="system_builder"] #system .ranked-guide-cta > span{
  color:#52709a!important;
  font-size:8px!important;
  font-weight:950!important;
  letter-spacing:.12em!important;
  text-transform:uppercase!important;
}
body[data-workspace-mode="system_builder"] #system .system-criteria-grid{
  display:grid!important;
  grid-template-columns:minmax(280px,.72fr) minmax(360px,1fr) minmax(320px,.86fr)!important;
  gap:10px!important;
  align-items:stretch!important;
}
body[data-workspace-mode="system_builder"] #system .refined-selection-tile{
  min-height:0!important;
  padding:14px!important;
  color:#fff!important;
  background:
    radial-gradient(circle at 100% 0%,rgba(45,212,191,.18),transparent 34%),
    linear-gradient(135deg,#162b63,#3e3fc5 66%,#6752df)!important;
}
body[data-workspace-mode="system_builder"] #system .refined-selection-tile :is(.mini,strong,p){
  color:inherit!important;
}
body[data-workspace-mode="system_builder"] #system .selection-mode-buttons{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
}
body[data-workspace-mode="system_builder"] #system .mode-button{
  min-width:0!important;
  min-height:34px!important;
  padding:7px 10px!important;
  border-radius:999px!important;
}
body[data-workspace-mode="system_builder"] #system .ranking-methods{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
}
body[data-workspace-mode="system_builder"] #system .criteria-warning,
body[data-workspace-mode="system_builder"] #system .rank-helper{
  margin-top:8px!important;
  padding:8px 10px!important;
  border-radius:10px!important;
  font-size:9px!important;
  line-height:1.3!important;
}

/* ========================================================================
   TIME, MARKET, RACE, CONDITIONS AND COURSE PROFILE
   ======================================================================== */
body[data-workspace-mode="system_builder"] #time .time-strip{
  display:grid!important;
  grid-template-columns:minmax(280px,.86fr) minmax(270px,.76fr) minmax(260px,.70fr) minmax(420px,1.20fr)!important;
  gap:9px!important;
  padding:0!important;
}
body[data-workspace-mode="system_builder"] #time .time-block{
  min-width:0!important;
}
body[data-workspace-mode="system_builder"] #time :is(.time-window .chips,.day-week .chips){
  gap:7px!important;
}
body[data-workspace-mode="system_builder"] #time .season-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr)!important;
  gap:9px!important;
  margin-top:9px!important;
}
body[data-workspace-mode="system_builder"] #time :is(.season-presets,.quick-presets){
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px!important;
}
body[data-workspace-mode="system_builder"] #time :is(select,input){
  min-height:32px!important;
  font-size:9.5px!important;
}
body[data-workspace-mode="system_builder"] #market .grid.lower-three{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
body[data-workspace-mode="system_builder"] #market .grid.lower-two{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
body[data-workspace-mode="system_builder"] #market .sp-band-presets{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:7px!important;
}

body[data-workspace-mode="system_builder"] #race .race-meta-row1{
  grid-template-columns:minmax(340px,1.05fr) minmax(390px,1.2fr)!important;
}
body[data-workspace-mode="system_builder"] #race .race-meta-ages{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body[data-workspace-mode="system_builder"] #race .race-meta-class-row{
  grid-template-columns:minmax(420px,1.05fr) minmax(500px,1.2fr)!important;
}
body[data-workspace-mode="system_builder"] #race :is(.meta-country,.meta-race-code,.meta-handicap,.meta-age,.meta-class,.meta-class-subtypes){
  min-width:0!important;
}
body[data-workspace-mode="system_builder"] #race .meta-handicap{
  grid-column:1/-1!important;
}
body[data-workspace-mode="system_builder"] #race .meta-handicap .chips{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  width:min(100%,520px)!important;
  margin-inline:auto!important;
  gap:8px!important;
}
body[data-workspace-mode="system_builder"] #race .meta-handicap .chip{
  width:100%!important;
  min-width:0!important;
  padding-inline:10px!important;
  white-space:normal!important;
}
body[data-workspace-mode="system_builder"] #race #group_grade_listed_card .chips.single-line{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px!important;
  width:100%!important;
}
body[data-workspace-mode="system_builder"] #race #group_grade_listed_card .chips.single-line .chip{
  min-width:0!important;
  width:100%!important;
  padding-inline:7px!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  text-align:center!important;
  line-height:1.16!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(#race,#race-conditions,#course-profile) .range-hybrid-control{
  min-height:64px!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(.hybrid-summary-pill,.distance-summary-pill){
  min-height:36px!important;
  padding:6px 10px!important;
  border-radius:10px!important;
  font-size:9.5px!important;
}
body[data-workspace-mode="system_builder"] #page-builder :is(.distance-value-card,.hybrid-value-card){
  min-width:66px!important;
  padding:7px 8px!important;
  border-radius:11px!important;
}

body[data-workspace-mode="system_builder"] #race-conditions .grid.race-top{
  grid-template-columns:minmax(0,1.58fr) minmax(235px,.42fr)!important;
  align-items:stretch!important;
}
body[data-workspace-mode="system_builder"] #race-conditions .grid.two{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body[data-workspace-mode="system_builder"] #race-conditions .grid.lower-two{
  display:grid!important;
  grid-template-columns:minmax(520px,1.72fr) repeat(2,minmax(185px,.42fr))!important;
  align-items:stretch!important;
  gap:9px!important;
}
body[data-workspace-mode="system_builder"] #race-conditions .grid.lower-two > *{
  min-width:0!important;
}
body[data-workspace-mode="system_builder"] #race-conditions :is(#race_profiler_official_rating_slot,#num_fences_card){
  align-self:stretch!important;
  min-height:0!important;
}
body[data-workspace-mode="system_builder"] #race-conditions :is(#race_profiler_official_rating_slot .race-conditions-rating-card,#num_fences_card){
  height:100%!important;
  min-height:126px!important;
  padding:10px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
}
body[data-workspace-mode="system_builder"] #race-conditions #race_profiler_official_rating_slot .race-profiler-mini-note,
body[data-workspace-mode="system_builder"] #race-conditions #num_fences_card .note{
  max-width:230px!important;
  margin:5px auto 8px!important;
  font-size:8.25px!important;
  line-height:1.25!important;
  text-align:center!important;
}
body[data-workspace-mode="system_builder"] #race-conditions #race_profiler_official_rating_slot .race-profiler-official-rating-inputs,
body[data-workspace-mode="system_builder"] #race-conditions #num_fences_card .inline-inputs{
  width:min(100%,190px)!important;
  margin-inline:auto!important;
}
body[data-workspace-mode="system_builder"] #race-conditions :is(#going_group,#aw_surface_group){
  min-width:0!important;
}
body[data-workspace-mode="system_builder"] #race-conditions :is(#going_group,#aw_surface_group) .chip{
  min-width:0!important;
  width:100%!important;
  padding-inline:7px!important;
  white-space:normal!important;
}
body[data-workspace-mode="system_builder"] #race-conditions .condition-subtitle{
  margin:7px 0 5px!important;
  font-size:8.5px!important;
}
body[data-workspace-mode="system_builder"] #race-conditions .runners-hybrid-card{
  padding:10px!important;
}

body[data-workspace-mode="system_builder"] #course-profile .course-top-context-row{
  grid-template-columns:minmax(380px,1.15fr) minmax(210px,.65fr) minmax(210px,.65fr) minmax(190px,.55fr)!important;
}
body[data-workspace-mode="system_builder"] #course-profile .course-middle-context-row{
  grid-template-columns:minmax(520px,1.25fr) minmax(360px,.75fr)!important;
}
body[data-workspace-mode="system_builder"] #course-profile .distance-range-card{
  padding:10px!important;
}
body[data-workspace-mode="system_builder"] #course-profile .course-distance-presets{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body[data-workspace-mode="system_builder"] #course-profile .course-picker-button{
  min-height:32px!important;
  border-radius:10px!important;
}

/* ========================================================================
   HORSE, RECENCY, LAST RUN, TRANSITIONS, RATINGS AND CONNECTIONS
   ======================================================================== */
body[data-workspace-mode="system_builder"] #horse .horse-gender-card .chips{
  min-width:0!important;
}
body[data-workspace-mode="system_builder"] #horse .horse-gender-card .chip{
  width:100%!important;
  min-width:0!important;
  padding-inline:8px!important;
}
body[data-workspace-mode="system_builder"] #horse-profile-stats .horse-profile-composed-grid.hp-grid-new > *,
body[data-workspace-mode="system_builder"] #horse-profile-stats .stat-mini-grid > *{
  min-width:0!important;
}
body[data-workspace-mode="system_builder"] #horse-profile-stats .horse-prize-strip .stat-mini-title{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
body[data-workspace-mode="system_builder"] #horse-profile-stats .pill-range-input.wide-pill{
  position:relative!important;
  width:100%!important;
  max-width:164px!important;
}
body[data-workspace-mode="system_builder"] #horse-profile-stats input.race-profiler-compact-money-source{
  color:transparent!important;
  caret-color:transparent!important;
}
body[data-workspace-mode="system_builder"] #horse-profile-stats .race-profiler-compact-money-label{
  display:none!important;
}
body[data-workspace-mode="system_builder"] #horse-profile-stats .race-profiler-compact-money-label:not([hidden]){
  position:absolute!important;
  right:0!important;
  bottom:0!important;
  z-index:3!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:calc(50% - 5px)!important;
  height:22px!important;
  padding:0 4px!important;
  border-radius:0 999px 999px 0!important;
  color:#0f172a!important;
  background:transparent!important;
  font-size:11px!important;
  font-weight:950!important;
  letter-spacing:.01em!important;
  pointer-events:none!important;
}
body[data-workspace-mode="system_builder"] #horse-profile-stats .race-profiler-compact-money-label[hidden]{
  display:none!important;
}
body[data-workspace-mode="system_builder"] #lto :is(.equal-buttons-2,.equal-buttons-3),
body[data-workspace-mode="system_builder"] #changes :is(.equal-buttons-2,.equal-buttons-3){
  display:grid!important;
  gap:7px!important;
}
body[data-workspace-mode="system_builder"] #lto .equal-buttons-2,
body[data-workspace-mode="system_builder"] #changes .equal-buttons-2{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body[data-workspace-mode="system_builder"] #lto .equal-buttons-3,
body[data-workspace-mode="system_builder"] #changes .equal-buttons-3{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
body[data-workspace-mode="system_builder"] #lto :is(.equal-buttons-2,.equal-buttons-3) .chip,
body[data-workspace-mode="system_builder"] #changes :is(.equal-buttons-2,.equal-buttons-3) .chip{
  width:100%!important;
  min-width:0!important;
  min-height:30px!important;
  padding:6px 7px!important;
  white-space:normal!important;
  line-height:1.08!important;
}
body[data-workspace-mode="system_builder"] #ratings .grid.lower-two,
body[data-workspace-mode="system_builder"] #trainer-jockey .grid.lower-two{
  gap:9px!important;
}
body[data-workspace-mode="system_builder"] #trainer-jockey .name-search-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto auto!important;
  gap:7px!important;
}

/* ========================================================================
   COLLAPSED SECTIONS AND STICKY COMMAND DOCK
   ======================================================================== */
body[data-workspace-mode="system_builder"] #page-builder > .section.section-collapsed{
  min-height:0!important;
  margin:9px 0!important;
  border-radius:16px!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section.section-collapsed > .section-header{
  min-height:58px!important;
  padding-top:9px!important;
  padding-bottom:9px!important;
  border-bottom:0!important;
}
body[data-workspace-mode="system_builder"] #page-builder > .section.section-collapsed .section-description{
  max-width:820px!important;
  white-space:normal!important;
}
body[data-workspace-mode="system_builder"] .builder-sticky-actions{
  bottom:12px!important;
  z-index:80!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  padding:7px 10px!important;
  border:1px solid rgba(75,108,200,.18)!important;
  border-radius:18px!important;
  background:rgba(249,252,255,.90)!important;
  box-shadow:0 18px 42px rgba(17,31,70,.16),inset 0 1px 0 rgba(255,255,255,.92)!important;
  -webkit-backdrop-filter:blur(18px) saturate(145%)!important;
  backdrop-filter:blur(18px) saturate(145%)!important;
}
body[data-workspace-mode="system_builder"] .builder-sticky-actions .btn{
  min-width:0!important;
  min-height:34px!important;
  padding:7px 13px!important;
  border-radius:10px!important;
  font-size:9.5px!important;
}
body[data-workspace-mode="system_builder"] .builder-sticky-actions .sticky-divider{
  height:24px!important;
}

/* ========================================================================
   VIEWPORT CONTRACTS
   ======================================================================== */
@media(max-width:1750px){
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #time .time-strip{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #time .day-week{
    grid-column:1/-1!important;
  }
  body[data-workspace-mode="system_builder"] #market .grid.lower-two{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #race #group_grade_listed_card .chips.single-line{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #race .race-meta-class-row{
    grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr)!important;
  }
  body[data-workspace-mode="system_builder"] #horse .horse-row1{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  }
  body[data-workspace-mode="system_builder"] #horse .horse-bred-card{
    grid-column:1/-1!important;
  }
  body[data-workspace-mode="system_builder"] #horse .horse-gender-card .chips{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }
  body[data-workspace-mode="system_builder"] #horse-profile-stats .horse-profile-composed-grid.hp-grid-new{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #horse-profile-stats :is(
    .horse-rolling-run-strip,.horse-rolling-win-strip,.horse-experience-strip,
    .horse-prize-strip,.condition-matrix-strip,.horse-condition-strike-strip
  ){
    grid-column:1!important;
    grid-row:auto!important;
  }
  body[data-workspace-mode="system_builder"] #lto > .section-body > .grid.lower-two{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body > .grid.lower-three:first-of-type > .card:nth-child(1){
    grid-column:1!important;
    grid-row:1!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body > .grid.lower-three:first-of-type > .card:nth-child(2){
    grid-column:2!important;
    grid-row:1!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body > .grid.lower-three:first-of-type > .card:nth-child(3){
    grid-column:1/-1!important;
    grid-row:2!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body > .grid.lower-three:nth-of-type(2) > .card:nth-child(1){
    grid-column:1/-1!important;
    grid-row:3!important;
  }
  body[data-workspace-mode="system_builder"] #race-conditions #going_group{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }
  body[data-workspace-mode="system_builder"] #race-conditions #aw_surface_group{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  body[data-workspace-mode="system_builder"] #race-conditions .grid.lower-two{
    grid-template-columns:minmax(0,1.55fr) repeat(2,minmax(175px,.45fr))!important;
  }
  body[data-workspace-mode="system_builder"] #course-profile .course-top-context-row{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media(max-width:1500px){
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-head{
    grid-template-columns:1fr!important;
    align-items:start!important;
  }
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-actions{
    justify-content:flex-start!important;
    max-width:none!important;
  }
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #builder-actions .builder-action-grid.report-groups-layout{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #builder-actions .system-management-card{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #builder-actions .system-management-card .action-row{
    justify-content:flex-start!important;
  }
  body[data-workspace-mode="system_builder"] #system .system-criteria-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #system .refined-selection-tile{
    grid-column:1/-1!important;
  }
  body[data-workspace-mode="system_builder"] #time .season-grid,
  body[data-workspace-mode="system_builder"] #race .race-meta-row1,
  body[data-workspace-mode="system_builder"] #race .race-meta-ages,
  body[data-workspace-mode="system_builder"] #race .race-meta-class-row,
  body[data-workspace-mode="system_builder"] #course-profile .course-middle-context-row,
  body[data-workspace-mode="system_builder"] #course-profile .course-distance-presets{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #race-conditions .grid.lower-two{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #race-conditions .runners-hybrid-card{
    grid-column:1/-1!important;
  }
  body[data-workspace-mode="system_builder"] #horse-profile-stats :is(
    .horse-rolling-run-strip .stat-mini-grid.five,
    .horse-rolling-win-strip .stat-mini-grid.five
  ){
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #horse-profile-stats .horse-experience-strip .stat-mini-grid.four{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #horse-profile-stats .horse-prize-strip :is(.stat-mini-grid.three,.prize-level-grid){
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

@media(max-width:1250px){
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #system .system-criteria-grid,
  body[data-workspace-mode="system_builder"] #time .time-strip,
  body[data-workspace-mode="system_builder"] #time .season-grid,
  body[data-workspace-mode="system_builder"] #market .grid.lower-three,
  body[data-workspace-mode="system_builder"] #market .grid.lower-two,
  body[data-workspace-mode="system_builder"] #race .race-meta-row1,
  body[data-workspace-mode="system_builder"] #race .race-meta-ages,
  body[data-workspace-mode="system_builder"] #race .race-meta-class-row,
  body[data-workspace-mode="system_builder"] #race-conditions .grid.race-top,
  body[data-workspace-mode="system_builder"] #race-conditions .grid.two,
  body[data-workspace-mode="system_builder"] #course-profile .course-top-context-row,
  body[data-workspace-mode="system_builder"] #course-profile .course-middle-context-row,
  body[data-workspace-mode="system_builder"] #course-profile .course-distance-presets,
  body[data-workspace-mode="system_builder"] #ratings .grid.lower-two,
  body[data-workspace-mode="system_builder"] #trainer-jockey .grid.lower-two{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #time .day-week{
    grid-column:auto!important;
  }
  body[data-workspace-mode="system_builder"] #horse .horse-row1{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #horse .horse-bred-card{
    grid-column:auto!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body{
    display:block!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body > .grid.lower-three{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #changes .section-body > .grid.lower-three > .card{
    grid-column:auto!important;
    grid-row:auto!important;
    height:auto!important;
  }
}

@media(max-width:980px){
  body[data-workspace-mode="system_builder"] #page-builder{
    padding-bottom:136px!important;
  }
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-section-map,
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-readiness-metrics,
  body[data-workspace-mode="system_builder"] #builder-actions .report-table-groups-list,
  body[data-workspace-mode="system_builder"] #system .system-criteria-grid,
  body[data-workspace-mode="system_builder"] #time :is(.season-presets,.quick-presets),
  body[data-workspace-mode="system_builder"] #race-conditions .grid.lower-two{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #page-builder > .section > .section-header{
    align-items:flex-start!important;
    flex-direction:column!important;
  }
  body[data-workspace-mode="system_builder"] #page-builder .section-header-actions,
  body[data-workspace-mode="system_builder"] #page-builder .profiler-header-actions{
    width:100%!important;
    justify-content:flex-start!important;
    flex-wrap:wrap!important;
  }
  body[data-workspace-mode="system_builder"] #page-builder :is(.profiler-section-toggle,.section-reset-button,.section-guide-button){
    min-width:0!important;
  }
  body[data-workspace-mode="system_builder"] #race .meta-handicap .chips{
    grid-template-columns:1fr!important;
    width:min(100%,360px)!important;
  }
  body[data-workspace-mode="system_builder"] #race #group_grade_listed_card .chips.single-line,
  body[data-workspace-mode="system_builder"] #race #country_chip_group,
  body[data-workspace-mode="system_builder"] #race #race_code_group,
  body[data-workspace-mode="system_builder"] #race .meta-age .chips{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }
  body[data-workspace-mode="system_builder"] #horse .horse-gender-card .chips{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #horse-profile-stats :is(
    .horse-rolling-run-strip .stat-mini-grid.five,
    .horse-rolling-win-strip .stat-mini-grid.five,
    .horse-experience-strip .stat-mini-grid.four
  ){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #horse-profile-stats .horse-prize-strip :is(.stat-mini-grid.three,.prize-level-grid){
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #lto .stat-mini-grid.three,
  body[data-workspace-mode="system_builder"] #changes .stat-mini-grid.three{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #race-conditions :is(#going_group,#aw_surface_group){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-workspace-mode="system_builder"] #trainer-jockey .name-search-row{
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] .builder-sticky-actions{
    bottom:8px!important;
  }
}

@media(max-width:700px){
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] #mainBuilderOverviewDeck .race-profiler-cohort-actions > *{
    width:100%!important;
  }
  body[data-workspace-mode="system_builder"] #race #group_grade_listed_card .chips.single-line,
  body[data-workspace-mode="system_builder"] #race #country_chip_group,
  body[data-workspace-mode="system_builder"] #race #race_code_group,
  body[data-workspace-mode="system_builder"] #race .meta-age .chips,
  body[data-workspace-mode="system_builder"] #horse .horse-gender-card .chips,
  body[data-workspace-mode="system_builder"] #race-conditions :is(#going_group,#aw_surface_group){
    grid-template-columns:1fr!important;
  }
  body[data-workspace-mode="system_builder"] .builder-sticky-actions{
    justify-content:flex-start!important;
    overflow-x:auto!important;
    flex-wrap:nowrap!important;
  }
  body[data-workspace-mode="system_builder"] .builder-sticky-actions .btn{
    flex:0 0 auto!important;
  }
}
