/* /explore (pages/compare) — design pass per docs/design_system.md (DS) and
   the Explore anatomy of docs/design/new_content_screen.md §3.
   Every rule is scoped under .compare-page, except:
   - .cmp-sheet…      player dialog renders in the browser's modal top layer
   - body:has(.compare-page)…  the global chrome (header, bottom nav, body bg)
   zz_ prefix: loads after styles.css, so chrome overrides win by order too. */

/* ---- tokens (DS §1–§2) ------------------------------------------------- */

.compare-page,
.cmp-sheet {
  /* Aliases of the central tokens (assets/00_tokens.css, D-13) — the page
     keeps its --cmp-* names, the values live in one place. */
  --cmp-bg: var(--sp-bg);                 /* page background */
  --cmp-surface: var(--sp-surface);       /* cards, inputs */
  --cmp-chrome: var(--sp-chrome);         /* bars, sheets, the desktop panel */
  --cmp-track: var(--sp-chip);            /* neutral chip / trail */
  --cmp-border: var(--sp-border-strong);
  --cmp-border-inset: var(--sp-border);
  --cmp-text: var(--sp-text);
  --cmp-text-2: var(--sp-text-2);
  --cmp-muted: var(--sp-text-3);
  --cmp-accent: var(--sp-accent);         /* the single accent: CTA, play, open chip */
  --cmp-accent-hover: var(--sp-accent-hover);
  /* Selected = inverted chip (D-12); lime left this surface with backlog 1.2. */
  --cmp-selected-bg: var(--sp-selected-bg);
  --cmp-selected-text: var(--sp-selected-text);
  --cmp-display: var(--sp-font-display);
  --cmp-ui: var(--sp-font-ui);
  --cmp-mono: var(--sp-font-mono);
  /* Mantine components inside these scopes pick up the UI font. */
  --mantine-font-family: var(--cmp-ui);
}

/* ---- global chrome on this route ---------------------------------------- */

/* Paint the route before Dash mounts .compare-page on refresh. */
html.sp-route-explore,
body.sp-route-explore,
body:where([data-sp-has~="compare-page"]):not(.sp-s) {
  color-scheme: dark;
  background: var(--sp-bg) !important;
}

body.sp-route-explore #app-container,
body:where([data-sp-has~="compare-page"]):not(.sp-s) #app-container {
  background-color: var(--sp-bg) !important;
}

body:where([data-sp-has~="compare-page"]):not(.sp-s) .sp-bottom-nav {
  background: var(--sp-chrome) !important;
  border-top: 1px solid var(--sp-border-strong) !important;
}

body:where([data-sp-has~="compare-page"]):not(.sp-s) .sp-bottom-nav-link {
  color: var(--sp-text-3) !important;
}

body:where([data-sp-has~="compare-page"]):not(.sp-s) .sp-bottom-nav-link.is-active {
  color: var(--sp-accent) !important;
}

/* ---- page frame ---------------------------------------------------------- */

.compare-page {
  min-height: 100%;
  background: var(--cmp-bg);
  color: var(--cmp-text);
  font-family: var(--cmp-ui);
}

.compare-page .cmp-container {
  max-width: 520px;
  margin: 0 auto;
  /* bottom nav clearance comes from #app-page-container's own mobile padding */
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px; /* breathing room between page components (user 2026-08-24) */
}

/* title row: heading left, Line/Table switcher right (mockup 2026-08-24) */
.compare-page .cmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compare-page .cmp-view-wrap {
  flex: 0 0 auto;
}

/* "←" (mockups A1 / A3 / A4, backlog 1.5a): a ghost round button before the
   title; history.back() keeps the feed position. */
.compare-page .cmp-back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: -6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cmp-text);
  cursor: pointer;
}

.compare-page .cmp-back:hover {
  background: var(--cmp-track);
}

.compare-page .cmp-back:focus-visible {
  outline: 2px solid var(--cmp-accent);
  outline-offset: 2px;
}

.compare-page .cmp-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--cmp-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--cmp-text);
  /* the title follows the content since 1.4b ("LeBron James vs Michael
     Jordan — Points"): at most two lines, so the chart stays high on a
     phone (mockup A1 draws one row) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .compare-page .cmp-title {
    font-size: 19px;
  }
}

/* ---- build screen ("Build a stat", mockup 2026-08-24) ---------------------
   Replaces the first-run sheet chain + stepper: every choice inline on one
   surface, one CTA. Page mode (first run) renders it as the page body; after
   the first build the metric/season/axis chips reopen it as a bottom sheet.
   The draft controller owns the root className (--page / --sheet [is-open]). */

.compare-page .cmp-setup-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* page mode: no scrim, no close button, no own heading (the page title
   cmp-title is the one title, D-5); the CTA hugs the viewport bottom like
   the mockup (min-height ~ viewport minus the global chrome + page paddings) */
.compare-page .cmp-setup--page .cmp-setup-scrim,
.compare-page .cmp-setup--page .cmp-setup-close,
.compare-page .cmp-setup--page .cmp-setup-head {
  display: none;
}

.compare-page .cmp-setup--page .cmp-setup-card {
  min-height: calc(100vh - 250px);
  min-height: calc(100dvh - 250px);
}

.compare-page .cmp-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* sheet heading — same size as the roster sheet's Drawer title */
.compare-page .cmp-setup-title {
  margin: 0;
  font-family: var(--cmp-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--cmp-text);
}

