/* STATWIRE MLB Starters vs. Bullpen (/mlb/rotation-vs-bullpen). Loaded after /assets/site.css; script /assets/mlb-rotation-bullpen.js.
   One full-width graph card: 30 clubs on a 4-way starter vs. bullpen graph (better = right / up in every mode), crosshairs at the
   MLB average, dashed Combined Staff iso-lines, a quadrant summary strip and the pop-up pitching dossier (site.css .sheet, a right
   slide-over from 761px, a bottom sheet below). The band color comes from the band-palette block in site.css (MLB #B03809). */
.rb { --rb-line: #CEDBC0; --rb-line2: #E3ECDA; --rb-panel2: #F5F8F1; --rb-ink: #0C0C11; --rb-ink2: #334155; --rb-muted: #55666F;
  --rb-mlb: #B03809; --rb-green: #15803D; --rb-red: #B91C1C; }

.rb-card { margin-top: var(--gutter); padding: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--rb-line); box-shadow: 0 1px 3px rgba(13, 27, 33, .04); }

/* band: title left, mode select right, strictly one line at every width */
:root .rb-card > .section-h {
  box-sizing: border-box; min-height: 48px; margin: 0; padding: 8px 16px; flex: 0 0 auto;
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px;
  border-radius: 13px 13px 0 0; white-space: nowrap; overflow: hidden;
}
:root .rb-card > .section-h h2 { flex: 0 0 auto; margin: 0; font-size: 13px; line-height: 1.15; white-space: nowrap; overflow: visible; }
:root .rb-card > .section-h .sw-hd-sel { flex: 0 1 auto; min-width: 0; margin: 0 0 0 auto; height: 28px; max-width: 220px; }
@media (max-width: 620px) {
  :root .rb-card > .section-h { padding: 8px 10px; gap: 6px; }
  :root .rb-card > .section-h h2 { font-size: 12px; letter-spacing: .04em; }
  :root .rb-card > .section-h .sw-hd-sel { font-size: 11px; letter-spacing: .02em; max-width: 175px; height: 26px; padding-left: 8px; padding-right: 22px; background-position: right 7px center; }
}

