/* Game-first Studio. Colours come from arcade.css's tokens. */
body[data-layout] { color-scheme:dark; background:var(--bg); color:var(--ink); }
body[data-layout] .app-topbar { background:#30253f; }
.app-brand { color:var(--cream); }
.app-topbar .notebook-tabs button { color:var(--muted); }
.app-topbar .notebook-tabs button[aria-current=page] { color:var(--cream); border-bottom-color:var(--cyan); }
/* Def vs Pos search and grouped sortable columns work in every layout. */
.overview-controls { width:min(100%,19rem); min-width:0; margin:0 0 0.625rem auto; }
.overview-search { position:relative; min-width:0; }
.overview-search input { width:100%; min-width:0; height:2.25rem; padding:0.4375rem 2rem 0.4375rem 0.625rem; font-size:0.75rem; }
.overview-search input::-webkit-search-cancel-button { -webkit-appearance:none; }
.overview-search-clear {
  position:absolute; right:0.25rem; top:50%; transform:translateY(-50%);
  width:1.75rem; height:1.75rem; padding:0; border:0; border-radius:var(--r-control);
  background:transparent; color:var(--muted); font-size:1.125rem; line-height:1;
}
.overview-search-clear:hover { color:var(--ink); }
#overview .overview-table thead { position:sticky; top:0; z-index:4; }
#overview .overview-table thead th { position:static; }
#overview .overview-table thead th.row-label { position:sticky; left:0; z-index:5; }
#overview .overview-table .overview-column-headings th[data-market] { min-width:8.5rem; }
#overview .overview-table .overview-market-groups th[data-overview-group] {
  padding:0.5rem 0.75rem; min-width:0; border-top:0;
  color:var(--ink); font-size:0.6875rem; letter-spacing:0.06em; text-transform:uppercase;
  background:var(--surface-raised);
}
#overview .overview-table :is([data-overview-group=alt], .overview-alt-start) { border-left:1px solid var(--muted); }
#overview .overview-sort {
  display:block; width:100%; padding:0; border:0; border-radius:var(--r-data);
  background:transparent; color:inherit; font:inherit; letter-spacing:inherit; text-align:left; cursor:pointer;
}
#overview .overview-sort small { margin:0 0 0.3125rem; }
#overview .overview-sort:hover { color:var(--cyan); }
#overview .overview-sort:focus-visible { outline:2px solid var(--cyan); outline-offset:0.25rem; }
/* Keep Def vs Pos readable without letting its wide comparison grid size the page. */
#overviewPanel,.matrix-workspace { min-width:0; max-width:100%; }
#overview {
  --overview-team-width:11.875rem;
  min-width:0; width:100%; max-width:100%; overflow:auto;
  max-height:max(15rem,calc(100dvh - 15rem));
  overscroll-behavior-x:contain; scrollbar-width:auto;
  scrollbar-color:#614e80 var(--surface-subtle);
  scroll-padding-left:var(--overview-team-width); scroll-padding-top:4rem;
}
#overview:focus-visible { outline:2px solid var(--cyan); outline-offset:0.1875rem; }
body[data-layout] #overview .row-label {
  position:sticky; left:0; z-index:2;
  width:var(--overview-team-width); min-width:var(--overview-team-width); max-width:var(--overview-team-width);
  background:var(--surface-raised); box-shadow:1px 0 0 var(--line);
}
body[data-layout] #overview thead th { position:static; z-index:3; }
body[data-layout] #overview thead .row-label { z-index:4; }
@media(max-width:82.5em) {
  #overview { --overview-team-width:10.25rem; }
  #overview .row-label { padding:0.625rem; }
  #overview .overview-team { gap:0.5rem; }
  #overview .overview-team-badge { width:2.5rem; height:2.5rem; }
  #overview .overview-team>span:last-child { font-size:0.8125rem; }
  #overview thead th:not(:first-child) { min-width:8.25rem; padding:0.75rem 0.625rem; }
  #overview .overview-cell { padding:0.6875rem 0.625rem; }
  #overview .summary-value { font-size:1.125rem; }
}
@media(max-width:41.25em) {
  #overview { --overview-team-width:7rem; }
  #overview .row-label {
    width:var(--overview-team-width)!important; min-width:var(--overview-team-width)!important;
    padding:0.5625rem 0.4375rem;
  }
  #overview .overview-team { flex-direction:column; gap:0.25rem; text-align:center; }
  #overview .overview-team-badge { width:2rem; height:2rem; }
  #overview .overview-team>span:last-child { font-size:0.75rem; line-height:1.35; }
  #overview .row-label small { margin-top:2px; }
}
body[data-layout] .notebook-main { margin-right:0; margin-left:0; max-width:none; }
body[data-layout] .notebook-main { --slate-pad-x:1.25rem; }
body[data-layout][data-active-view=bets] .notebook-main { padding:0 var(--slate-pad-x) 1.875rem; }
/* Research shares the notebook's existing defense picker and selection state. */
body[data-active-view=boards] .notebook-main { margin-left:13rem; }
body[data-active-view=boards] #defenseNav { display:block; padding-top:2px; overscroll-behavior-x:contain; overscroll-behavior-y:auto; }
body[data-active-view=boards] #defenseNav button { min-height:2.75rem; padding:0.3125rem 0.5625rem; gap:0.625rem; font-size:0.75rem; }
body[data-active-view=boards] .defense-board { scroll-margin-top:calc(var(--header-height) + 0.75rem); }
@media(max-width:55em) {
  body[data-active-view=boards] .notebook-main { margin-left:0; }
  body[data-active-view=boards] #defenseNav {
    display:flex; grid-column:1/-1; gap:0.375rem; min-width:0; padding:0 0 0.25rem;
    overflow-x:auto; overscroll-behavior-x:contain;
  }
  body[data-active-view=boards] #defenseNav button { flex:0 0 auto; width:auto; white-space:nowrap; }
}
.position-segments button { min-width:2.9375rem; }
body[data-layout] :is(select,input:not([type=checkbox])) { background:#2c223a; color:var(--ink); border-color:#493860; }
body[data-layout] :is(button,a,summary,input,select):focus-visible { outline:2px solid var(--cyan); outline-offset:0.1875rem; }

/* One game, with sportsbook-style market groups and adjacent research. */
.studio-game-heading {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:0.75rem 1.25rem; margin:0 0 1rem; padding:1.0625rem 1.25rem;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-control);
}
.studio-game-heading h2 { margin:0; font-size:1.5625rem; font-weight:750; line-height:1.3; letter-spacing:-.45px; }
.studio-game-heading h2 { display:flex; align-items:center; flex-wrap:wrap; gap:0.5625rem; }
.studio-game-heading h2>span:not(.team-logo-badge) { color:var(--muted); font-size:1.0625rem; font-weight:400; }
.studio-game-heading p { margin:0.3125rem 0 0; font-size:0.6875rem; line-height:1.6; color:var(--muted); }
.studio-game-heading .team-logo-badge { width:2.625rem; height:2.625rem; }
.studio-game-actions { display:flex; flex-wrap:wrap; gap:0.5625rem; align-items:center; }
.studio-game-heading :is(.text-button,.pd-button) { font-size:0.75rem; }
.studio-game-body { display:grid; grid-template-columns:minmax(21.875rem,25rem) minmax(0,1fr); gap:1.125rem; align-items:start; min-width:0; }
.studio-markets { display:flex; flex-direction:column; min-width:0; max-height:calc(100dvh - var(--header-height) - 1.75rem); }
body[data-layout] .studio-collapse-all { padding:0.3125rem 0; color:var(--cyan); font-size:0.6875rem; white-space:nowrap; }
body[data-layout] .studio-collapse-all:hover:not(:disabled) { color:var(--cream); }
body[data-layout] .studio-collapse-all:disabled { color:var(--muted); opacity:.5; cursor:default; }
#studioList { display:block; flex:1 1 auto; min-height:0; max-height:none; overflow:auto; padding:0 0.1875rem 0 0; scrollbar-width:thin; scrollbar-color:#4c3d64 var(--surface-subtle); }
.studio-market-group { margin:0 0 0.625rem; border:1px solid var(--line); border-radius:var(--r-control); overflow:hidden; background:var(--surface-subtle); }
.studio-market-group>summary {
  display:flex; align-items:center; gap:0.5rem; min-height:2.9375rem; padding:0.75rem 0.8125rem;
  color:var(--ink); background:var(--surface); font-size:0.8125rem; font-weight:650;
  list-style:none; cursor:pointer;
}
.studio-market-group>summary::-webkit-details-marker { display:none; }
.studio-market-group>summary::after { content:"+"; margin-left:auto; color:var(--muted); font-size:1.125rem; font-weight:400; line-height:1; }
.studio-market-group[open]>summary::after { content:"−"; }
.studio-market-group[open]>summary { border-bottom:1px solid var(--line); }
.studio-market-group>summary small { color:var(--muted); font-size:0.625rem; font-weight:400; }
.studio-market-labels { display:grid; grid-template-columns:minmax(0,1fr) 4.75rem 4.75rem; gap:0.375rem; padding:0.5rem 0.6875rem 0.25rem; color:var(--muted); font-size:0.5625rem; text-align:center; text-transform:uppercase; letter-spacing:.45px; }
.studio-market-labels>:first-child { text-align:left; }
.studio-market-row { display:grid; grid-template-columns:minmax(0,1fr) 9.875rem; gap:0.375rem; align-items:center; padding:0.625rem 0.6875rem; border-bottom:1px solid var(--line); }
.studio-market-row:last-child { border-bottom:0; }
body[data-layout] .studio-market-player {
  display:flex; align-items:center; gap:0.5rem; min-width:0; padding:0;
  background:none; color:var(--ink); border:0; border-radius:var(--r-data);
  font-size:0.75rem; font-weight:600; line-height:1.4; text-align:left; cursor:pointer;
}
body[data-layout] .studio-market-player:hover { color:var(--cyan); }
.studio-market-player>.studio-avatar { width:2rem; height:2.375rem; flex:0 0 2rem; background:transparent; }
body[data-layout] .studio-market-player .player-avatar {
  position:relative; overflow:hidden; flex:0 0 2rem; width:2rem; height:2.375rem;
  border:0; border-radius:var(--r-control); background:var(--surface-raised); color:var(--cream);
}
.studio-market-player .player-headshot { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:top; }
.studio-market-player>span:last-child { min-width:0; overflow-wrap:anywhere; }
.studio-market-player strong { display:block; font-size:0.75rem; font-weight:650; }
.studio-market-player small { display:block; margin-top:0.1875rem; color:var(--muted); font-size:0.625rem; font-weight:400; }
/* A player row's small team logo, just before his team code (UI-603): the game's market rows,
   Best in this game, the Top leaks rows, the Roles on the move cards (UI-607) and the Lab's
   games-table Opp cell (UI-609) share this one rule; their containers add no gap of their own.
   The code beside it is the fallback. */
