/* Performance Calculator layout and calculator-specific interaction styling.
 * Result cards intentionally reuse Athlete Search's .rsr-top-performer-summary-card
 * visual primitive. Calculator-only basis/equivalent tables use the same border,
 * spacing and type scale as the surrounding RSR result surfaces without touching
 * shared Rankings/table CSS.
 */
html body .rsr-performance-calculator-ui{box-sizing:border-box;width:100%;max-width:1180px;margin:0 auto 40px;}
html body .rsr-performance-calculator-primary-grid{display:grid;grid-template-columns:minmax(0,1.16fr) minmax(0,.84fr);gap:18px;align-items:stretch;margin-top:18px;}
html body .rsr-performance-calculator-primary-grid>.rsr-pb-progression-block{box-sizing:border-box;min-width:0;height:100%;margin:0;}
html body .rsr-performance-calculator-section-copy{margin:-2px 0 14px;}
html body .rsr-performance-calculator-form{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;align-items:stretch;}
html body .rsr-performance-calculator-form label{display:block;min-width:0;margin:0;}
html body .rsr-performance-calculator-form .rsr-performance-calculator-field-label{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 0 6px;}
html body .rsr-performance-calculator-input-shell{display:block!important;min-width:0!important;margin:0!important;}
html body .rsr-performance-calculator-input-shell input{box-sizing:border-box!important;display:block!important;width:100%!important;max-width:none!important;min-width:0!important;height:35px!important;min-height:35px!important;margin:0!important;}
html body .rsr-performance-calculator-ranking-controls{width:100%!important;margin:0 auto!important;}
html body .rsr-performance-calculator-distance-controls{width:100%!important;margin:0 auto!important;}
html body .rsr-performance-calculator-age-field{box-sizing:border-box;width:min(100%,180px);margin:0 auto!important;}
html body .rsr-performance-calculator-age-field .rsr-performance-calculator-field-label{justify-content:flex-start;}
html body .rsr-performance-calculator-mode-control{display:flex;width:100%;max-width:520px;}
html body .rsr-performance-calculator-mode-control .rsr-pill{flex:1;min-width:0;white-space:normal;}
html body .rsr-performance-calculator-source-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:end;margin:0!important;}
html body .rsr-performance-calculator-source-panel{display:block;min-width:0;margin:0;}
html body .rsr-performance-calculator-source-panel[hidden]{display:none!important;}
html body .rsr-performance-calculator-time-segments{display:grid;grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr) auto minmax(48px,1fr) auto minmax(48px,1fr);gap:5px;align-items:end;min-width:0;}
html body .rsr-performance-calculator-time-segment{display:block;min-width:0;margin:0;}
html body .rsr-performance-calculator-time-segment>small{display:block;margin:0 0 4px;color:var(--rsr-ds-muted);font-size:9px;line-height:1;text-align:center;}
html body .rsr-performance-calculator-time-segment input{text-align:center;font-variant-numeric:tabular-nums;}
html body .rsr-performance-calculator-time-separator{display:flex;align-items:center;justify-content:center;height:35px;padding-bottom:0;color:var(--rsr-ds-text);font-size:18px;font-weight:var(--rsr-type-feature-heading-weight,700);line-height:35px;}
html body .rsr-performance-calculator-source-row button{box-sizing:border-box;margin:0;cursor:pointer;}
html body .rsr-performance-calculator-percent-input{position:relative;}
html body .rsr-performance-calculator-percent-input input{padding-right:30px!important;}
html body .rsr-performance-calculator-percent-input>span{position:absolute;right:11px;top:50%;transform:translateY(-50%);color:var(--rsr-ds-muted);pointer-events:none;}
html body .rsr-performance-calculator-calculate{box-sizing:border-box;height:35px;min-height:35px;margin:0;padding:0 14px;border:1px solid var(--rsr-active-button-bg);border-radius:3px;background:var(--rsr-active-button-bg);color:var(--rsr-active-button-text);font:inherit;font-weight:var(--rsr-type-feature-heading-weight,700);line-height:1;box-shadow:none;cursor:pointer;}
html body .rsr-performance-calculator-calculate:is(:hover,:focus,:focus-visible,:active){border-color:var(--rsr-active-button-bg)!important;background:var(--rsr-active-button-bg)!important;color:var(--rsr-active-button-text)!important;filter:none!important;outline:0;box-shadow:0 0 0 1px var(--rsr-active-button-bg)!important;}
html body .rsr-performance-calculator-mode-control .rsr-pill:not(.active):is(:hover,:focus,:focus-visible,:active){color:var(--rsr-inactive-button-text,var(--rsr-ds-text))!important;}
html body .rsr-performance-calculator-mode-control .rsr-pill.active:is(:hover,:focus,:focus-visible,:active){color:var(--rsr-active-button-text,var(--rsr-ds-text))!important;}
html body .rsr-performance-calculator-reset:is(:hover,:focus,:focus-visible,:active){color:var(--rsr-ds-text)!important;}
html body .rsr-performance-calculator-status{min-height:17px;margin:8px 0 0;color:var(--rsr-ds-muted);font-size:11px;line-height:1.45;}
html body .rsr-performance-calculator-status.is-error{color:var(--rsr-ds-accent);}
html body .rsr-performance-calculator-result-row{display:grid;grid-template-columns:1fr;gap:10px;padding:2px 0 4px;}
html body .rsr-performance-calculator-result-row>.rsr-performance-calculator-summary-card{box-sizing:border-box;width:100%;min-width:0;margin:0;}
html body .rsr-performance-calculator-result-row>.rsr-performance-calculator-summary-card>strong{font-variant-numeric:tabular-nums;}
html body .rsr-performance-calculator-summary-card.is-loading>small{color:var(--rsr-ds-muted);}