.compare-page .cmp-setup-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--cmp-border);
  background: var(--cmp-surface);
  color: var(--cmp-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.compare-page .cmp-setup-close:hover {
  color: var(--cmp-text);
}

/* section: mono header (tinted icon + label + optional tag) above the control */
.compare-page .cmp-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-page .cmp-section-head {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Section labels carry no icon (owner request 2026-11-22); the icon stays in the markup. */
.compare-page .cmp-section-icon {
  display: none !important;
  color: var(--cmp-accent);
  flex: 0 0 auto;
}

.compare-page .cmp-section-label,
.compare-page .cmp-section-tag,
.compare-page .cmp-sub-label,
.compare-page .cmp-metric-table-head {
  font-family: var(--cmp-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cmp-muted);
}

.compare-page .cmp-section-tag {
  margin-left: auto;
  font-size: 9px;
}

/* players row: input-look button that opens the roster sheet */
.compare-page .cmp-setup-players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 14px;
  color: var(--cmp-text);
  font-family: var(--cmp-ui);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.compare-page .cmp-setup-players:hover {
  border-color: var(--cmp-accent);
}

.compare-page .cmp-setup-players-caret {
  display: inline-flex;
  color: var(--cmp-muted);
  line-height: 1;
}

/* option chips (selected = inverted, D-12). Check icons off — the fill
   carries the state and 4-across chips have no room. */
/* :is(.cmp-setup, .cmp-export): the export sheet's quality chips (1.6b) are the same
   pick chips — without this they fell back to the DMC look (owner, 2026-09-14) */
.compare-page :is(.cmp-setup, .cmp-export) .mantine-Chip-iconWrapper,
.compare-page :is(.cmp-setup, .cmp-export) .mantine-Chip-checkIcon {
  display: none;
}

.compare-page :is(.cmp-setup, .cmp-export) .cmp-pick-chip {
  /* flex flattens the zero-size Chip input that otherwise adds a phantom
     ~26px line above every pill (root was 70px for a 44px pill) */
  display: flex;
  width: 100%;
}

.compare-page :is(.cmp-setup, .cmp-export) .mantine-Chip-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 6px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  color: var(--cmp-text-2);
  font-family: var(--cmp-ui);
  font-size: 13px;
  font-weight: 600;
}

.compare-page :is(.cmp-setup, .cmp-export) .mantine-Chip-label[data-checked] {
  background: var(--cmp-selected-bg);
  border-color: var(--cmp-selected-bg);
  color: var(--cmp-selected-text);
  padding: 0 6px;
}

/* Stat (explore menus plan 3.4): Most used in four columns; "All <n> stats" reveals the shooting table (a row name
   and three chips: made, attempts, percentage) and the other categories, two of two chips side by side. */
.compare-page .cmp-metric-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-page .cmp-metric-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.compare-page .cmp-metric-more {
  display: none;
}

.compare-page .cmp-metric-grid.is-expanded .cmp-metric-more {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-page .cmp-metric-table {
  display: grid;
  grid-template-columns: 92px repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px 8px;
  margin-top: 8px;
}

.compare-page .cmp-metric-table > .cmp-sub-label { margin: 0; }
.compare-page .cmp-metric-table-head { text-align: center; }
.compare-page .cmp-metric-row-label { color: var(--cmp-text); font: 600 14px/1.1 var(--cmp-ui); }

.compare-page .cmp-metric-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compare-page .cmp-metric-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.compare-page .cmp-metric-group--wide { grid-column: 1 / -1; }

.compare-page .cmp-metric-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compare-page .cmp-metric-group--wide .cmp-metric-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* A long name (Playoff series won) takes two lines instead of widening its column. */
.compare-page .cmp-metric-grid .mantine-Chip-label { white-space: normal; text-align: center; }

.compare-page .cmp-metric-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  color: var(--cmp-text-2);
  font-family: var(--cmp-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.compare-page .cmp-metric-all:hover {
  border-color: var(--cmp-accent);
}

/* A label inside a part (Most used, Compared by, Seasons, Games, a metric category): 18 px above, 8 below
   with the part's 10 px gap (explore menus plan 3.2). */
.compare-page .cmp-sub-label {
  margin: 8px 0 -2px;
}

/* A line that says why a choice is missing or what a period counts. */
.compare-page .cmp-part-note {
  margin: 0;
  color: var(--cmp-text-2);
  font: 500 13px/1.4 var(--cmp-ui);
}

/* season (explore menus plan 3.5): three buttons in one row, the icon above the word */
.compare-page .cmp-season-grid {
  display: grid;
  grid-template-columns: 119fr 122fr 101fr;
  gap: 8px;
}

#compare-shell .cmp-setup .cmp-season-grid .mantine-Chip-label {
  min-height: 60px;
}

/* Mantine wraps the chip children in one inner span, so the icon/label gap lives there */
.compare-page :is(.cmp-season-grid, .cmp-axis-grid) .mantine-Chip-label > span:not(.mantine-Chip-iconWrapper) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.compare-page .cmp-season-grid .mantine-Chip-label > span:not(.mantine-Chip-iconWrapper) {
  flex-direction: column;
}

.compare-page :is(.cmp-season-grid, .cmp-axis-grid) .cmp-season-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.compare-page .cmp-season-grid .cmp-season-icon {
  width: 18px;
  height: 18px;
}

.compare-page .cmp-season-icon {
  color: var(--cmp-text-2);
}

.compare-page :is(.cmp-season-grid, .cmp-axis-grid) .mantine-Chip-label[data-checked] .cmp-season-icon {
  color: var(--cmp-selected-text);
}

/* Compared by (explore menus plan 3.6): Career season, Season, Games in one row */
.compare-page .cmp-axis-grid {
  display: grid;
  grid-template-columns: 1.34fr .83fr .83fr;
  gap: 6px;
}

/* Compared by > Games: which games (All games, Last 10, Last 5, Last game day) in one row */
.compare-page .cmp-game-period {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-page .cmp-game-period > .cmp-sub-label { margin-bottom: -2px; }

.compare-page .cmp-period-grid {
  display: grid;
  grid-template-columns: .9fr .8fr .8fr 1.25fr;
  gap: 6px;
}

#compare-shell .cmp-period-grid .mantine-Chip-label { padding: 0 2px; }

/* Quick choices beside a field: the counts of a Top N, the periods of Season (explore menus plan 3.3, 3.6) */
.compare-page .cmp-quick {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 7px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  color: var(--cmp-text-2);
  font: 600 13px/1 var(--cmp-ui);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.compare-page .cmp-quick.is-selected {
  background: var(--cmp-selected-bg);
  border-color: var(--cmp-selected-bg);
  color: var(--cmp-selected-text);
}

.compare-page .cmp-season-quick-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-page .cmp-season-quick-row > .cmp-sub-label { margin: 0; }

.compare-page .cmp-season-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compare-page .cmp-season-quick .cmp-quick { flex: 1 1 auto; }

/* Look (explore menus plan 3.7) is the phone menu of the Look tile only (zzzzzzzz_explore_panels.css shows it there):
   the chart types as four tiles, icon above the name; Values and Format as two-part switches; a greyed row says why
   in its label. The line under Values keeps two lines whatever its words, so the menu's height does not change with
   the chart type. */
#cmp-setup .cmp-menu-part--look { display: none; }
.compare-page .cmp-look-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.compare-page .cmp-look-kinds .cmp-quick { flex-direction: column; gap: 6px; min-width: 0; height: 62px; padding: 0 2px; }
.compare-page .cmp-look-row { display: flex; flex-direction: column; gap: 10px; }
.compare-page .cmp-look-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-page .cmp-look-switch .cmp-quick { gap: 8px; min-width: 0; }
.compare-page .cmp-look-switch .cmp-chart-icon { width: 16px; height: 16px; }
.compare-page .cmp-look-switch .cmp-aspect-icon--vertical { width: 12px; height: 16px; }
.compare-page .cmp-look-switch .cmp-aspect-icon--horizontal { width: 18px; height: 11px; }
.compare-page .cmp-look-note { margin-left: 8px; font-weight: 500; }
.compare-page .cmp-look-row:not(.is-off) .cmp-look-note { display: none; }
.compare-page #cmp-look-values-line { min-height: 2.8em; }

/* Number of players / teams: the field's label heads the row, the quick counts at its left, the stepper at its
   right; when they do not fit one row the stepper takes the next (the 272 px panel, narrow phones). */
.compare-page #cmp-top-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-page .cmp-top-count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 4px;
}

.compare-page .cmp-top-count > .cmp-top-n-field { display: contents; }
.compare-page .cmp-top-count .mantine-NumberInput-label { flex: 0 0 100%; order: -1; margin: 0; }
.compare-page .cmp-top-quick { display: flex; gap: 4px; order: 1; }
.compare-page .cmp-top-count .mantine-NumberInput-wrapper { order: 2; margin-left: auto; }

/* A stepper: the field's own step controls (Mantine's, with its limits) drawn as - and + around the typeable
   number; the small arrows they were are gone. One box, 44 px high; its edge is drawn inside, so the buttons keep
   the whole 44 px. */
#compare-shell .cmp-stepper .mantine-NumberInput-wrapper {
  display: flex;
  align-items: stretch;
  height: 44px;
  background: var(--cmp-surface);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--cmp-border);
  overflow: hidden;
}

#compare-shell .cmp-stepper :is(.mantine-NumberInput-section, .mantine-NumberInput-controls) { display: contents; }

#compare-shell .cmp-stepper .mantine-NumberInput-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}

#compare-shell .cmp-stepper .mantine-NumberInput-control {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  order: 1;
  width: 44px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cmp-text);
}

/* A count has two digits: its stepper keeps the row (the season fields share their row's width instead). */
#compare-shell .cmp-top-count .mantine-NumberInput-input { flex: 0 0 28px; }
#compare-shell .cmp-stepper .mantine-NumberInput-control[data-direction='down'] { order: -1; }
#compare-shell .cmp-stepper .mantine-NumberInput-control:disabled { opacity: .36; }
#compare-shell .cmp-stepper .mantine-NumberInput-control > svg { display: none; }

#compare-shell .cmp-stepper .mantine-NumberInput-control::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 4v16M4 12h16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 4v16M4 12h16'/%3E%3C/svg%3E") center / contain no-repeat;
}

#compare-shell .cmp-stepper .mantine-NumberInput-control[data-direction='down']::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12h16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12h16'/%3E%3C/svg%3E");
}

/* CHART section (backlog 1.3, mockup A2/A4): the kind pills in one row (as
   many as the page offers — three on a comparison, D-24) + the Aggregate row
   (label left, switch right) below them */
.compare-page .cmp-kind-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.compare-page .cmp-kind-grid .mantine-Chip-label {
  min-height: 40px;
  padding: 0 4px;
}

/* Native switch semantics, presented as a text-only toolbar toggle. */
.compare-page .cmp-total-toggle { position: relative; flex-shrink: 0; }
.compare-page .cmp-total-toggle .mantine-Switch-track { display: none; }
.compare-page .cmp-total-toggle .mantine-Switch-body { align-items: center; }
.compare-page .cmp-total-toggle .mantine-Switch-labelWrapper { padding: 0; }
.compare-page .cmp-total-toggle .mantine-Switch-label {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; height: 30px; min-height: 30px; padding: 0 8px; white-space: nowrap;
  border: 1px solid var(--cmp-border); border-radius: 10px;
  background: var(--cmp-surface); color: var(--cmp-text);
  font: 500 12px/1 var(--cmp-ui); cursor: pointer;
}
.compare-page .cmp-total-toggle:has(input:checked) .mantine-Switch-label {
  background: var(--cmp-selected-bg);
  border-color: var(--cmp-selected-bg);
  color: var(--cmp-selected-text);
}
.compare-page .cmp-total-toggle:has(input:focus-visible) .mantine-Switch-label {
  outline: 2px solid var(--cmp-accent); outline-offset: 3px;
}
.compare-page .cmp-total-toggle:has(input:disabled) .mantine-Switch-label {
  opacity: .5; cursor: default;
}
@media (max-width: 1023px) {
  .compare-page .cmp-total-toggle .mantine-Switch-label {
    height: 26px; min-height: 26px; margin-block: 9px; padding: 0 7px;
    border-radius: 6px; font-size: 11px;
  }
  .compare-page .cmp-total-toggle .mantine-Switch-label::after {
    content: ""; position: absolute; inset: 0;
  }
}