.row-team-logo.team-logo-badge { width:1.1875rem; height:1.1875rem; margin-right:0.25rem; vertical-align:middle; }
body[data-layout] .row-team-logo .team-logo { inset:0; width:100%; height:100%; }
.studio-market-prices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0.375rem; min-width:0; }
body[data-layout] .studio-odds-button {
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.25rem;
  min-width:0; min-height:3rem; padding:0.4375rem 0.3125rem; background:#2c223a;
  color:var(--ink); border:1px solid #493860; border-radius:var(--r-control);
  font-size:0.75rem; font-weight:500; line-height:1.25; font-variant-numeric:tabular-nums; cursor:pointer;
}
body[data-layout] .studio-odds-button strong { color:#ffb168; font-size:0.75rem; font-weight:700; }
.studio-odds-button > .bet-side-label { margin-bottom:-0.25rem; font-size:0.625rem; line-height:1; opacity:0.78; }
body[data-layout] .studio-odds-button:hover:not(:disabled) { background:#382b4a; border-color:var(--cyan); }
body[data-layout] .studio-odds-button[aria-pressed=true] { color:var(--ink); background:#175139; border-color:var(--green); box-shadow:inset 0 0 0 1px var(--green); }
body[data-layout] .studio-odds-button[aria-pressed=true] strong { color:#b4f0d7; }
body[data-layout] .studio-odds-button:disabled { color:var(--muted); opacity:.6; cursor:default; }
.studio-markets .empty-state { font-size:0.75rem; line-height:1.6; }

/* Existing research remains a complete, quieter companion to the markets. */

@media(min-width:110em) {
  body[data-layout] .notebook-main { --slate-pad-x:1.75rem; }
  .studio-game-body { grid-template-columns:minmax(24.375rem,28%) minmax(0,1fr); gap:1.375rem; }
}
@media(max-width:75.625em) {
  .studio-game-body { grid-template-columns:21.875rem minmax(0,1fr); gap:0.75rem; }
  .studio-market-row { grid-template-columns:minmax(0,1fr) 8.5rem; padding-left:0.5625rem; padding-right:0.5625rem; }
  .studio-market-labels { grid-template-columns:minmax(0,1fr) 4.0625rem 4.0625rem; padding-left:0.5625rem; padding-right:0.5625rem; }
}
@media(max-width:61.875em) {
  body[data-layout] .notebook-main { --slate-pad-x:0.875rem; }
  body[data-layout][data-active-view=bets] .notebook-main { padding-bottom:1.75rem; }
  .studio-game-body { grid-template-columns:minmax(0,1fr); gap:1.125rem; }
  .studio-markets { max-height:none; }
  #studioList { flex:0 1 auto; max-height:26.875rem; }
  .studio-market-row { grid-template-columns:minmax(0,1fr) 14.125rem; }
  .studio-market-labels { grid-template-columns:minmax(0,1fr) 6.875rem 6.875rem; }
  body[data-layout] .studio-market-player { gap:0.625rem; }
  .studio-market-player strong { font-size:0.8125rem; }
}
@media(max-width:41.25em) {
  body[data-layout] .notebook-main { --slate-pad-x:0.625rem; }
  .studio-game-heading { padding:0.8125rem; gap:0.75rem; margin-bottom:0.8125rem; }
  .studio-game-heading h2 { font-size:1.375rem; }
  .studio-game-heading .team-logo-badge { width:2rem; height:2rem; }
  .studio-game-actions { width:100%; justify-content:space-between; }
  .studio-market-row { grid-template-columns:minmax(0,1fr) 9.375rem; gap:0.375rem; }
  .studio-market-labels { grid-template-columns:minmax(0,1fr) 4.5rem 4.5rem; }
  .studio-market-player strong { font-size:0.75rem; }
}
@media(max-width:24.75em) {
  .studio-market-row { grid-template-columns:minmax(0,1fr) 8.125rem; padding-left:0.5rem; padding-right:0.5rem; gap:0.3125rem; }
  .studio-market-labels { grid-template-columns:minmax(0,1fr) 3.875rem 3.875rem; padding-left:0.5rem; padding-right:0.5rem; gap:0.3125rem; }
  .studio-market-player>.studio-avatar { flex-basis:1.6875rem; width:1.6875rem; height:2.0625rem; }
  body[data-layout] .studio-market-player { gap:0.3125rem; }
  body[data-layout] .studio-market-player .player-avatar { flex-basis:1.6875rem; width:1.6875rem; height:2.0625rem; }
  .studio-market-player strong { font-size:0.6875rem; }
}
@media(prefers-reduced-motion:no-preference) {
  :is(.studio-game-button,.studio-odds-button) { transition:background-color .12s,border-color .12s; }
}

/* Offered alternate lines stay in the player row; navigation never saves a pick. */
.studio-markets { container-type:inline-size; }
.studio-market-row,.studio-market-labels { grid-template-columns:minmax(0,1fr) 12.75rem; }
.studio-market-labels { padding-top:0.5625rem; padding-bottom:0.4375rem; }
.studio-market-row { gap:0.5rem; padding-top:0.75rem; padding-bottom:0.75rem; }
body[data-layout] .studio-line-control { min-width:0; }
.studio-line-slider { display:grid; grid-template-columns:1.625rem minmax(0,1fr) 1.625rem; align-items:stretch; gap:0.1875rem; min-width:0; }
.studio-line-slider .studio-market-prices { gap:0.25rem; }
body[data-layout] .studio-line-slider.is-alternate .studio-market-prices { grid-template-columns:minmax(0,1fr); }
body[data-layout] .studio-line-slider .studio-odds-button { min-height:3.1875rem; padding:0.375rem 0.1875rem; }
body[data-layout] .studio-line-slider.is-alternate .studio-odds-button { border-color:#614e80; background:#322742; }
body[data-layout] .studio-line-slider.is-alternate .studio-odds-button[aria-pressed=true] { background:#175139; border-color:var(--green); }
body[data-layout] .studio-line-step { display:grid; place-items:center; min-width:0; padding:0; color:var(--cream); background:transparent; border:0; border-radius:var(--r-data); cursor:pointer; }
.studio-line-step span { font-size:1.6875rem; font-weight:400; line-height:1; }
.studio-line-step:hover:not(:disabled) { background:var(--surface-raised); color:var(--cyan); }
body[data-layout] .studio-line-step:disabled { opacity:.22; cursor:default; }
.studio-line-caption { display:grid; grid-template-columns:2rem minmax(0,1fr) 2rem; align-items:center; gap:0.1875rem; min-height:1.5rem; margin-top:0.1875rem; color:var(--muted); font-size:0.5625rem; text-align:center; font-variant-numeric:tabular-nums; }
.studio-line-caption>span:first-child { text-align:left; }
.studio-line-caption>span:last-child { text-align:right; }
.studio-line-default { opacity:.8; }
body[data-layout] .studio-line-reset { justify-self:center; padding:0.25rem 0.5625rem; color:var(--cyan); background:transparent; border:0; border-radius:var(--r-data); font-size:0.625rem; cursor:pointer; }
body[data-layout] .studio-line-reset:hover { color:var(--cream); background:var(--surface-raised); }
.studio-focus-slider { display:grid; grid-template-columns:1.625rem minmax(0,1fr) 1.625rem; align-items:stretch; gap:0.1875rem; min-width:0; }
.studio-focus-track { display:flex; gap:0.5rem; padding:0.1875rem 0; min-width:0; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; scrollbar-color:#493860 transparent; cursor:grab; touch-action:pan-x pan-y; }
.studio-focus-track { grid-column:2; grid-row:1; }
.studio-focus-track.is-fitting { justify-content:center; }
.studio-focus-slider>[data-studio-focus-step="-1"] { grid-column:1; grid-row:1; }
.studio-focus-slider>[data-studio-focus-step="1"] { grid-column:3; grid-row:1; }
body[data-layout] .studio-focus-track.is-dragging,
body[data-layout] .studio-focus-track.is-dragging * { cursor:grabbing; user-select:none; }
.studio-focus-track:focus-visible { outline:2px solid var(--cyan); outline-offset:2px; }
.studio-focus-option { display:block; flex:0 0 min(5.5rem,100%); min-width:0; padding:0.3125rem; border:1px solid transparent; border-radius:var(--r-control); }
body[data-layout] .studio-focus-option.is-main { flex-basis:min(11.5rem,100%); border-color:var(--cyan); background:#2f243e; }
body[data-layout] .studio-focus-prices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0.25rem; min-width:0; }
body[data-layout] .studio-focus-option.is-alternate .studio-focus-prices { grid-template-columns:minmax(0,1fr); }
body[data-layout] .studio-focus-prices .studio-odds-button { min-width:0; min-height:3.1875rem; padding:0.375rem 0.1875rem; }
.studio-focus-prices .studio-odds-button:focus-visible { outline-offset:-0.1875rem; }
.studio-focus-label { display:block; margin-top:0.4375rem; color:var(--muted); font-size:0.625rem; text-align:center; }
.studio-focus-option.is-main .studio-focus-label { color:var(--cream); font-weight:700; }

.studio-focus-slider>.studio-line-step { align-self:start; min-height:4.5rem; }
@container (max-width:340px) {
  .studio-market-row { grid-template-columns:minmax(0,1fr); gap:0.625rem; }
  .studio-market-labels { grid-template-columns:minmax(0,1fr) auto; }
  .studio-market-player strong { font-size:0.8125rem; }
  .studio-market-player>.studio-avatar { width:2rem; flex-basis:2rem; }
  .studio-line-slider { grid-template-columns:2rem minmax(0,1fr) 2rem; }
}
@media (max-width:41.25em) {
  .studio-market-row { grid-template-columns:minmax(0,1fr); gap:0.625rem; }
  .studio-market-labels { grid-template-columns:minmax(0,1fr) auto; }
  .studio-market-player strong { font-size:0.8125rem; }
  .studio-line-slider { grid-template-columns:2rem minmax(0,1fr) 2rem; }
}

/* Touchdown scorer prices use a single named selection, including 2+ TDs. */
body[data-layout] .studio-line-control .scorer-prices { grid-template-columns:minmax(0,1fr); }
.bet-price-pair:has(>.bet-side:only-child) { grid-template-columns:minmax(0,1fr); }

/* Weather and game actions form one compact group at the right of the header. */
.studio-game-heading>.studio-game-context { display:flex; flex:1 1 48.125rem; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:0.75rem 1.25rem; margin-left:auto; min-width:0; }
.studio-game-context>.studio-weather { display:flex; align-items:center; gap:0.625rem; min-width:0; }
.studio-weather-icon { display:block; width:2.375rem; height:2.375rem; flex-shrink:0; color:#e1d8f0; }
.studio-weather-copy { display:grid; gap:0.1875rem; }
.studio-weather-copy>strong { font-size:1.625rem; line-height:1.15; color:var(--ink); font-weight:650; }
.studio-weather-copy>small { color:var(--muted); font-size:0.6875rem; line-height:1.4; }
.studio-weather>.studio-weather-wind { padding-left:0.75rem; border-left:1px solid var(--line); color:var(--ink); font-size:0.8125rem; font-weight:600; line-height:1.5; white-space:nowrap; }
.studio-weather-copy>.studio-weather-stale { font-size:0.625rem; color:var(--cream); }
.studio-game-actions { gap:0.5rem; }
@media(max-width:61.875em) {
  .studio-game-heading>div:first-child { flex:1 1 100%; }
  .studio-game-context .studio-game-actions { width:auto; justify-content:flex-end; }
}
@media(max-width:30.25em) {
  .studio-game-heading>.studio-game-context { width:100%; gap:0.75rem; }
  .studio-weather-copy>strong { font-size:1.3125rem; }
}

/* Game prices share equal columns and aligned team rows beside the weather. */
.studio-game-heading { padding:0.875rem 1.125rem; }
body[data-layout] .studio-game-lines { flex:0 1 23.875rem; min-width:0; max-width:100%; padding-right:1.125rem; border-right:1px solid var(--line); color:var(--ink); font-variant-numeric:tabular-nums; }
.studio-game-lines-markets { display:flex; gap:0.75rem; align-items:stretch; }
.studio-game-lines-table { width:auto; flex:1; border:0; border-collapse:separate; border-spacing:0.25rem; font-size:0.75rem; }
.studio-game-lines-table :is(th,td) { position:static; border:0; padding:2px 0.25rem; text-align:center; vertical-align:middle; background:none; white-space:nowrap; }
.studio-game-lines-table thead th { color:var(--muted); font-size:0.625rem; font-weight:500; padding:0 0 0.1875rem; }
.studio-game-lines-table th:first-child { padding-left:0; text-align:left; }
.studio-game-lines-table tbody th { color:var(--ink); font-size:0.75rem; font-weight:650; }
.studio-game-lines-team { display:inline-flex; align-items:center; gap:0.375rem; }
.studio-game-lines-team .compact-team-logo { display:block; width:1.5rem; height:1.5rem; flex:0 0 1.5rem; object-fit:contain; }
.studio-game-lines-table strong { font-size:0.8125rem; font-weight:650; }
.studio-game-lines-table td small { display:block; margin-top:0.1875rem; color:var(--muted); font-size:0.6875rem; }
.studio-game-lines-table:not(.is-selectable) td small { display:inline; margin:0 0 0 0.3125rem; font-size:0.625rem; }
.studio-game-lines-table.is-selectable { width:100%; table-layout:fixed; border-spacing:0.3125rem 0.25rem; margin:-0.25rem -0.3125rem; }
.studio-game-lines-table.is-selectable th:first-child { width:4rem; }
.studio-game-lines-table.is-selectable td { padding:0; height:2.75rem; }
.studio-game-lines-table.is-selectable .studio-game-lines-total { display:table-cell; min-width:0; padding:0; border:0; }
.studio-game-lines .bet-side { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.1875rem; width:100%; min-width:0; min-height:2.75rem; height:100%; padding:0.3125rem 0.375rem; border-radius:var(--r-control); font-size:0.75rem; line-height:1.15; }
.studio-game-lines .bet-side strong { font-size:0.8125rem; line-height:1.15; }
.studio-game-lines [data-market=moneyline] .bet-side>span { display:none; }
.studio-game-lines .bet-side:has(>.bet-side-label) { display:grid; grid-template-columns:auto auto; justify-content:center; align-content:center; column-gap:0.25rem; }
.studio-game-lines .bet-side>.bet-side-label { font-weight:500; opacity:0.78; }
.studio-game-lines .bet-side:has(>.bet-side-label)>strong { grid-column:1 / -1; }
body[data-layout] .studio-game-lines .bet-side[aria-pressed=true] { background:#175139; border-color:var(--green); box-shadow:inset 0 0 0 1px var(--green); color:#dff5ec; }
.studio-game-lines-total { display:grid; grid-template-columns:auto auto; align-content:start; gap:0.1875rem 0.5rem; min-width:4.75rem; padding-left:0.75rem; border-left:1px solid var(--line); }
.studio-game-lines-total>small,.studio-game-lines-total>strong { grid-column:1/-1; }
.studio-game-lines-total>small { color:var(--muted); font-size:0.625rem; line-height:1.4; }
.studio-game-lines-total>strong { font-size:1.125rem; line-height:1.25; }
.studio-game-lines-total>span { color:var(--muted); font-size:0.625rem; white-space:nowrap; }
.studio-game-lines.is-unavailable { flex-basis:auto; font-size:0.75rem; color:var(--muted); }
.studio-game-pick-notes { margin-top:0.4375rem; }
@media(max-width:75.625em) {
  .studio-game-heading>.studio-game-context { width:100%; }
  .studio-game-lines { margin-right:auto; }
}
@media(max-width:55em) {
  body[data-layout] .studio-game-lines { flex:1 1 100%; width:100%; padding:0 0 0.75rem; border-right:0; border-bottom:1px solid var(--line); }
  .studio-game-lines-table:not(.is-selectable) { max-width:20rem; }
  div.studio-game-lines-total { margin-left:auto; }
}
@media(max-width:30.25em) {
  .studio-game-lines-table.is-selectable { border-spacing:0.25rem; margin:-0.25rem; }
  .studio-game-lines-table.is-selectable th:first-child { width:3.5rem; }
  .studio-game-lines-table tbody th { font-size:0.6875rem; }
  .studio-game-lines-team { gap:0.3125rem; }
  .studio-game-lines-team .compact-team-logo { width:1.25rem; height:1.25rem; flex-basis:1.25rem; }
  .studio-game-lines .bet-side { padding:0.3125rem 0.1875rem; font-size:0.6875rem; }
  .studio-game-lines .bet-side strong { font-size:0.75rem; }
  .studio-game-lines-markets { gap:0.5rem; }
  div.studio-game-lines-total { min-width:4.125rem; padding-left:0.5rem; gap:0.1875rem 0.25rem; }
  div.studio-game-lines-total:not(#studioSurface *) { grid-template-columns:auto; }
  .studio-game-lines-total>span { font-size:0.5625rem; }
}

/* Research and Def vs Pos lead with one compact row of title and controls. */
body:is([data-active-view=boards],[data-active-view=overview]) .notebook-main {
  display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start;
  gap:0.625rem 1.25rem; padding-top:0.75rem;
}
body:is([data-active-view=boards],[data-active-view=overview]) .notebook-main>* { grid-column:1/-1; min-width:0; }
body[data-active-view=overview] .notebook-main { grid-template-columns:auto auto minmax(0,1fr); }
body[data-active-view=overview] #overviewControls { grid-column:3; grid-row:1; align-self:center; justify-self:end; margin:0; }
body:is([data-active-view=boards],[data-active-view=overview]) .page-heading {
  grid-column:1; grid-row:1; align-self:center; margin:0; gap:0;
}
body:is([data-active-view=boards],[data-active-view=overview]) .page-heading h1 {
  margin:0; font-size:1.25rem; line-height:1.25; letter-spacing:-.3px;
}
body:is([data-active-view=boards],[data-active-view=overview]) .page-heading :is(p,.season-badge),
body:is([data-active-view=boards],[data-active-view=overview]) :is(#boardsPanel,#overviewPanel)>.section-heading,
body:is([data-active-view=boards],[data-active-view=overview]) :is(#autoPickHelp,#boardCount) { display:none; }
/* Qualified: out-ranks mockup-fidelity.css's .view-toolbar display rule. */
body[data-layout]:is([data-active-view=boards],[data-active-view=overview]) .view-toolbar:not(:has(> *)) { display:none; }
body:is([data-active-view=boards],[data-active-view=overview]) .notebook-controls {
  grid-column:2; grid-row:1; margin:0; padding:0; min-height:0;
  background:transparent; border:0; border-radius:0;
}
body:is([data-active-view=boards],[data-active-view=overview]) .fidelity-controls {
  min-height:2.25rem; gap:0.5rem; align-items:center;
}
body:is([data-active-view=boards],[data-active-view=overview]) .fidelity-controls>label:has(#season) {
  display:block; flex:0 0 5.625rem; width:5.625rem; margin:0; font-size:0; line-height:0;
}
body:is([data-active-view=boards],[data-active-view=overview]) #season {
  height:2.25rem; min-height:2.25rem; padding:0.4375rem 0.5625rem; font-size:0.75rem; line-height:1.3;
}
body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks {
  align-self:center; min-width:0; max-width:100%;
}
body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks>summary {
  min-width:7.375rem; min-height:2.25rem; max-width:100%; padding:0.5rem 0.625rem;
  font-size:0.75rem; line-height:1.125rem; overflow-wrap:anywhere;
}
body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks>.week-options { top:2.625rem; }
body[data-active-view=boards] .fidelity-controls>.board-heading-tools { margin-left:auto; gap:0.5rem; }
body[data-active-view=boards] .fidelity-controls>.board-heading-tools .pd-button {
  min-height:2.25rem; padding:0.4375rem 0.6875rem; font-size:0.75rem; line-height:1.3; white-space:nowrap;
}
body[data-active-view=overview] #overview { max-height:max(15rem,calc(100dvh - var(--header-height) - 4.875rem)); }
@media(max-width:66em) {
  body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks>.week-options {
    position:fixed; left:auto; right:1.125rem; top:auto; width:27.5rem;
    max-width:calc(100vw - 2.25rem); margin-top:0.4375rem;
  }
}
@media(max-width:48.125em) {
  body:is([data-active-view=boards],[data-active-view=overview]) .notebook-main { grid-template-columns:minmax(0,1fr); gap:0.625rem; }
  body:is([data-active-view=boards],[data-active-view=overview]) .page-heading { grid-column:1; grid-row:1; }
  body:is([data-active-view=boards],[data-active-view=overview]) .notebook-controls { grid-column:1; grid-row:2; }
  body[data-active-view=overview] .notebook-main { grid-template-columns:auto minmax(0,1fr); }
  body[data-active-view=overview] #overviewControls { grid-column:2; }
  body[data-active-view=overview] .notebook-controls { grid-column:1/-1; }
  body:is([data-active-view=boards],[data-active-view=overview]) #season,
  body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks>summary { min-height:2.5rem; height:auto; }
  body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks>summary { padding-top:0.625rem; padding-bottom:0.625rem; }
  body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks>.week-options {
    position:fixed; left:0.75rem; right:0.75rem; top:auto; width:auto; max-width:none;
    max-height:calc(100dvh - var(--header-height) - 6.25rem); overflow:auto; margin-top:0.4375rem;
  }
  body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks .week-picker { grid-template-columns:repeat(6,minmax(0,1fr)); }
  body:is([data-active-view=boards],[data-active-view=overview]) #comparisonWeeks .week-picker button { min-height:2.5rem; }
  body[data-active-view=boards] .fidelity-controls>.board-heading-tools .pd-button { min-height:2.5rem; }
  body[data-active-view=overview] #overview { max-height:max(15rem,calc(100dvh - var(--header-height) - 7.5rem)); }
}
@media(max-width:37.125em) {
  body[data-active-view=boards] .fidelity-controls>.board-heading-tools { flex-basis:100%; margin-left:0; }
  body[data-active-view=boards] .fidelity-controls>.board-heading-tools .pd-button { flex:1; }
}
/* UI-438: with the browser's 200% text on a 320 phone, "Show completed" wraps rather than
   widening the page. An em query on purpose: a container query would collapse the tools on a
   desktop. */
@media(max-width:12em) {
  body[data-active-view=boards] .fidelity-controls>.board-heading-tools .pd-button { white-space:normal; }
}

/* Results set the space available to the pinned, scrollable next matchup. */
#boards .defense-board {
  margin-bottom:1rem; container-type:inline-size; overflow:clip;
}
#boards .board-heading { gap:0.625rem; padding:0.625rem 0.875rem; }
#boards .board-heading h3 { font-size:1.125rem; line-height:1.3; }
#boards .board-heading p { display:none; }
#boards .board-heading .team-badge { width:2.375rem; height:2.375rem; }
#boards .matchup-review-control { gap:0.5rem; }
#boards .matchup-review-control>small { font-size:0.625rem; }
#boards .defense-board-body {
  grid-template-columns:minmax(0,1fr); align-items:start;
}
#boards .research-history { min-width:0; container-type:inline-size; }
body[data-layout] #boards .research-history-controls:empty { display:none; }
#boards .research-history-toolbar {
  display:flex; align-items:center; flex-wrap:wrap; gap:0.5rem 0.875rem; min-height:2.75rem;
  padding:0.4375rem 0.75rem; border-bottom:1px solid var(--line);
}
#boards .history-range { display:flex; align-items:baseline; flex-wrap:wrap; gap:0.3125rem 0.5rem; }
#boards .research-history-toolbar strong { font-size:0.75rem; }
#boards .research-history-toolbar small { color:var(--muted); font-size:0.6875rem; }
#boards .history-paging { display:flex; gap:0.3125rem; margin-left:auto; }
#boards .history-paging button {
  min-width:2rem; min-height:1.875rem; padding:0.25rem 0.5625rem; border:1px solid var(--line);
  border-radius:var(--r-control); background:var(--surface-raised); color:var(--ink); font-size:0.75rem;
}
#boards .history-paging button:disabled { opacity:.4; cursor:default; }
#boards .history-weeks {
  display:flex; flex:1; flex-wrap:wrap; gap:0.3125rem; min-width:0; padding:0; border:0;
}
/* Date buttons (any width): one row that scrolls sideways, not a dozen wrapped rows. */
#boards .history-weeks[data-scrolls] {
  flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; padding-bottom:0.25rem;
}
#boards .history-week {
  flex:0 0 auto; min-width:2rem; min-height:1.875rem; padding:0.3125rem 0.4375rem;
  border:1px solid var(--line); border-radius:var(--r-control); background:var(--surface-subtle);
  color:var(--muted); font-size:0.6875rem; font-variant-numeric:tabular-nums;
}
#boards .history-week[aria-pressed=true] {
  border-color:var(--cyan); background:var(--surface-raised); color:var(--cyan); font-weight:700;
}
#boards :is(.history-week,.history-paging button):hover:not(:disabled) {
  border-color:var(--cyan); color:var(--ink);
}
#boards :is(.history-week,.history-paging button):focus-visible {
  outline:2px solid var(--cyan); outline-offset:-2px;
}
#boards .matchup-strip {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,21.875rem),1fr));
  align-items:start; overflow:visible;
}
#boards .matchup-column {
  width:auto; min-width:0; max-width:100%; flex:initial; background:var(--surface);
}
#boards :is(.matchup-link,.upcoming-link) {
  min-height:3.5rem; padding:0.5625rem 0.75rem; gap:0.5rem; font-size:0.9375rem;
}
#boards .upcoming-link { height:3.5625rem; min-height:3.5625rem; flex:0 0 3.5625rem; }
#boards :is(.matchup-link,.upcoming-link) small { margin-bottom:0.1875rem; font-size:0.5625rem; }
#boards .matchup-opponent { gap:0.5rem; }
#boards .opponent-badge { width:2rem; height:2rem; }
#boards .matchup-game-link { align-self:center; margin-right:0.625rem; padding:0.4375rem 0.5rem; font-size:0.625rem; white-space:nowrap; }
#boards .matchup-picks {
  max-height:none; overflow:visible; padding:0; background:var(--surface);
}
#boards .picks-caption { margin:0; padding:0.5rem 0.75rem 0.375rem; font-size:0.625rem; line-height:1.5; }
#boards .matchup-picks>.board-empty { margin:0; padding:0.75rem; border:0; border-radius:0; }
#boards .weekly-props { table-layout:fixed; background:var(--surface); border:0; }
#boards .weekly-props :is(th,td) { background:var(--surface); }
#boards .weekly-props .result-over :is(.prop-actual,.prop-difference) {
  background:color-mix(in srgb,var(--surface) 65%,var(--gap-over)); color:var(--gap-over-ink);
}
#boards .weekly-props .result-under :is(.prop-actual,.prop-difference) {
  background:color-mix(in srgb,var(--surface) 65%,var(--gap-under)); color:var(--gap-under-ink);
}
#boards .weekly-props th:first-child { width:46%; }
#boards .weekly-props th:nth-child(2),#boards .weekly-props th:nth-child(3) { width:14%; }
#boards .weekly-props th:nth-child(4) { width:26%; }
#boards .weekly-props :is(th,td) { padding:0.5rem 0.625rem; vertical-align:middle; }
#boards .weekly-props thead th { font-size:0.5625rem; line-height:1.4; letter-spacing:0; }
#boards .weekly-props td { font-size:0.75rem; font-variant-numeric:tabular-nums; }
#boards .weekly-props .weekly-prop-title { font-size:0.6875rem; line-height:1.4; overflow-wrap:normal; }
#boards .weekly-player { min-width:0; gap:0.3125rem; }
body[data-layout] #boards .weekly-player .profile-name-button {
  min-width:0; font-size:0.75rem; line-height:1.4; overflow-wrap:break-word;
}
#boards .weekly-props :is(.line-detail,.prop-actual,.prop-difference>span:first-child) { white-space:nowrap; }
#boards .weekly-props .prop-difference { font-size:0.75rem; }
#boards .weekly-props .prop-difference small { font-size:0.5rem; line-height:1.4; }
#boards .weekly-props .prop-cushion { display:none; }
#boards .weekly-props .pattern-tag {
  width:fit-content; max-width:100%; margin-top:0.3125rem; padding:0.1875rem 0.3125rem; font-size:0.625rem; line-height:1.4;
}
#boards .upcoming-column {
  width:100%; min-width:0; background:var(--surface); border-left:0; border-top:1px solid var(--line);
}
#boards .upcoming-column:not([data-next-week]) .upcoming-empty { margin:0; }
#boards .upcoming-empty { padding:0.75rem; }
#boards .upcoming-column .upcoming-content {
  min-height:0; max-height:none; overflow:visible; padding:0;
}
#boards .research-picks {
  display:flex; flex-wrap:wrap; align-items:stretch; gap:0 0.625rem;
  border:0; border-radius:0; overflow:visible;
}
body[data-layout] #boards .research-pick {
  grid-template-columns:minmax(0,1fr) 11.5rem; align-items:start; gap:0.25rem 0.5rem; min-height:6.75rem; padding:0.5rem 0.75rem;
  flex:1 1 max(21.875rem,calc((100% - 1.25rem) / 3)); max-width:100%;
  border:0; border-bottom:1px solid var(--line); border-radius:0;
}
body[data-layout] #boards .research-pick:last-child { border-bottom:0; }
#boards .research-prop-heading {
  grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:0.5rem; min-width:0; min-height:1.25rem;
}
#boards .research-prop-heading .weekly-prop-title { min-width:0; margin:0; font-size:0.625rem; }
#boards .research-player { align-self:start; align-items:center; gap:0.4375rem; min-height:2.75rem; }
body[data-layout] #boards .research-player>.profile-avatar-button { margin:0; flex:0 0 2rem; }
body[data-layout] #boards .research-player-details {
  display:flex; flex-direction:column; gap:2px; min-width:0; width:100%;
}
body[data-layout] #boards .research-player .profile-name-button { align-self:start; font-size:0.75rem; line-height:1.4; }
body[data-layout] #boards .research-player .player-avatar { width:2rem; height:2.375rem; flex-basis:2rem; }
#boards .research-player small { margin:0; font-size:0.5625rem; line-height:1.4; }
#boards .research-player-pattern { display:flex; flex:0 0 auto; min-width:0; }
#boards .research-prop-heading .pattern-rate { width:fit-content; margin:0; padding:2px 0.3125rem; font-size:0.5625rem; line-height:1.4; white-space:nowrap; }
body[data-layout] #boards .research-line-picker { align-self:start; width:100%; min-height:4.25rem; display:flex; flex-direction:column; justify-content:start; }
body[data-layout] #boards .research-line-picker .studio-line-slider { grid-template-columns:1.125rem minmax(0,1fr) 1.125rem; }
body[data-layout] #boards .research-line-picker .studio-line-caption { grid-template-columns:1.625rem minmax(0,1fr) 1.625rem; font-size:0.5rem; }
body[data-layout] #boards .research-line-picker .bet-side { min-height:2.75rem; padding:0.3125rem 0.1875rem; font-size:0.6875rem; }
#boards .research-line-picker .bet-side strong { font-size:0.75rem; }
#boards .research-line-picker .no-upcoming-line {
  display:flex; align-items:center; justify-content:center; min-height:2.75rem; margin-bottom:1.5rem; font-size:0.625rem;
}
#boards .upcoming-watchlist { margin:0; padding:0.625rem 0 0; }
#boards .upcoming-watchlist>h4 { padding:0 0.75rem; }
.research-scroll-cue { display:none; }
@container(min-width:780px) {
  #boards .defense-board-body:has(>.upcoming-column[data-next-week]) {
    grid-template-columns:minmax(0,1fr) clamp(23.75rem,28cqw,28.75rem);
  }
  #boards .upcoming-column[data-next-week] {
    position:sticky; top:calc(var(--header-height) + 0.75rem); align-self:start;
    display:flex; flex-direction:column;
    max-height:min(max(16.25rem,var(--research-history-height,30rem)),calc(100dvh - var(--header-height) - 1.5rem));
    border-left:1px solid var(--line); border-top:0;
  }
  #boards .upcoming-column[data-next-week] .upcoming-content {
    flex:0 1 auto; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:auto;
    scrollbar-gutter:stable; scrollbar-width:auto;
    scrollbar-color:var(--muted) var(--surface-raised);
  }
  #boards .research-scroll-cue:not([hidden]) {
    position:absolute; z-index:1; inset:auto 1rem 0 0;
    display:flex; align-items:flex-end; justify-content:center;
    height:2.75rem; padding-bottom:0.375rem; pointer-events:none;
    background:linear-gradient(transparent,var(--surface) 80%);
  }
  #boards .research-scroll-cue>span {
    display:inline-flex; align-items:center; gap:0.4375rem; padding:0.1875rem 0.625rem;
    border:1px solid var(--line); border-radius:var(--r-control);
    background:var(--surface-raised); color:var(--ink); font-size:0.625rem; font-weight:650; line-height:1.4;
  }
  #boards .research-scroll-arrow { color:var(--cyan); font-size:0.8125rem; line-height:1; }
  #boards .upcoming-content:focus-visible {
    outline:2px solid var(--cyan); outline-offset:-2px;
  }
  #boards .upcoming-column[data-next-week] .research-pick {
    flex-basis:100%;
  }
}
@container(max-width:699px) {
  #boards .matchup-column { border-right:0; border-bottom:1px solid var(--line); }
  #boards .matchup-column:last-child { border-bottom:0; }
}
@media(max-width:48.125em) {
  #boards .board-heading { padding:0.5625rem 0.625rem; }
  #boards .board-heading h3 { font-size:1rem; }
  #boards .matchup-review-control { margin-left:auto; }
  #boards .matchup-review-control>small { display:none; }
  #boards .history-weeks { order:3; flex-basis:100%; gap:0.3125rem; }
  #boards .history-week { min-width:2.25rem; min-height:2.25rem; }
  #boards .history-paging button { min-width:2.25rem; min-height:2.25rem; }
  #boards .matchup-strip { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:37.125em) {
  body[data-layout] #boards .research-pick { grid-template-columns:minmax(0,1fr); gap:0.375rem; }
  body[data-layout] #boards .research-line-picker { width:11.5rem; max-width:100%; justify-self:end; }
  #boards .research-pick:has(.no-upcoming-line) .research-line-picker { width:11.5rem; }
  #boards .weekly-props :is(th,td) { padding:0.5rem 0.25rem; }
  #boards .weekly-props thead th { font-size:0.5rem; }
  #boards .weekly-props .prop-difference { font-size:0.6875rem; }
  body[data-layout] #boards .weekly-player .player-avatar { width:1.25rem; height:1.375rem; }
  #boards .board-heading .team-badge { width:2rem; height:2rem; }
}