html body .rsr-performance-calculator-basis{margin-top:14px;padding-top:13px;border-top:1px solid var(--rsr-table-selector-line-color);}
html body .rsr-performance-calculator-basis>h4,html body .rsr-performance-calculator-equivalents>h4{margin:0 0 9px;font-size:15px;line-height:1.3;}
html body .rsr-performance-calculator-basis dl{margin:0;}
html body .rsr-performance-calculator-basis dl>div{display:grid;grid-template-columns:minmax(105px,.34fr) minmax(0,1fr);gap:14px;align-items:baseline;padding:8px 0;border-top:1px solid var(--rsr-table-selector-line-color);}
html body .rsr-performance-calculator-basis dl>div:first-child{border-top:0;}
html body .rsr-performance-calculator-basis dt{margin:0;color:var(--rsr-ds-muted);font-size:13px;line-height:1.35;}
html body .rsr-performance-calculator-basis dd{margin:0;color:var(--rsr-ds-text);font-size:13px;font-weight:var(--rsr-type-feature-heading-weight,700);line-height:1.35;}

html body .rsr-performance-calculator-equivalents{box-sizing:border-box;margin-top:16px;padding-top:14px;border-top:1px solid var(--rsr-table-selector-line-color);}
html body .rsr-performance-calculator-equivalent-table{overflow:hidden;border:1px solid var(--rsr-table-selector-line-color);border-radius:3px;background:var(--rsr-ds-rank-a);}
html body .rsr-performance-calculator-equivalent-row{display:grid;grid-template-columns:minmax(92px,.68fr) repeat(2,minmax(0,1fr));min-width:0;border-top:1px solid var(--rsr-table-selector-line-color);}
html body .rsr-performance-calculator-equivalent-row:first-child{border-top:0;}
html body .rsr-performance-calculator-equivalent-row>*{box-sizing:border-box;min-width:0;margin:0;padding:8px 10px;border-left:1px solid var(--rsr-table-selector-line-color);font-size:13px;line-height:1.25;}
html body .rsr-performance-calculator-equivalent-row>*:first-child{border-left:0;}
html body .rsr-performance-calculator-equivalent-row>span:first-child{color:var(--rsr-ds-text);font-weight:var(--rsr-type-feature-heading-weight,700);}
html body .rsr-performance-calculator-equivalent-row>strong:not(:first-child){color:var(--rsr-ds-text);font-variant-numeric:tabular-nums;text-align:center;white-space:nowrap;}
html body .rsr-performance-calculator-equivalent-head>*{background:var(--rsr-ds-panel);color:var(--rsr-ds-text);font-weight:var(--rsr-type-feature-heading-weight,700);text-align:center;}
html body .rsr-performance-calculator-equivalent-head>strong{text-align:left;}
html body .rsr-performance-calculator-equivalent-section>*{background:var(--rsr-ds-panel);}
html body .rsr-performance-calculator-equivalent-section>strong{grid-column:1/-1;border-left:0;color:var(--rsr-ds-text);font-size:13px;}
html body .rsr-performance-calculator-equivalent-section>span{display:none;}