/* year range (Calendar year only) — same input look as the sheets */
.compare-page .cmp-setup .mantine-Input-input,
.compare-page .cmp-setup .mantine-InputBase-input {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 10px;
  color: var(--cmp-text);
  min-height: 46px;
  font-family: var(--cmp-mono);
  font-size: 14px;
}

.compare-page .cmp-setup .mantine-InputWrapper-label {
  font-family: var(--cmp-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cmp-muted);
  margin-bottom: 4px;
}

/* CTA: the mockup's full-width orange pill, pinned to the card bottom */
.compare-page .cmp-setup-cta {
  margin-top: auto;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--cmp-accent);
  color: var(--sp-bg);
  font-family: var(--cmp-ui);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.compare-page .cmp-setup-cta:hover:not(:disabled) {
  background: var(--cmp-accent-hover);
}

/* The button's words: today's everywhere; a phone menu shows its own result instead (zzzzzzzz_explore_panels.css). */
.compare-page .cmp-cta-text:not(.cmp-cta-text--form) {
  display: none;
}

/* The tile row of the phone (explore menus plan 3.1) exists only in that mode (zzzzzzz_explore_final.css). */
.compare-page .cmp-tiles {
  display: none;
}

.compare-page .cmp-setup-cta:disabled {
  background: var(--cmp-track);
  color: var(--cmp-muted);
  cursor: default;
}

/* page mode: fixed CTA floating above the bottom nav (mockup). Fixed, not
   sticky — ancestor overflow clipping makes sticky inert on the page scroller.
   The card's bottom padding lets the last controls scroll clear of it. */
.compare-page .cmp-setup--page .cmp-setup-cta {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: 488px; /* page container 520 minus its 16px side paddings */
  margin-inline: auto;
  z-index: 5;
  box-shadow: 0 6px 24px rgba(8, 9, 12, 0.55);
}

.compare-page .cmp-setup--page .cmp-setup-card {
  padding-bottom: 84px;
}

/* desktop has no bottom nav (it hides at >=768px in styles.css) */
@media (min-width: 768px) {
  .compare-page .cmp-setup--page .cmp-setup-cta {
    bottom: 16px;
  }
}

/* sheet mode: fixed overlay, the card anchors to the bottom edge */
.compare-page .cmp-setup--sheet {
  display: none;
}

.compare-page .cmp-setup--sheet.is-open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1600; /* above the page + build overlay (1500), below the roster sheet (2100) */
}

.compare-page .cmp-setup--sheet .cmp-setup-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(8, 9, 12, 0.6);
  backdrop-filter: blur(3px);
}

.compare-page .cmp-setup--sheet .cmp-setup-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--cmp-chrome);
  border: 1px solid var(--cmp-border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  animation: cmp-sheet-in 0.22s ease;
}

@keyframes cmp-sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* in the sheet the CTA sticks to the card's own scroll edge, so it stays
   reachable while the choices scroll underneath */
.compare-page .cmp-setup--sheet .cmp-setup-cta {
  margin-top: 2px;
  position: sticky;
  bottom: 0;
  box-shadow: 0 6px 24px rgba(8, 9, 12, 0.55);
}

/* ---- building overlay (final setup step -> first build) ------------------- */

.compare-page .cmp-build-loading {
  position: fixed;
  inset: 0;
  z-index: 1500; /* above the page, below the sheets (2100) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 14, 18, 0.88);
  backdrop-filter: blur(4px);
}

.compare-page .cmp-build-loading-box {
  text-align: center;
}

.compare-page .cmp-build-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--cmp-track);
  border-top-color: var(--cmp-accent);
  animation: cmp-spin 0.8s linear infinite;
}

@keyframes cmp-spin {
  to {
    transform: rotate(360deg);
  }
}

.compare-page .cmp-build-loading-text {
  font-family: var(--cmp-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--cmp-text-2);
}

/* ---- empty state (DS §4) -------------------------------------------------- */

.compare-page .cmp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 48px 12px 24px;
}

.compare-page .cmp-empty-title {
  font-family: var(--cmp-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--cmp-text-2);
}

.compare-page .cmp-empty-copy {
  max-width: 300px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cmp-muted);
}

.compare-page .cmp-empty-cta {
  border: 0;
  background: none;
  padding: 8px;
  font-family: var(--cmp-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--cmp-accent);
  cursor: pointer;
}

.compare-page .cmp-empty-cta:hover {
  color: var(--cmp-accent-hover);
}

/* ---- error slot ----------------------------------------------------------- */

.compare-page .cmp-error:empty {
  display: none;
}

/* ---- preview: legend + views ---------------------------------------------- */

.compare-page .cmp-preview {
  display: flex;
  flex-direction: column;
  gap: 14px; /* breathing room (user 2026-08-24) */
}

/* per-player legend cards (mockup): one scrollable row, like the chip row */
.compare-page .cmp-legend {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  margin-inline: -16px;
  padding-inline: 16px;
  scrollbar-width: none;
}

.compare-page .cmp-legend::-webkit-scrollbar {
  display: none;
}

.compare-page .cmp-legend:empty {
  display: none;
}

.compare-page .cmp-legend-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 108px;
  padding: 8px 12px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border-inset);
  border-radius: 12px;
}

.compare-page .cmp-legend-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compare-page .cmp-legend-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cmp-muted);
}

.compare-page .cmp-legend-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--cmp-text);
  white-space: nowrap;
}