/* Defer layout/paint for research boards below the viewport, retaining their
   measured heights when switching tabs or returning to a scrolled board. */
#boards>.defense-board { content-visibility:auto; contain-intrinsic-block-size:auto 45rem; }

/* Saved-price timing (UI-93/UI-193), shared by Slate, Matchup and Teams.
   Show the timing note above the prices. Neutral and dimmed only: colour here means performance.
   Stale: a muted note with the dashed "no line" ring, and dashed price outlines (not current).
   Started (kickoff passed, the same rule as the rail's Live tag): the note sits in the Live tag's
   outlined pill without the pulsing dot, since these are saved pregame prices, not live ones,
   and the prices fade back. */
.studio-game-lines .studio-game-lines-timing { position:static !important; display:flex; align-items:center; gap:0.375rem; width:auto; height:auto;
  margin:0 0 0.625rem; padding:0; overflow:visible; clip:auto; clip-path:none; white-space:normal; color:var(--muted); font:700 0.8125rem/1.4 var(--font-body); }
.studio-game-lines .studio-game-lines-timing:empty { display:none; }
.studio-game-lines.is-stale .studio-game-lines-timing::before { content:""; flex:0 0 auto; width:0.625rem; height:0.625rem; border:1.5px dashed currentColor; border-radius:var(--r-data); box-sizing:border-box; }
html body[data-layout] .studio-game-lines.is-stale .bet-side:not([aria-pressed=true]) { border-style:dashed; box-shadow:none; }
.studio-game-lines.is-started .studio-game-lines-timing { align-self:flex-start; width:fit-content; padding:0.0625rem 0.5rem; border-radius:var(--r-data); box-shadow:inset 0 0 0 1.5px currentColor;
  font:800 0.625rem/1.4 var(--font-mono); letter-spacing:0.08em; text-transform:uppercase; }
.studio-game-lines.is-started .studio-game-lines-markets { opacity:0.6; }
/* The prices lock at kickoff; the fade above replaces the disabled-button fade rather than doubling it. */
html body[data-layout] .studio-game-lines.is-started .bet-side { box-shadow:none; opacity:1; }