/* control bar: conference | quadrants | rays. Pills hug their text (never stretched). */
.graph-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "conf quad mod";
  align-items: center; gap: 8px 12px; padding: 9px 14px; background: var(--rb-panel2); border-bottom: 1px solid var(--rb-line2);
}
.yp-confs { grid-area: conf; display: inline-flex; align-items: center; gap: 2px; padding: 2px; width: fit-content;
  background: #E8EFE0; border: 1px solid var(--rb-line); border-radius: 8px; }
.yp-tab { appearance: none; border: 0; background: transparent; color: var(--rb-ink2); height: 24px; padding: 0 9px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; width: auto;
  font: 800 11px/1 var(--sans); letter-spacing: .03em; }
.yp-tab:hover { color: var(--rb-ink); background: rgba(255, 255, 255, .65); }
.yp-tab[aria-pressed="true"] { background: var(--rb-ink); color: #FFFFFF; box-shadow: 0 1px 2px rgba(12, 12, 17, .18); }
.q-pills { grid-area: quad; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.gb-mod { grid-area: mod; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.qpill, .mod-pill { appearance: none; box-sizing: border-box; width: auto; flex: 0 0 auto; height: 28px; margin: 0; padding: 0 9px; border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap;
  border: 1px solid var(--rb-line); background: #FFFFFF; color: var(--rb-ink2); font: 700 11px/1 var(--sans);
  transition: border-color .14s, background-color .14s, color .14s; }
.qpill:hover, .mod-pill:hover { border-color: var(--rb-mlb); color: var(--rb-ink); }
.qpill[aria-pressed="true"] { background: var(--rb-mlb); border-color: var(--rb-mlb); color: #FFFFFF; }
.qpill .q-cnt { font: 700 9.5px/1 var(--mono); background: rgba(12, 12, 17, .08); padding: 2px 4px; border-radius: 4px; }
.qpill[aria-pressed="true"] .q-cnt { background: rgba(255, 255, 255, .22); }
.mod-pill .mod-dot { width: 6px; height: 6px; border-radius: 50%; background: #94A3B8; flex: none; }
.mod-pill[aria-pressed="true"] { background: #ECFCCB; border-color: #65A30D; color: #1A2E05; }
.mod-pill[aria-pressed="true"] .mod-dot { background: #65A30D; }
.yp-tab:focus-visible, .qpill:focus-visible, .mod-pill:focus-visible { outline: 2px solid #84CC16; outline-offset: 2px; }
.rb .lbl-sm { display: none; }
@media (max-width: 1020px) {
  .graph-bar { grid-template-columns: auto 1fr; grid-template-areas: "conf mod" "quad quad"; gap: 8px; }
  .q-pills { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .graph-bar { padding: 7px 8px; gap: 6px; }
  .yp-tab { padding: 0 7px; font-size: 10px; height: 22px; }
  .q-pills { flex-wrap: nowrap; gap: 4px; }
  .qpill { height: 24px; padding: 0 6px; font-size: 10px; gap: 3px; border-radius: 6px; }
  .qpill .q-cnt { font-size: 8.5px; padding: 1px 3px; }
  .mod-pill { height: 24px; padding: 0 7px; font-size: 10px; border-radius: 6px; }
  .rb .lbl-lg { display: none; }
  .rb .lbl-sm { display: inline; }
}
@media (max-width: 359px) { .qpill { padding: 0 4px; font-size: 9.5px; } .qpill .q-cnt { padding: 1px 2px; } }

/* 4-way graph */
.plot-outer { padding: 10px 14px 8px; background: #FFFFFF; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 620px) { .plot-outer { padding: 8px 8px 6px; } }
.axis-top-lbl, .axis-bot-lbl { text-align: center; font: 800 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 0; }
.axis-top-lbl { color: var(--rb-green); }
.axis-bot-lbl { color: var(--rb-red); }
.plot-stage { position: relative; width: 100%; height: 540px; background: #FCFDFB; border: 1.5px solid #C0D0B0; border-radius: 10px; overflow: hidden;
  user-select: none; -webkit-user-select: none; }
@media (max-width: 680px) { .plot-stage { height: 420px; } }
.plot-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.plot-svg line { vector-effect: non-scaling-stroke; }
.plot-empty { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: #FCFDFB; font: 700 12px/1.5 var(--mono); color: var(--rb-muted); text-transform: uppercase; letter-spacing: .04em; }
.plot-empty[hidden] { display: none; }
.plot-empty button { display: block; margin: 10px auto 0; }
.q-lbl { position: absolute; z-index: 2; pointer-events: none; padding: 4px 7px; border-radius: 6px; background: rgba(255, 255, 255, .8);
  font: 900 11px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.q-lbl small { display: block; margin-top: 1px; font: 600 10px/1.2 var(--sans); letter-spacing: 0; text-transform: none; color: #55666F; }
.q-tr { top: 10px; right: 10px; text-align: right; color: #15803D; }
.q-tl { top: 10px; left: 10px; color: #0369A1; }
.q-br { bottom: 10px; right: 10px; text-align: right; color: #B45309; }
.q-bl { bottom: 10px; left: 10px; color: #BE123C; }
@media (max-width: 620px) { .q-lbl { font-size: 9.5px; padding: 3px 5px; } .q-lbl small { display: none; } }
.ax-tag { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; pointer-events: none; padding: 2px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, .88); border: 1px solid var(--rb-line2); font: 800 9.5px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: #55666F; }
.ax-left { left: 8px; }
.ax-right { right: 8px; }
.tick-lbl { position: absolute; z-index: 1; pointer-events: none; white-space: nowrap; font: 700 9.5px/1 var(--mono); }
.iso-lbl { position: absolute; z-index: 2; pointer-events: none; white-space: nowrap; transform: translate(-50%, -50%); color: #1A2E05; background: #ECFCCB;
  border: 1px solid #A3D16B; padding: 2px 6px; border-radius: 999px; font: 700 9.5px/1.2 var(--mono); box-shadow: 0 1px 3px rgba(12, 12, 17, .08); }
.tick-lbl { color: #7B8A76; font-size: 8.5px; }
.tick-lbl.is-x { transform: translate(-50%, 0); bottom: 4px; }
.tick-lbl.is-y { transform: translate(0, -50%); left: 4px; }
@media (max-width: 520px) { .iso-lbl { font-size: 8.5px; padding: 1px 5px; } }
.avg-pill { position: absolute; z-index: 3; top: 10px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: #0C0C11; color: #A3E635; padding: 3px 7px; border-radius: 4px; font: 700 9.5px/1.2 var(--mono); box-shadow: 0 2px 6px rgba(12, 12, 17, .18); }
.avg-pill[hidden] { display: none; }
@media (max-width: 620px) { .avg-pill { top: 36px; font-size: 8.5px; padding: 2px 5px; } }

.plot-nodes { position: absolute; inset: 0; z-index: 4; }
.t-node { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; min-width: 34px; padding: 0; border-radius: 50%; border: 2px solid #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font: 800 9.5px/1 var(--mono); letter-spacing: .02em; box-shadow: 0 2px 6px rgba(12, 12, 17, .22);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  transition: left .4s cubic-bezier(.22, 1, .36, 1), top .4s cubic-bezier(.22, 1, .36, 1), transform .16s ease, opacity .18s ease, box-shadow .16s ease, filter .18s; }
@media (max-width: 620px) { .t-node { width: 28px; height: 28px; min-width: 28px; font-size: 8.5px; } }
.t-node:hover, .t-node:focus-visible { z-index: 25 !important; transform: translate(-50%, -50%) scale(1.24); outline: none;
  box-shadow: 0 0 0 3px #84CC16, 0 6px 16px rgba(12, 12, 17, .34); }
.t-node.is-dim { opacity: .16; filter: grayscale(60%); z-index: 3; }
.t-node.is-hl { z-index: 26; transform: translate(-50%, -50%) scale(1.26); box-shadow: 0 0 0 3px #FACC15, 0 8px 18px rgba(12, 12, 17, .32); opacity: 1; filter: none; }

.plot-tip { position: absolute; z-index: 30; pointer-events: none; min-width: 200px; background: #0C0C11; color: #F8FAFC; border: 1px solid rgba(163, 230, 53, .45);
  border-radius: 9px; padding: 9px 11px; box-shadow: 0 10px 26px rgba(12, 12, 17, .35); font: 500 11.5px/1.35 var(--sans); }
.plot-tip[hidden] { display: none; }
.tip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.tip-name { font-weight: 800; font-size: 12.5px; color: #FFFFFF; white-space: nowrap; }
.tip-rec { font: 700 11px/1 var(--mono); color: #A3E635; }
.tip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.tip-k { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: #94A3B8; white-space: nowrap; }
.tip-v { font: 700 12px/1.2 var(--mono); color: #FFFFFF; white-space: nowrap; }
.tip-v small { color: #94A3B8; font-weight: 600; }
.tip-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 10px; color: #CBD5E1; white-space: nowrap; }

.plot-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 9px 14px;
  background: var(--rb-panel2); border-top: 1px solid var(--rb-line2); font: 600 10.5px/1.4 var(--mono); color: var(--rb-muted); }
.plot-foot #plotMeta { color: var(--rb-ink2); font-weight: 700; }
@media (max-width: 620px) { .plot-foot { flex-direction: column; align-items: flex-start; padding: 8px 10px; } }


/* quadrant pills: wrap onto a second line on phones instead of squeezing */
@media (max-width: 620px) { .rb .q-pills { flex-wrap: wrap; justify-content: flex-start; } }
.yp-tab:hover, .qpill:hover { color: var(--rb-ink); }

/* bottom quadrant summary strip: 4 clickable cards (2 x 2 on phones) */
.qs-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px 14px; background: #FFFFFF; border-top: 1px solid var(--rb-line2); }
.qs-strip:empty { display: none; }
@media (max-width: 900px) { .qs-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .qs-strip { padding: 8px; gap: 6px; } }
.qs-card { appearance: none; box-sizing: border-box; min-width: 0; width: 100%; margin: 0; padding: 9px 10px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; background: #FAFDF6; color: var(--rb-ink); font: inherit;
  border: 1px solid var(--rb-line); border-left: 4px solid var(--qc); border-radius: 9px; transition: border-color .14s, background-color .14s, box-shadow .14s; }
.qs-card:hover { background: #F5FAEC; border-color: var(--qc); }
.qs-card[aria-pressed="true"] { background: color-mix(in srgb, var(--qc) 9%, #FFFFFF); border-color: var(--qc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--qc) 22%, transparent); }
.qs-card:focus-visible { outline: 2px solid #84CC16; outline-offset: 2px; }
.qs-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.qs-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 900 11px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--qc); }
.qs-cnt { flex: none; min-width: 22px; text-align: center; padding: 2px 6px; border-radius: 999px; background: var(--qc); color: #FFFFFF; font: 800 10.5px/1.2 var(--mono); }
.qs-sub { font: 600 10px/1.3 var(--sans); color: #55666F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-teams { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; min-width: 0; }
.qs-tm { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 18px; padding: 0 4px; border-radius: 4px;
  font: 800 9px/1 var(--mono); letter-spacing: .02em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.qs-none { font: 600 10px/1.3 var(--mono); color: #7B8A76; }
@media (max-width: 620px) { .qs-name { font-size: 10px; letter-spacing: .02em; } .qs-sub { display: none; } .qs-tm { min-width: 27px; height: 17px; font-size: 8.5px; } }

/* pop-up pitching dossier: right slide-over from 761px, bottom sheet (82vh) below */
.rb-sheet .sh-kind { color: #B03809; }
@media (min-width: 761px) {
  .sheet.rb-sheet { left: auto; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); max-height: none; height: 100%; border-radius: 16px 0 0 16px;
    padding: 18px 22px calc(22px + env(safe-area-inset-bottom)); box-shadow: -18px 0 48px rgba(12, 12, 17, .2);
    transform: translateX(100%); opacity: 1; visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
  .sheet.rb-sheet.open { transform: none; visibility: visible; transition: transform .25s ease; }
  .rb-sheet .grab { display: none; }
}
@media (max-width: 760px) {
  .sheet.rb-sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 82vh; max-height: 82vh; border-radius: 16px 16px 0 0;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); opacity: 1; transition: transform .25s ease, visibility 0s .25s; }
  .sheet.rb-sheet.open { transform: none; transition: transform .25s ease; }
  .rb-sheet .grab { display: block; }
}
.rb-sheet .dos-team { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rb-sheet .tb-lg { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 50px; height: 50px; border-radius: 50%; border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(12, 12, 17, .22); font: 900 13px/1 var(--mono); }
.rb-sheet .dos-id { min-width: 0; }
.rb-sheet .dos-name { margin: 0; font: 900 19px/1.15 var(--sans); color: #0C0C11; }
.rb-sheet .dos-sub { margin-top: 3px; font: 700 10.5px/1.4 var(--mono); color: #465343; text-transform: uppercase; letter-spacing: .04em; }
.rb-sheet .dos-q { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 999px; background: var(--qc); color: #FFFFFF;
  font: 800 10px/1.2 var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.rb-sheet .dos-sec { margin-bottom: 14px; }
.rb-sheet .dos-h { margin: 0 0 7px; font: 800 10px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #465343; }
.rb-sheet .dos-bar-lbl { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font: 700 10.5px/1.3 var(--mono); }
.rb-sheet .c-sp { color: #B03809; }
.rb-sheet .c-rp { color: #0C0C11; text-align: right; }
.rb-sheet .dos-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: #E2E8F0; }
.rb-sheet .dos-bar-sp { background: #B03809; }
.rb-sheet .dos-bar-rp { background: #0C0C11; }
.rb-sheet .dos-bar-foot { margin-top: 5px; font: 600 10px/1.3 var(--mono); color: #55666F; }
.rb-sheet .dos-tbl-wrap { border: 1px solid #CEDBC0; border-radius: 10px; overflow: hidden; }
.rb-sheet .dos-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font: 600 12px/1.25 var(--mono); }
.rb-sheet .dos-tbl th, .rb-sheet .dos-tbl td { padding: 7px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid #E3ECDA; }
.rb-sheet .dos-tbl tr:last-child th, .rb-sheet .dos-tbl tr:last-child td { border-bottom: 0; }
.rb-sheet .dos-tbl thead th { background: #0C0C11; color: #FFFFFF; font: 800 9.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.rb-sheet .dos-tbl th:first-child { width: 52px; text-align: left; padding-left: 10px; }
.rb-sheet .dos-tbl tbody th { font: 800 10.5px/1.2 var(--mono); color: #465343; }
.rb-sheet .dos-tbl tbody tr.is-mode { background: #F5FAEC; }
.rb-sheet .dos-tbl td .num:first-child { color: #0C0C11; font-weight: 700; }
.rb-sheet .rk { display: inline-block; min-width: 26px; font: 700 9.5px/1 var(--mono); text-align: right; }
.rb-sheet .rk-top { color: #15803D; }
.rb-sheet .rk-mid { color: #55666F; }
.rb-sheet .rk-bot { color: #BE123C; }
.rb-sheet .dos-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.rb-sheet .dos-mini > div { min-width: 0; background: #FAFDF6; border: 1px solid #E3ECDA; border-radius: 8px; padding: 8px 6px; text-align: center; }
.rb-sheet .dos-mini span { display: block; font: 700 9.5px/1.2 var(--mono); color: #465343; text-transform: uppercase; }
.rb-sheet .dos-mini strong { display: block; margin-top: 3px; font: 700 13px/1.2 var(--mono); color: #0C0C11; }
.rb-sheet .dos-peers { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-sheet .peer { appearance: none; height: 28px; min-width: 44px; padding: 0 8px; border: 2px solid #FFFFFF; border-radius: 999px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(12, 12, 17, .2); font: 800 10.5px/1 var(--mono); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.rb-sheet .peer:hover, .rb-sheet .peer:focus-visible { outline: none; box-shadow: 0 0 0 2px #84CC16, 0 2px 6px rgba(12, 12, 17, .25); }
.rb-sheet .dos-none { margin: 0; font: 600 11px/1.4 var(--mono); color: #55666F; }
.rb-sheet .dos-meta { margin: 4px 0 0; font: 600 10px/1.4 var(--mono); color: #55666F; }
@media (max-width: 380px) {
  .rb-sheet .dos-tbl { font-size: 11px; } .rb-sheet .dos-tbl th, .rb-sheet .dos-tbl td { padding: 6px 4px; }
  .rb-sheet .dos-tbl th:first-child { width: 44px; padding-left: 7px; } .rb-sheet .rk { min-width: 22px; font-size: 9px; }
  .rb-sheet .dos-bar-lbl { flex-direction: column; gap: 2px; } .rb-sheet .c-rp { text-align: left; }
}
@media (max-width: 400px) { :root .rb-card > .section-h .sw-hd-sel { letter-spacing: 0; padding-left: 7px; padding-right: 20px; background-position: right 6px center; } :root .rb-card > .section-h h2 { letter-spacing: .03em; } }

/* phones: the left / right axis tags move under the plot (inside it they would sit under the badge cluster) */
.axis-x-row { display: none; }
@media (max-width: 620px) {
  .rb .ax-tag { display: none; }
  .axis-x-row { display: flex; justify-content: space-between; gap: 8px; padding: 0 2px; font: 800 9.5px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: #55666F; }
  .axis-x-row span:last-child { text-align: right; }
}