.compare-page .cmp-legend-value {
  font-family: var(--cmp-mono);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* TEMPORARILY hidden (user 2026-08-24): the per-player name+score cards are
   parked for now. Everything still renders and live-syncs underneath —
   restoring the legend = deleting this one rule. */
.compare-page .cmp-legend {
  display: none;
}

/* Line/Table switcher: joined pill (mockup) — dark container, orange active
   segment. The sliding indicator is hidden; the active label paints itself. */
.compare-page .cmp-view-switch {
  background: var(--cmp-surface) !important;
  border: 1px solid var(--cmp-border) !important;
  border-radius: 999px !important;
  padding: 3px !important;
}

.compare-page .cmp-view-switch .mantine-SegmentedControl-indicator {
  display: none;
}

.compare-page .cmp-view-switch .mantine-SegmentedControl-control {
  border: 0 !important;
}

.compare-page .cmp-view-switch .mantine-SegmentedControl-label {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 2px 14px;
  border-radius: 999px;
  color: var(--cmp-text-2);
  font-family: var(--cmp-ui);
  font-size: 13px;
  font-weight: 600;
  transition: none;
}

.compare-page .cmp-view-switch .mantine-SegmentedControl-label[data-active],
.compare-page .cmp-view-switch .mantine-SegmentedControl-control[data-active] .mantine-SegmentedControl-label {
  background: var(--cmp-accent);
  color: var(--sp-bg);
}

/* view toggle: one of the two blocks is hidden */
.compare-page .cmp-views {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-page .cmp-views--line .cmp-table-card {
  display: none;
}

.compare-page .cmp-views--table .cmp-card-wrap {
  display: none;
}

/* ---- the animated card (shared card-int runtime) --------------------------
   The wrapper carries .real-feed-route for the shared chrome; these rules
   shape it into a DS chart card (radius 16, surface, border) and pin the
   stage size — mirroring the proven overrides from assets/explore.css. */

.compare-page .compare-visual-bleed {
  min-height: 0;
  border: 1px solid var(--cmp-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--cmp-surface);
  --sp-card-panel-open-size: 32px; /* consumed by the shared chevron rules */
  --cmp-dock-band: 84px; /* bottom band reserved for the (compacted) transport */
}

/* phones: the chart is the hero — full-bleed edge to edge */
@media (max-width: 767px) {
  .compare-page .compare-visual-bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

.compare-page .compare-visual-bleed .sp-card-interactive-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0;
}

.compare-page .compare-visual-bleed .sp-card-interactive-stage {
  position: relative;
  width: 100%;
  /* The stage takes the mode's aspect (D-40 / D-43, backlog 1.8c): the
     padding-top trick sizes the box as width x the mode's ratio PLUS the dock
     band below the plot (the plot / underlay are absolutely inset by the band,
     so the padding box is their box). The wrapper carries
     .cmp-format--vertical|horizontal (a clientside class from cmp-format);
     Vertical = 4:5 (the largest Instagram feed portrait — the phone stage's
     own shape since the redesign, 390x490) is the fallback for a wrapper
     without the class; Horizontal = 16:9. The video export uses the same box
     (1080x1350 / 1920x1080), so "renders exactly what you see" holds. */
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  box-sizing: border-box;
  /* !important: the card runtime writes an inline `padding: 0` on the stage */
  padding-top: calc(100% * 5 / 4 + var(--cmp-dock-band)) !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}

.compare-page .cmp-format--horizontal .compare-visual-bleed .sp-card-interactive-stage {
  padding-top: calc(100% * 9 / 16 + var(--cmp-dock-band)) !important;
}

/* Tablets / desktop: the card is height-limited and centred (D-40 / D-43); the
   Horizontal box fills the column width (the "graph across the whole window"
   rule holds there). The width limit sits on the WRAPPER, not the stage,
   because the stage's padding-top % resolves against its containing block's
   width. Phones (<= 767) keep the full-bleed width. */
@media (min-width: 768px) {
  .compare-page .compare-visual-bleed {
    --cmp-stage-max-h: min(80vh, 900px);
    width: min(100%, calc((var(--cmp-stage-max-h) - var(--cmp-dock-band)) * 4 / 5));
    margin-inline: auto;
  }

  .compare-page .cmp-format--horizontal .compare-visual-bleed {
    width: min(100%, calc((var(--cmp-stage-max-h) - var(--cmp-dock-band)) * 16 / 9));
  }
}

.compare-page .compare-visual-bleed .sp-card-interactive-stage .dash-graph,
.compare-page .compare-visual-bleed .sp-card-interactive-stage .dash-graph > div,
.compare-page .compare-visual-bleed .sp-card-interactive-stage .js-plotly-plot,
.compare-page .compare-visual-bleed .sp-card-interactive-stage .plot-container,
.compare-page .compare-visual-bleed .sp-card-interactive-stage .svg-container {
  width: 100% !important;
  height: 100% !important;
}

/* dcc.Graph renders a full-height sibling above the plot div; pin the plot to
   the canvas so it can't be pushed below the stage's overflow clip. The bottom
   inset reserves a band for the transport panel, so the controls sit BELOW the
   chart (new_content-preview style) instead of covering it — and Play stays
   usable while the animation runs. */
/* NOTE: #compare-shell (ID) scope — the shared card sizing rules in styles.css
   are keyed at ID level (:is(#main-feed-shell…, .real-feed-route) …
   { height:100% !important }), so class-only selectors can never out-specify
   them. Same trick as #explore-shell in assets/explore.css. */
#compare-shell .compare-visual-bleed .sp-card-interactive-stage .js-plotly-plot {
  position: absolute !important;
  inset: 0 0 var(--cmp-dock-band) 0 !important;
  height: auto !important;
  width: auto !important;
  max-height: none !important;
}

/* ---- 4.1 (D-60): the card IS the video — the render scaled as a picture ----
   utils/card_interactive builds the Chart card's figure from the export's own
   (config, viewport) pair and mounts it as
     .sp-card-interactive-scale-wrap (the dcc.Loading parent = the stage box)
       > .sp-card-interactive-scale-stage (inline width/height = the video canvas,
                                           1080x1350 / 1920x1080)
         > .sp-card-interactive-graph-box (inline left/top/width/height % = the
                                           export shell's graph_style)
           > .dash-graph (100 % of the box = the figure's build viewport)
   assets/studio_preview_scale.js (the studio's D-57 script, second root) writes
   --sp-preview-scale + the class sp-preview-scaled on the wrap; the transform
   below is the ONLY thing that sizes the picture. The stage's padding box is
   width x the mode's aspect (+ the dock band), i.e. exactly the scaled canvas:
   the plot no longer needs the dock inset, the wrap (inset 0, styles.css) does
   not either — the dock band sits below the scaled picture by construction.
   The stage is hidden until the first measure so a rebuilt card never paints
   at canvas size. */
.compare-page .compare-visual-bleed .sp-card-interactive-scale-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: top left;
  visibility: hidden;
}

.compare-page .compare-visual-bleed .sp-card-interactive-scale-wrap.sp-preview-scaled > .sp-card-interactive-scale-stage {
  visibility: visible;
  transform: scale(var(--sp-preview-scale, 1));
}

.compare-page .compare-visual-bleed .sp-card-interactive-graph-box {
  position: absolute;
  overflow: hidden;
}

/* inside the scaled canvas the plot fills its graph box (the dock inset above
   is for the responsive card only; same id-level specificity + more classes) */
#compare-shell .compare-visual-bleed .sp-card-interactive-scale-stage .js-plotly-plot {
  inset: 0 !important;
}

/* the underlay carries bottom-anchored overlays (big frame label) — keep it in
   the same box as the plot so nothing renders under the transport band */
#compare-shell .compare-visual-bleed .sp-card-interactive-stage .sp-card-interactive-underlay {
  inset: 0 0 var(--cmp-dock-band) 0 !important;
}

/* loading spinner in the card slot follows the accent */
.compare-page .cmp-card-wrap .dash-sk-circle .dash-sk-child::before {
  background-color: var(--cmp-accent) !important;
}

/* ---- transport panel (page-scoped DS restyle of the shared playbar) -------
   User feedback 2026-08-24: the shared navy panel is oversized for its small
   controls and clashes with this page. Compacted + recolored to DS here;
   feed/detail keep the shared look (everything under #compare-shell). */

/* #compare-shell#compare-shell: shared playbar rules are ID-level
   (:is(#main-feed-shell…, .real-feed-route)); doubling the id outranks them. */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-interactive-action-panel {
  background: var(--cmp-chrome) !important;
  border: 1px solid var(--cmp-border) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  padding: 8px 12px 10px !important;
  height: auto !important;
  min-height: 0 !important;
}

#compare-shell .compare-visual-bleed .sp-card-interactive-control-stack {
  position: relative;
  padding-top: 0 !important;
  gap: 0 !important;
}

/* no collapse chevron in the mockup — the transport is always open here
   (feed/detail keep the collapsible panel) */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-interactive-panel-close {
  display: none !important;
}

/* season + percent readout, upserted into the scrub's top padding zone by the
   playhead sync callback (absolute: must not shift the slider — the playhead
   dot is anchored a fixed distance from the scrub top) */
#compare-shell .compare-visual-bleed .cmp-transport-info {
  position: absolute;
  top: 0;
  left: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--cmp-mono);
  font-size: 11px;
  line-height: 1;
  color: var(--cmp-text-2);
  pointer-events: none;
  z-index: 2;
}

#compare-shell .compare-visual-bleed .cmp-transport-info b {
  font-weight: 700;
  color: var(--cmp-text);
}

/* D-19: a still (Scatter) labels the bar instead of a frame */
#compare-shell .compare-visual-bleed .cmp-transport-info.is-static .cmp-transport-label {
  color: var(--cmp-muted);
}

#compare-shell .compare-visual-bleed .cmp-transport-pct {
  color: var(--cmp-accent);
  font-weight: 700;
}

#compare-shell .compare-visual-bleed .sp-card-int-playbar {
  align-items: center;
  gap: 10px;
}

/* play: DS accent, compact (ActionIcon paints via --ai-* vars — override both) */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-interactive-play {
  width: 36px !important;
  height: 36px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  background: var(--cmp-accent) !important;
  color: var(--sp-bg) !important;
  --ai-bg: var(--cmp-accent);
  --ai-hover: var(--cmp-accent-hover);
  --ai-color: var(--sp-bg);
}

#compare-shell#compare-shell .compare-visual-bleed .sp-card-interactive-play:hover {
  background: var(--cmp-accent-hover) !important;
}

/* roster + tune buttons duplicate the page's own chips (PLAYERS etc.) —
   hidden here so the scrubber gets the full panel width (user 2026-08-24).
   Feed/detail keep them. */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-playbar .mantine-ActionIcon-root:not(.sp-card-interactive-play) {
  display: none !important;
}

#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub {
  flex: 1 1 auto !important;
  min-width: 0;
}

/* The filter form owns trimming on desktop and mobile. Keep the existing
   transport rail and DOM progress fill without coupling them to filter values. */
/* padding-top 20 is load-bearing: the DOM playhead dot is anchored a fixed
   distance from the scrub top — shrinking the padding lifts the rail off the
   dot's line. */
#compare-shell .compare-visual-bleed .sp-card-int-scrub {
  padding-top: 20px !important;
  overflow: hidden; /* clips the playhead's full-width progress fill at 0 */
}

#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub .mantine-RangeSlider-root {
  padding-inline: 0 !important;
  pointer-events: none;
}

#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub .mantine-RangeSlider-trackContainer {
  padding-inline: 0 !important;
  margin-inline: 0 !important;
}

#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub .mantine-RangeSlider-track {
  margin-inline: 0 !important;
  height: 6px !important;
}