html body .rsr-performance-calculator-info-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:18px;}
html body .rsr-performance-calculator-info-grid>.rsr-top-performer-summary-card{box-sizing:border-box;min-width:0;margin:0;height:100%;}
@media(max-width:900px){
  html body .rsr-performance-calculator-primary-grid{grid-template-columns:1fr;}
  html body .rsr-performance-calculator-info-grid{grid-template-columns:1fr;}
}
@media(max-width:600px){
  html body .rsr-performance-calculator-mode-control{max-width:none;}
  html body .rsr-performance-calculator-mode-control .rsr-pill{font-size:10px;padding-left:7px;padding-right:7px;}
  html body .rsr-performance-calculator-source-row{grid-template-columns:1fr 1fr;}
  html body .rsr-performance-calculator-source-panel{grid-column:1/-1;}
  html body .rsr-performance-calculator-time-segments{grid-column:1/-1;}
  html body .rsr-performance-calculator-input-shell input{font-size:16px;}
  html body .rsr-performance-calculator-basis dl>div{grid-template-columns:minmax(94px,.38fr) minmax(0,1fr);gap:10px;}
  html body .rsr-performance-calculator-basis dt,html body .rsr-performance-calculator-basis dd{font-size:12px;}
  html body .rsr-performance-calculator-equivalent-row{grid-template-columns:minmax(72px,.62fr) repeat(2,minmax(0,1fr));}
  html body .rsr-performance-calculator-equivalent-row>*{padding:8px 6px;font-size:12px;}
  html body .rsr-performance-calculator-equivalent-section>strong{font-size:12px;}
}

/* Rankings-style control bands and three-way Enter By toggle. */
html body .rsr-performance-calculator-ranking-controls{
  box-sizing:border-box!important;
  width:100%!important;
  margin:0!important;
  padding:13px 0!important;
  border:0!important;
  border-top:1px solid var(--rsr-table-selector-line-color)!important;
  border-bottom:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html body .rsr-performance-calculator-distance-shell{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html body .rsr-performance-calculator-mode-control{
  --rsr-inset-toggle-gap:3px;
  position:relative!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:center!important;
  width:100%!important;
  max-width:520px!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid var(--rsr-tone-cool-dark-054)!important;
  border-radius:999px!important;
  background:var(--rsr-tone-neutral-black-002)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--rsr-ds-text) 4%,transparent)!important;
}
html body .rsr-performance-calculator-mode-control.rsr-inset-segmented-toggle::before{
  top:var(--rsr-inset-toggle-gap)!important;
  bottom:var(--rsr-inset-toggle-gap)!important;
  left:var(--rsr-inset-toggle-gap)!important;
  width:calc((100% - 6px)/3)!important;
  height:auto!important;
  border-radius:999px!important;
  background:var(--rsr-red)!important;
  transform:none!important;
  transition:left .16s ease!important;
}
html body .rsr-performance-calculator-mode-control.rsr-inset-segmented-toggle[data-active="middle"]::before{left:calc(33.333333% + 1px)!important;}
html body .rsr-performance-calculator-mode-control.rsr-inset-segmented-toggle[data-active="right"]::before{left:calc(66.666667% - 1px)!important;}
html body .rsr-performance-calculator-mode-control.rsr-inset-segmented-toggle>.rsr-pill{
  position:relative!important;
  z-index:2!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-width:0!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:0 8px!important;
  border:0!important;
  border-left:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--rsr-tone-warm-light-023)!important;
  font-size:var(--rsr-table-font-size,12px)!important;
  line-height:1!important;
  text-align:center!important;
  white-space:nowrap!important;
  box-shadow:none!important;
}
html body .rsr-performance-calculator-mode-control.rsr-inset-segmented-toggle>.rsr-pill.active{color:var(--rsr-ds-text)!important;}
@media(max-width:760px){
  html body .rsr-performance-calculator-ranking-controls{padding:10px 0!important;}
  html body .rsr-performance-calculator-mode-control{height:36px!important;min-height:36px!important;max-height:36px!important;}
  html body .rsr-performance-calculator-mode-control.rsr-inset-segmented-toggle>.rsr-pill{padding:0 4px!important;font-size:9px!important;}
}
/* Calculator tablet distance layout: keep the Rankings visual primitive but use
 * the same two-row road/track split as mobile so the selector never requires
 * horizontal scrolling inside the narrower calculator panel. */
@media(min-width:761px) and (max-width:1024px){
  html body .rsr-performance-calculator-distance-controls{
    flex-wrap:wrap!important;
    row-gap:1px!important;
    overflow-x:visible!important;
    white-space:normal!important;
    padding-left:2px!important;
    padding-right:2px!important;
  }
  html body .rsr-performance-calculator-distance-controls .rsr-ranking-distance-subrow{
    flex:0 0 100%!important;
    width:100%!important;
  }
  html body .rsr-performance-calculator-distance-controls .rsr-ranking-distance-break{
    display:block!important;
    flex:0 0 100%!important;
    width:100%!important;
    height:0!important;
    margin:0!important;
    padding:0!important;
  }
  html body .rsr-performance-calculator-distance-controls .rsr-ranking-road-track-separator{
    display:none!important;
    visibility:hidden!important;
  }
}