#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub .mantine-RangeSlider-track::before {
  background: var(--cmp-track) !important;
  border-radius: 999px;
  inset-inline: 0 !important;
}

/* the filled range bar stays hidden (it overhangs the thumbs by a constant
   offset — the orange playhead fill carries the position instead) */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub .mantine-RangeSlider-bar {
  display: none !important;
}

/* Remove both trim controls (including keyboard focus), keeping the shared
   playback component and its animation timing intact. */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub .mantine-RangeSlider-thumb {
  display: none !important;
}

#compare-shell .cmp-time-range-label {
  color: var(--cmp-text);
  font-size: 14px;
  font-weight: 600;
}

#compare-shell .cmp-time-range-slider {
  margin: 4px 11px 12px;
}

/* A small, closed place under an axis for its less common choice (Compared by > Games). */
#compare-shell .cmp-advanced > summary {
  padding: 13px 0;
  color: var(--cmp-text-2);
  font-family: var(--cmp-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#compare-shell .cmp-advanced[open] > summary {
  color: var(--cmp-text);
}

#compare-shell .cmp-advanced .mantine-Switch-root {
  padding: 2px 0 10px;
}

#compare-shell .cmp-time-range-slider .mantine-RangeSlider-thumb {
  border-color: var(--cmp-accent);
  background: var(--cmp-text);
}

/* doubled id: the shared rule pins display:flex !important at ID level */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-scrub-ends {
  display: none !important;
}

/* DOM playhead: orange knob = position (the value lives in the chart's big
   frame label; the transport text row arrives with the live-sync phase) */
#compare-shell .compare-visual-bleed .sp-card-int-playhead-dot {
  position: relative;
  z-index: 0;
  width: 14px !important;
  height: 14px !important;
  background: var(--cmp-accent) !important;
  border: 2px solid var(--sp-bg) !important;
  box-shadow: none !important;
}

/* progress fill: from the left scrub edge to the knob — rides the playhead's
   JS-driven left:X%, so it animates with playback for free */
#compare-shell .compare-visual-bleed .sp-card-int-playhead-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 50%;
  transform: translateY(-50%);
  width: 200vw;
  height: 6px;
  border-radius: 999px;
  background: var(--cmp-accent);
  z-index: -1;
}

/* visibility (not display): the chip sits ABOVE the dot inside the playhead
   wrapper — removing it from layout would lift the dot off the rail line. */
#compare-shell#compare-shell .compare-visual-bleed .sp-card-int-playhead-chip {
  visibility: hidden !important;
}

/* ---- table view ----------------------------------------------------------- */

.compare-page .cmp-table-card {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 16px;
  padding: 6px 4px;
}

.compare-page .cmp-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare-page .cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--cmp-mono);
  font-size: 12px;
  color: var(--cmp-text-2);
}

.compare-page .cmp-table th {
  font-family: var(--cmp-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cmp-muted);
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--cmp-border);
  white-space: nowrap;
}

.compare-page .cmp-table td {
  text-align: right;
  padding: 7px 10px;
  border-bottom: 1px solid var(--cmp-border-inset);
  white-space: nowrap;
}

.compare-page .cmp-table th:first-child,
.compare-page .cmp-table td:first-child {
  text-align: left;
  color: var(--cmp-muted);
}

.compare-page .cmp-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---- sticky CTA (DS §5) --------------------------------------------------- */

/* Interim compact form (user feedback 2026-08-24: the fixed full-width bar
   ate too much space and covered the card's transport) — an in-flow pill right
   below the preview. Final placement is an open question for the Claude Design
   round (docs/explore_design_brief.md). */
.compare-page .cmp-cta-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.compare-page .cmp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--cmp-accent);
  color: var(--sp-bg) !important;
  font-family: var(--cmp-ui);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
}

.compare-page .cmp-cta:hover {
  background: var(--cmp-accent-hover);
}

/* ---- player dialog (DS §1.1 + §5; scoped by .cmp-sheet) ------------------ */

.cmp-sheet:where(dialog) {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.cmp-sheet:where(dialog)[open] { display: flex; align-items: flex-end; }
.cmp-sheet:where(dialog)::backdrop { background: transparent; }
:root:where([data-sp-has~="cmp-sheet-open"]):not(.sp-s):not(.sp-s):not(sp-s), body:where([data-sp-has~="cmp-sheet-open"]):not(.sp-s):not(.sp-s):not(sp-s) { overflow: hidden; }
.cmp-sheet .cmp-sheet-content { position: relative; width: 100%; }
.cmp-sheet .cmp-sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.cmp-sheet .cmp-sheet-body { padding: 16px; }
.cmp-sheet .cmp-sheet-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.cmp-sheet .cmp-sheet-close::before {
  content: ''; width: 18px; height: 18px; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M6 18 18 6'/%3E%3C/svg%3E") center/contain no-repeat;
}

.cmp-sheet .cmp-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 12, 0.6) !important;
  backdrop-filter: blur(3px);
}

.cmp-sheet .cmp-sheet-content {
  background: var(--cmp-chrome);
  color: var(--cmp-text);
  border-top: 1px solid var(--cmp-border);
  border-radius: 20px 20px 0 0;
  height: auto !important; /* hug the content (DS: sheet, not a full drawer) */
  max-height: 72vh !important;
}

.cmp-sheet .cmp-sheet-header {
  background: var(--cmp-chrome);
  height: auto;
  min-height: 0;
  padding-bottom: 4px;
}

/* beats the global .cmp-sheet-title (capitalized, centered, 1.75rem) */
.cmp-sheet .cmp-sheet-title {
  font-family: var(--cmp-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cmp-text);
  text-transform: none;
  text-align: left;
  width: auto;
  margin: 0;
}

.cmp-sheet .cmp-sheet-close {
  color: var(--cmp-muted);
}

.cmp-sheet .cmp-sheet-close:hover {
  color: var(--cmp-text);
  background: var(--cmp-track);
}

.cmp-sheet .cmp-sheet-body {
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* tall variant (player picker): fixed height so the list doesn't jump while
   typing; the list row is the only scrolling region */
.cmp-sheet--tall .cmp-sheet-content {
  height: 86vh !important;
  max-height: 86vh !important;
  display: flex;
  flex-direction: column;
}

.cmp-sheet--tall .cmp-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.cmp-sheet--tall .cmp-sheet-stack {
  flex: 1 1 auto;
  min-height: 0;
}

/* only the list row may shrink/scroll — without this, the list's huge content
   basis makes flexbox squash the fixed rows (search, hint, Done CTA) to a
   sliver once the list overflows the fixed-height sheet */
.cmp-sheet--tall .cmp-sheet-stack > :not(.cmp-player-list) {
  flex: 0 0 auto;
}

.cmp-sheet .cmp-player-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* roster-style rows (pattern from the interactive card, DS colors) */
.cmp-sheet .cmp-player-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 6px 12px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  color: var(--cmp-text-2);
  font-family: var(--cmp-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.cmp-sheet .cmp-player-row.is-selected {
  border-color: var(--cmp-text-2);
  color: var(--cmp-text);
}

.cmp-sheet .cmp-player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--cmp-track);
}

.cmp-sheet .cmp-player-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cmp-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cmp-muted);
}

.cmp-sheet .cmp-player-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmp-sheet .cmp-player-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--cmp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
}

.cmp-sheet .cmp-player-row.is-selected .cmp-player-check {
  background: var(--cmp-selected-bg);
  border-color: var(--cmp-selected-bg);
  color: var(--cmp-selected-text);
}

.cmp-sheet .cmp-sheet-hint {
  font-family: var(--cmp-mono);
  font-size: 10px;
  color: var(--cmp-muted);
  text-align: center;
}

/* inputs (DS: bg surface, border, radius 10) — the roster search field */
.cmp-sheet .mantine-Input-input,
.cmp-sheet .mantine-InputBase-input {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-border);
  border-radius: 10px;
  color: var(--cmp-text);
  min-height: 46px;
  font-family: var(--cmp-ui);
  font-size: 14px;
}

.cmp-sheet .mantine-Input-input::placeholder,
.cmp-sheet .mantine-InputBase-input::placeholder {
  color: var(--cmp-muted);
}

.cmp-sheet .mantine-Input-section {
  color: var(--cmp-muted);
}

/* sheet CTA (DS §4, primary button incl. the v6 disabled state) */
.cmp-sheet .cmp-sheet-cta {
  height: 48px;
  background: var(--cmp-accent) !important;
  color: var(--sp-bg) !important;
}

.cmp-sheet .cmp-sheet-cta:hover:not(:disabled):not([data-disabled]) {
  background: var(--cmp-accent-hover) !important;
}

.cmp-sheet .cmp-sheet-cta:disabled,
.cmp-sheet .cmp-sheet-cta[data-disabled] {
  background: var(--cmp-track) !important;
  color: var(--cmp-muted) !important;
}

.cmp-sheet .cmp-sheet-cta .mantine-Button-label {
  font-family: var(--cmp-ui);
  font-size: 15px;
  font-weight: 600;
}

/* ---- desktop: the build form is an open left panel (D-5, mockup A4) ------
   UX program 2026-09, backlog 1.2. >=1024 px the page is a two-column grid:
   the build form (#cmp-setup) is a permanently open, sticky left panel and
   the chart column takes the rest of the window (graph-full-width rule: no
   520 px "phone in the middle" any more). The form keeps the SAME element
   and the same className protocol — the draft controller writes --page / --sheet
   [is-open]; this band simply ignores the sheet semantics (scrim, close,
   fixed overlay). #compare-shell scope: it outranks every .compare-page .cmp-setup--*
   rule above without !important. */
@media (min-width: 1024px) {
  #compare-shell {
    /* Shared by the filter grid and viewport-fixed loading overlay. */
    --cmp-filter-panel-width: 360px;
  }

  #compare-shell .cmp-container {
    max-width: none;
    padding: 0;
    display: grid;
    grid-template-columns: var(--cmp-filter-panel-width) minmax(0, 1fr);
    align-items: start;
    gap: 0;
  }

  /* the panel: first column, spanning every row of the chart column */
  #compare-shell .cmp-setup {
    display: block;
    position: sticky;
    top: 0;
    grid-column: 1;
    grid-row: 1 / span 6;
    inset: auto;
    z-index: 2;
    height: calc(100vh - var(--sp-header-h));
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px 20px 0;
    background: var(--cmp-chrome);
    border-right: 1px solid var(--cmp-border-inset);
  }

  #compare-shell .cmp-setup .cmp-setup-scrim,
  #compare-shell .cmp-setup .cmp-setup-close,
  #compare-shell .cmp-setup .cmp-setup-head {
    display: none;
  }

  #compare-shell .cmp-setup .cmp-setup-card {
    position: static;
    inset: auto;
    min-height: 100%;
    max-height: none;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: none;
    border: 0;
    border-radius: 0;
    animation: none;
  }

  /* Keep Apply filters at the panel bottom before and after the first build. */
  #compare-shell .cmp-setup .cmp-setup-cta {
    position: sticky;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    box-shadow: 0 -12px 16px var(--cmp-chrome);
  }

  #compare-shell .cmp-setup-card::after {
    /* keeps the sticky CTA off the panel's bottom edge */
    content: "";
    display: block;
    height: 20px;
  }

  /* desktop density: the panel serves a mouse, not a thumb, so the 44px
     touch targets the sheet needs (Apple HIG) drop to the 36-40px of a
     desktop segmented control (Material 40, macOS 32). Mobile keeps 44. */
  #compare-shell .cmp-setup .cmp-setup-card {
    gap: 18px;
  }

  #compare-shell .cmp-setup .cmp-section {
    gap: 8px;
  }

  #compare-shell .cmp-setup .cmp-setup-players {
    min-height: 44px;
    border-radius: 12px;
    font-size: 14px;
  }

  #compare-shell .cmp-setup .mantine-Chip-label,
  #compare-shell .cmp-setup .cmp-kind-grid .mantine-Chip-label {
    min-height: 36px;
    border-radius: 10px;
  }

  #compare-shell .cmp-setup .cmp-metric-all,
  #compare-shell .cmp-setup .mantine-Input-input,
  #compare-shell .cmp-setup .mantine-InputBase-input {
    min-height: 36px;
    border-radius: 10px;
  }

  #compare-shell .cmp-setup .cmp-aggregate-row {
    min-height: 28px;
  }

  #compare-shell .cmp-setup .cmp-quick { min-width: 36px; height: 36px; border-radius: 10px; }
  #compare-shell .cmp-setup .cmp-stepper .mantine-NumberInput-wrapper { height: 36px; border-radius: 10px; }
  #compare-shell .cmp-setup .cmp-stepper .mantine-NumberInput-control { flex-basis: 36px; width: 36px; }
  /* the icon above the word needs more than the panel's 36 px */
  #compare-shell .cmp-setup .cmp-season-grid .mantine-Chip-label { min-height: 52px; }

  #compare-shell .cmp-setup .cmp-setup-cta {
    min-height: 46px;
    font-size: 15px;
  }

  /* chart column */
  #compare-shell .cmp-head,
  #compare-shell .cmp-error,
  #compare-shell .cmp-empty,
  #compare-shell .cmp-preview {
    grid-column: 2;
    margin-inline: 32px;
  }

  #compare-shell .cmp-head {
    margin-top: 20px;
    margin-bottom: 20px;
  }

  #compare-shell .cmp-preview {
    margin-bottom: 32px;
  }

  #compare-shell .cmp-title {
    font-size: 26px;
  }

  #compare-shell .cmp-summary-row {
    display: none;
  }

  /* the first-build overlay covers the chart column only; the panel stays */
  #compare-shell .cmp-build-loading {
    left: calc(var(--sp-page-offset, 0px) + var(--cmp-filter-panel-width));
  }
}

/* ---- saved-question mode (backlog 1.4a, D-2 / D-25) ------------------------
   /explore?question_id=N for a non-explore question: the shell carries
   .compare-page--saved and the build form swaps its sections — the
   comparison-only ones (players, metric chips, season, compared-by chips) and
   their chips hide, the saved-only ones (roster chips, fixed Metric /
   Compared-by labels, time range, Y range) show. Both sets exist in every
   layout so the callbacks keep their ids; only CSS decides. */
.compare-page:not(.compare-page--saved) .cmp-saved-only,
.compare-page--saved .cmp-compare-only {
  display: none !important;
}

/* non-editable Metric / Compared-by value: the pick-chip frame without the
   affordance, so the reduced form reads complete, not crippled (D-2) */
.compare-page .cmp-fixed-value {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  background: var(--cmp-surface);
  color: var(--cmp-text);
  font-family: var(--cmp-ui);
  font-size: 14px;
  font-weight: 600;
}

/* roster chips two per row (a saved question can carry 20+ entities) */
.compare-page .cmp-entity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.compare-page .cmp-entity-grid .mantine-Chip-label {
  min-height: 40px;
}

/* ---- "Export video" on Chart (backlog 1.6b, D-7 / D-17 / D-20) --------------
   The CTA pair (Design post = filled, Export video = ghost pill; the lock marks
   the anonymous "Sign in to export"), and the export sheet: the same page-owned
   scrim + card pattern as the build sheet — a bottom sheet on phones, a centred
   card on >=1024 px. Panels (options / progress / download) are toggled inline
   by the clientside store followers, never by CSS. */
.compare-page .cmp-cta-wrap {
  gap: 10px;
  flex-wrap: wrap;
}

.compare-page .cmp-cta--ghost {
  gap: 6px;
  background: transparent;
  border: 1px solid var(--cmp-border);
  color: var(--cmp-text) !important;
  cursor: pointer;
}

.compare-page .cmp-cta--ghost:hover {
  background: var(--cmp-surface);
  border-color: var(--cmp-text-3, var(--cmp-muted));
}

.compare-page .cmp-setup-close.cmp-filter-cancel {
  width: auto;
  min-width: 80px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-family: var(--cmp-ui);
  font-size: 14px;
  font-weight: 600;
}

.compare-page .cmp-cta-lock {
  color: var(--cmp-muted);
}

.cmp-export {
  display: none;
}

.cmp-export.is-open,
.cmp-export-dialog[open] {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1700; /* above the build sheet (1600), below the roster sheet (2100) */
}

.cmp-export-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(8, 9, 12, 0.6);
  backdrop-filter: blur(3px);
}

.cmp-export-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--cmp-chrome);
  border: 1px solid var(--cmp-border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  animation: cmp-sheet-in 0.22s ease;
}

.cmp-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cmp-export-head > .cmp-setup-close {
  width: auto;
  min-width: 64px;
  min-height: 44px;
}

.cmp-export-title {
  margin: 0;
  font-family: var(--cmp-display, var(--cmp-ui));
  font-size: 20px;
  font-weight: 700;
  color: var(--cmp-text);
}

.cmp-export-line,
.cmp-export-detail {
  font-family: var(--cmp-ui);
  font-size: 13px;
  color: var(--cmp-muted);
}

.cmp-export-options,
.cmp-export-progress {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cmp-export-status {
  font-family: var(--cmp-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--cmp-text);
}

.cmp-export-bar .mantine-Progress-section {
  background: var(--cmp-accent);
}

.cmp-export-run,
.cmp-export-download {
  position: static;
  box-shadow: none;
  text-decoration: none !important;
  text-align: center;
}

.cmp-export-cancel {
  align-self: center;
}

@media (min-width: 1024px) {
  .cmp-export-card {
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 32px));
    max-height: 80vh;
    border-bottom: 1px solid var(--cmp-border);
    border-radius: 20px;
    padding: 22px 22px 20px;
    animation: none;
  }
}


.compare-page .cmp-preview--ranking .cmp-card-wrap {
  aspect-ratio: auto; height: auto; max-height: none;
  width: 100%;
  max-width: 480px;
  min-width: 0;
  margin-inline: auto;
}
.compare-page .cmp-preview--ranking .cmp-legend { display: none; }


/* Compare presentation toolbar and mobile filter screen (2026-09-18). */
.compare-page .cmp-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 8px;
}
.compare-page .cmp-back { width: 44px; height: 44px; }
.compare-page .cmp-title { grid-column: 1 / -1; grid-row: 2; line-height: 1.25; }
.compare-page .cmp-head::before {
  content: "Compare"; grid-column: 2; grid-row: 1; align-self: center;
  font-family: var(--cmp-display); font-weight: 800; font-size: 21px;
}
.compare-page:has(.cmp-setup--page) .cmp-head::before { content: none; }
.compare-page:has(.cmp-setup--page) .cmp-title { grid-column: 2 / -1; grid-row: 1; align-self: center; }
.compare-page .cmp-view-wrap {
  grid-column: 3; grid-row: 1; display: flex; gap: 8px; align-items: center;
  min-width: 0; justify-content: flex-end;
}
.compare-page .cmp-view-options, .compare-page .cmp-format-options { display: none; }
.compare-page .cmp-view-menu-trigger, .compare-page .cmp-filters-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 12px;
  border: 1px solid var(--cmp-border); border-radius: 10px;
  background: var(--cmp-surface); color: var(--cmp-text);
  font: 600 14px var(--cmp-ui); cursor: pointer;
}
.compare-page .cmp-view-menu-trigger:hover:not(:disabled),
.compare-page .cmp-filters-button:hover { border-color: var(--cmp-text-2); }
.compare-page button:focus-visible, .compare-page a:focus-visible {
  outline: 2px solid var(--cmp-accent); outline-offset: 3px;
}
.compare-page .cmp-format-control.is-disabled { opacity: .5; }
.compare-page .cmp-format-control.is-disabled .cmp-format-options { pointer-events: none; }
.compare-page .cmp-view-menu-trigger:disabled { cursor: default; }
.cmp-aspect-icon {
  display: inline-block; flex: 0 0 auto; border: 1.5px solid currentColor;
  border-radius: 3px; vertical-align: middle;
}
.cmp-aspect-icon--horizontal { width: 25px; height: 14px; }
.cmp-aspect-icon--vertical { width: 18px; height: 22px; }
.cmp-chart-icon { display: inline-block; width: 22px; height: 22px; background: currentColor; mask-size: contain; mask-repeat: no-repeat; vertical-align: middle; flex-shrink: 0; }
.cmp-menu-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 2px 0; }
.compare-page .cmp-start-icon .cmp-chart-icon { width: 64px; height: 64px; }
.cmp-presentation-menu {
  background: var(--sp-surface); color: var(--sp-text);
  border: 1px solid var(--sp-border-strong); border-radius: 12px;
  padding: 6px; font-family: var(--sp-font-ui);
  max-width: calc(100vw - 24px);
}
.cmp-presentation-menu .mantine-Menu-label { color: var(--sp-text-2); }
.cmp-presentation-menu .mantine-Menu-item {
  min-height: 44px; border-radius: 8px; color: var(--sp-text);
  margin-block: 3px; font-size: 15px;
}
.cmp-presentation-menu .mantine-Menu-itemSection[data-position="left"] {
  width: 28px; min-width: 28px; display: flex; justify-content: center; margin-right: 12px;
}
.cmp-presentation-menu .mantine-Menu-item.is-selected {
  background: var(--sp-selected-bg); color: var(--sp-selected-text); font-weight: 600;
}
.cmp-presentation-menu .mantine-Menu-item:not(.is-selected):hover { background: var(--sp-chip); }
.compare-page .cmp-summary-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  grid-column: 1 / -1; grid-row: 3; min-width: 0;
  flex-wrap: nowrap; overflow: visible; margin: 0; padding: 0;
}
.compare-page .cmp-filter-summary {
  min-width: 0; display: flex; flex-direction: column; gap: 3px;
  color: var(--cmp-text-2); font: 14px/1.5 var(--cmp-ui); overflow-wrap: anywhere;
}
.compare-page .cmp-filters-button { flex-shrink: 0; }
.compare-page .cmp-field-help { color: var(--cmp-text-2); font-size: 13px; line-height: 1.5; margin: 0; }
.compare-page .cmp-start { display: none; }
.compare-page .cmp-start-content { width: min(100%, 540px); text-align: center; margin: auto; }
.compare-page .cmp-start-icon { color: var(--cmp-text-2); margin: 0 auto 24px; display: block; }
.compare-page .cmp-start h2 { font: 800 clamp(24px, 2.3vw, 32px)/1.2 var(--cmp-display); margin: 0 0 16px; }
.compare-page .cmp-start p { max-width: 440px; margin: 0 auto; color: var(--cmp-text-2); line-height: 1.6; }
.compare-page .cmp-start-cta {
  display: inline-flex; justify-content: center; align-items: center;
  min-height: 48px; max-width: 100%; margin: 28px auto 20px; padding: 12px 24px;
  background: var(--cmp-accent); color: var(--sp-on-accent); border: 0;
  border-radius: var(--sp-radius-pill); font: 600 15px/1.4 var(--cmp-ui); cursor: pointer;
}
.compare-page .cmp-start-cta:hover:not(:disabled) { background: var(--cmp-accent-hover); }
.compare-page .cmp-start-cta:disabled { background: var(--cmp-track); color: var(--cmp-text-2); cursor: default; }
.compare-page .cmp-start .cmp-start-hint { font-size: 13px; }
.compare-page .cmp-preview--table .cmp-legend,
.compare-page .cmp-preview--table #cmp-export-open,
.compare-page .cmp-preview--table #cmp-export-login { display: none !important; }
.compare-page .cmp-table-note { color: var(--cmp-text-2); font-size: 13px; margin: 0 0 12px; }

@media (max-width: 1023px) {
  body.cmp-filter-open { overflow: hidden; }
  .compare-page .cmp-setup--sheet .cmp-setup-card {
    inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
    border: 0; border-radius: 0; padding: 0 16px env(safe-area-inset-bottom, 0px);
    overscroll-behavior: contain;
  }
  .compare-page .cmp-setup--sheet .cmp-setup-head {
    position: sticky; top: 0; z-index: 2; padding-block: max(12px, env(safe-area-inset-top, 0px)) 12px;
    min-height: 64px; background: var(--cmp-chrome); border-bottom: 1px solid var(--cmp-border);
  }
  .compare-page .cmp-setup-close { width: auto; min-width: 64px; min-height: 44px; font-size: 15px; }
  .compare-page .cmp-setup--sheet .cmp-setup-cta {
    position: sticky; bottom: 0; margin-top: auto; flex-shrink: 0;
    border-radius: 12px; margin-bottom: 12px;
    box-shadow: 0 -12px 0 8px var(--cmp-chrome), 0 12px 0 8px var(--cmp-chrome);
  }
  .compare-page .cmp-setup--sheet .cmp-setup-card > .cmp-section:last-of-type { margin-bottom: 20px; }
}
@media (min-width: 1024px) {
  #compare-shell .cmp-container { grid-template-rows: auto auto 1fr; min-height: calc(100dvh - var(--sp-header-h)); }
  #compare-shell .cmp-setup { grid-row: 1 / span 3; }
  #compare-shell .cmp-head { grid-row: 1; grid-template-columns: 36px minmax(0, 1fr) auto; row-gap: 16px; }
  #compare-shell .cmp-head::before { content: none; }
  #compare-shell .cmp-title { grid-column: 2 / -1; grid-row: 1; align-self: center; }
  #compare-shell .cmp-view-wrap { grid-column: 3; grid-row: 2; justify-self: end; align-self: center; margin: 0; gap: 8px; }
  #compare-shell .cmp-summary-row { display: flex; grid-column: 1 / 3; grid-row: 2; align-self: center; margin: 0; padding-right: 12px; }
  #compare-shell .cmp-filters-button { display: none; }
  #compare-shell .cmp-filter-summary { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
  #compare-shell .cmp-error { grid-row: 2; }
  #compare-shell .cmp-preview, #compare-shell .cmp-empty { grid-row: 3; }
  #compare-shell .cmp-start {
    grid-column: 2; grid-row: 2 / span 2; display: grid; place-items: center;
    align-self: stretch; min-height: 500px; padding: 48px 32px 96px;
  }
  #compare-shell .cmp-format-control { display: flex; align-items: center; }
  #compare-shell .cmp-format-options,
  #compare-shell .cmp-view-options {
    display: flex; align-items: center; gap: 2px; padding: 2px;
    border: 1px solid var(--cmp-border); border-radius: 8px;
    background: var(--cmp-surface);
  }
  #compare-shell .cmp-format-menu { display: none; }
  #compare-shell .cmp-view-menu { display: none; }
  #compare-shell .cmp-view-wrap .mantine-Chip-root { position: relative; display: flex; }
  #compare-shell .cmp-view-wrap .mantine-Chip-input { position: absolute; }
  #compare-shell .cmp-view-wrap .mantine-Chip-label {
    display: flex; align-items: center; justify-content: center; height: 28px; min-height: 28px;
    border: 1px solid transparent; border-radius: 6px;
    background: transparent; color: var(--cmp-text-2); font-size: 12px; padding: 0 8px;
  }
  #compare-shell .cmp-view-wrap .mantine-Chip-label:hover:not([data-checked]):not([data-disabled]) {
    background: var(--cmp-track); color: var(--cmp-text);
  }
  #compare-shell .cmp-view-wrap .mantine-Chip-label[data-checked] {
    background: var(--cmp-selected-bg); color: var(--cmp-selected-text); border-color: var(--cmp-selected-bg);
  }
  #compare-shell .cmp-view-wrap .mantine-Chip-iconWrapper { display: none; }
  #compare-shell .cmp-view-chip-content { display: inline-flex; align-items: center; gap: 4px; }
  #compare-shell .cmp-view-chip-content .cmp-chart-icon { width: 14px; height: 14px; }
  #compare-shell .cmp-view-wrap .cmp-aspect-chip .mantine-Chip-label { width: 30px; min-width: 30px; padding: 0; }
  #compare-shell .cmp-format-options .cmp-aspect-icon--horizontal { width: 18px; height: 10px; }
  #compare-shell .cmp-format-options .cmp-aspect-icon--vertical { width: 12px; height: 16px; }
  #compare-shell .cmp-view-menu-trigger { height: 34px; min-height: 34px; font-size: 12px; }
  #compare-shell .cmp-view-menu-trigger .cmp-chart-icon { width: 16px; height: 16px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  #compare-shell .cmp-view-options { display: none; }
  #compare-shell .cmp-view-menu { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .compare-page .cmp-setup--sheet .cmp-setup-card { animation: none; }
}

/* Compact mobile result header and transport (approved mobile refinement). */
.compare-page .cmp-transport-mobile { display: none; }
@media (max-width: 1023px) {
  .compare-page .cmp-container { padding-top: 12px; gap: 12px; }
  .compare-page .cmp-head { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 6px 4px; }
  .compare-page .cmp-head::before { font: 500 15px/1.3 var(--cmp-ui); }
  .compare-page .cmp-back { margin-left: -10px; }
  .compare-page .cmp-back svg { width: 18px; height: 18px; }
  .compare-page .cmp-title {
    display: block; overflow: visible; -webkit-line-clamp: unset;
    font: 600 18px/23px var(--cmp-ui); letter-spacing: -0.01em;
    overflow-wrap: anywhere;
  }
  .compare-page .cmp-view-wrap { gap: 8px; align-self: center; }
  .compare-page .cmp-view-menu-trigger {
    position: relative; isolation: isolate; width: 44px; height: 44px;
    min-width: 44px; padding: 0; gap: 7px; border: 0; background: transparent;
  }
  /* The visible 44 x 30 surface sits inside a full-height touch target. */
  .compare-page .cmp-view-menu-trigger::before {
    content: ""; position: absolute; z-index: -1; inset: 7px 0;
    background: var(--cmp-surface); border: 1px solid var(--cmp-border); border-radius: 6px;
  }
  .compare-page .cmp-view-menu-trigger:hover:not(:disabled)::before { border-color: var(--cmp-text-2); }
  .compare-page .cmp-view-menu-trigger .cmp-chart-icon { width: 16px; height: 16px; }
  .compare-page .cmp-view-menu-trigger .cmp-aspect-icon--vertical { width: 11px; height: 15px; border-radius: 1px; }
  .compare-page .cmp-view-menu-trigger .cmp-aspect-icon--horizontal { width: 17px; height: 10px; border-radius: 1px; }
  .compare-page .cmp-view-menu-trigger .cmp-menu-chevron { width: 5px; height: 5px; margin-inline: 0; }
  .compare-page .cmp-filter-summary { gap: 0; font: 400 12px/17px var(--cmp-ui); }
  .compare-page .cmp-summary-metric { display: none; }
  .compare-page .cmp-summary-row { gap: 8px; }
  .compare-page .cmp-filters-button {
    min-height: 44px; padding: 0; gap: 6px; border: 0; background: transparent;
    color: var(--cmp-text-2); font: 500 13px/1.3 var(--cmp-ui);
  }
  .compare-page .cmp-filters-button:hover { color: var(--cmp-text); }
  .compare-page .cmp-filters-button .cmp-chart-icon { width: 17px; height: 17px; }
  .compare-page .compare-visual-bleed { --cmp-dock-band: 64px; }
  #compare-shell .compare-visual-bleed [data-cmp-frame-label],
  #compare-shell .compare-visual-bleed [data-sp-annotation="sp-frame-label"] { display: none; }
  #compare-shell#compare-shell .compare-visual-bleed .sp-card-interactive-action-panel {
    background: transparent !important; border: 0 !important; border-radius: 0 !important;
    padding: 8px 4px !important;
  }
  #compare-shell#compare-shell#compare-shell .compare-visual-bleed .sp-card-interactive-play {
    width: 44px !important; height: 44px !important;
  }
  #compare-shell .compare-visual-bleed .sp-card-int-playbar { gap: 12px; min-height: 44px; }
  #compare-shell .compare-visual-bleed .sp-card-int-scrub { margin-top: -20px; }
  /* Drop the hidden chip's font-dependent height; center the knob on the 3px rail. */
  #compare-shell .compare-visual-bleed .sp-card-int-playhead { top: 23.5px; }
  #compare-shell#compare-shell .compare-visual-bleed .sp-card-int-playhead-chip { display: none !important; }
  #compare-shell .compare-visual-bleed .cmp-transport-info { display: none; }
  #compare-shell .compare-visual-bleed .cmp-transport-mobile {
    display: block; flex: 0 1 auto; max-width: 35%;
    font: 400 12px/17px var(--cmp-ui); color: var(--cmp-text-2);
    overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
  }
}

/* Team marks retain their full shape in the shared competitor picker. */
.cmp-team-avatar { object-fit: contain; padding: 4px; }

/* Segmented controls with an icon before each label (Players/Teams, Pick/Top).
   Icons are masks keyed on the option value, so they survive the clientside
   relabel (Pick players -> Pick teams). Colour follows the label (dark when active). */
.compare-page .cmp-seg-icons label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* [data-active] too: Mantine uses the active label's ::before as its own
   (hidden, absolutely positioned) background layer */
.compare-page .cmp-seg-icons label::before,
.compare-page .cmp-seg-icons label[data-active]::before {
  content: "";
  position: static;
  display: block;
  inset: auto;
  transform: none;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.compare-page #cmp-subject input[value="players"] + label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0-8 0M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0-8 0M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E");
}

.compare-page #cmp-subject input[value="teams"] + label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a2 2 0 1 0 4 0a2 2 0 0 0-4 0m-2 8v-1a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1M15 5a2 2 0 1 0 4 0a2 2 0 0 0-4 0m2 5h2a2 2 0 0 1 2 2v1M5 5a2 2 0 1 0 4 0a2 2 0 0 0-4 0m-2 8v-1a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a2 2 0 1 0 4 0a2 2 0 0 0-4 0m-2 8v-1a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1M15 5a2 2 0 1 0 4 0a2 2 0 0 0-4 0m2 5h2a2 2 0 0 1 2 2v1M5 5a2 2 0 1 0 4 0a2 2 0 0 0-4 0m-2 8v-1a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");
}

.compare-page #cmp-player-mode input[value="specific"] + label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0-8 0m8 12h6m-3-3v6M6 21v-2a4 4 0 0 1 4-4h4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0-8 0m8 12h6m-3-3v6M6 21v-2a4 4 0 0 1 4-4h4'/%3E%3C/svg%3E");
}

.compare-page #cmp-player-mode input[value="top"] + label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 6h9m-9 6h9m-8 6h8M4 16a2 2 0 1 1 4 0c0 .591-.5 1-1 1.5L4 20h4M6 10V4L4 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 6h9m-9 6h9m-8 6h8M4 16a2 2 0 1 1 4 0c0 .591-.5 1-1 1.5L4 20h4M6 10V4L4 6'/%3E%3C/svg%3E");
}
