/* Game Day Orange. Local OFL fonts, neutral data surfaces, orange actions. */
#lineup-error-dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 24px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-top: 4px solid var(--danger);
  border-radius: var(--radius);
}
#lineup-error-dialog::backdrop { background: rgb(0 0 0 / 55%); }
#lineup-error-dialog h2 { margin: 0 0 12px; font: 700 22px/1.25 var(--font-body); }
#lineup-error-dialog p { margin: 0 0 24px; overflow-wrap: anywhere; }
#lineup-error-dialog form { display: flex; justify-content: flex-end; }
#lineup-error-dialog button { min-width: 88px; }
@font-face { font-family: Anton; src: url('fonts/anton-regular.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url('fonts/barlow-regular.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url('fonts/barlow-medium.woff2') format('woff2'); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: Barlow; src: url('fonts/barlow-semibold.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: Barlow; src: url('fonts/barlow-bold.woff2') format('woff2'); font-style: normal; font-weight: 700; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #f4f4f4; --surface: #ffffff; --surface-2: #f0f0f0; --surface-3: #e6e6e6;
  --text: #171717; --text-muted: #595959; --border: #d5d5d5; --border-2: #787878;
  --accent: #b83a00; --action: #fc5200; --accent-dim: #fff0e8; --accent-hover: #e94b00;
  --gold: #765013; --gold-dim: #faf1de; --danger: #a62323; --success: #24683a; --info: #304f8e;
  --focus: #9b3100; --accent-glow: transparent; --shadow: none; --shadow-md: none; --shadow-lg: none;
  --radius: 4px; --badge-radius: 4px; --font-display: Anton, 'Arial Narrow', Impact, sans-serif;
  --rank-good: #24683a; --rank-mid: #765013; --rank-bad: #a62323;
  --tag-q:var(--rank-mid); --tag-red:var(--rank-bad);
  /* D-190 (0.12.1, Owner pick B): the injury-tag letter family, defined once. */
  --font-tag: Arial, Helvetica, sans-serif;
  --font-body: Barlow, Arial, sans-serif; --font-mono: Barlow, Arial, sans-serif;
}
/* Lineup rows use plain inline facts; disclosures remain on roomier surfaces. */
.lineup-player-group { display:flex; align-items:center; gap:3px; min-width:0; max-width:100%; }
.lineup-player-cell { display:inline-flex; align-items:center; gap:3px; min-width:0; max-width:100%; vertical-align:middle; }
/* D-190: the tag letter is bold Arial at the row's own text size, plain, never clickable. */
.lineup-injury-tag, .player-meta-tag { font-family:var(--font-tag); font-weight:700; font-size:inherit; cursor:default; }
.lineup-injury-tag { flex:none; line-height:1; }
/* D-203 (0.12.2, ruling 707): the Def cell is two columns — the opponent, then the rank
   number — each starting at one x on every row of a card; the header reads "Def ?" and "Rk". */
.lineup-defense, .weekly-card-columns .lineup-defense-header { display:grid; grid-template-columns:var(--def-opp-w, 39px) minmax(0,1fr); column-gap:5px; align-items:baseline; white-space:nowrap; }
/* One px width shared by the header and the cells: it holds the widest opponent ("@WAS",
   "@HOU", "@LAC": 39px at the 14px row font), then a 5px gap before the rank. */
.lineup-card-list { --def-opp-w: 39px; }
@media (max-width: 600px) {
  /* The phone row's Def cell: its "Def" label, then opponent | rank sub-columns. */
  #weekly-workbench .lineup-card-row > .lineup-defense { display:grid; }
  #weekly-workbench .lineup-card-row > .lineup-defense::before { grid-column:1 / -1; }
  /* The phone header keeps 0.12.1's behaviour (the "Def ?" label only, no Rk band). */
  #weekly-workbench .weekly-card-columns .lineup-defense-header { display:inline-flex; }
  #weekly-workbench .weekly-card-columns .lineup-rank-header { display:none; }
}
.lineup-defense-rank { font:inherit; font-weight:inherit; background:none; border:0; padding:0; }
.weekly-card-columns .lineup-defense-header { color:var(--text-muted); }
.weekly-card-columns .lineup-defense-title { display:inline-flex; align-items:center; gap:0.35em; }
.weekly-card-columns .lineup-defense-header .lineup-defense-help { position:relative; display:inline-flex; align-items:center; justify-content:center; flex:none; width:1em; height:1em; border:1px solid currentColor; border-radius:50%; text-decoration:none; font:inherit; line-height:1; cursor:help; }
.weekly-card-columns .lineup-defense-header .lineup-defense-help::after { content:attr(aria-label); display:none; position:absolute; z-index:5; top:calc(100% + 6px); right:0; width:min(260px, calc(100vw - 32px)); padding:8px; border:1px solid var(--border-2); border-radius:var(--radius); background:var(--surface); color:var(--text); font:12px/1.35 var(--font-body); white-space:normal; box-shadow:0 4px 12px rgb(0 0 0 / 15%); }
.weekly-card-columns .lineup-defense-header .lineup-defense-help:is(:hover, :focus)::after { display:block; }
.lineup-injury-tag.tag-q, .player-meta-tag.tag-q { color:var(--tag-q); }
.lineup-injury-tag:is(.tag-d,.tag-out,.tag-ir,.tag-pup,.tag-sus,.tag-na),
.player-meta-tag:is(.tag-d,.tag-out,.tag-ir,.tag-pup,.tag-sus,.tag-na) { color:var(--tag-red); }
.lineup-defense-rank-good { color:var(--rank-good); }
.lineup-defense-rank-mid { color:var(--rank-mid); }
.lineup-defense-rank-bad { color:var(--rank-bad); }
/* Item 12 (0.12.1, the Owner's ruling 2026-10-01): every player-meta row reads like the
   lineup row's Def cell — plain text, only the rank number colored, the matchup band word
   in the rank colors, no chips, boxes, reasons or as-of details. */
.player-meta { display:inline; font:inherit; color:inherit; }
.player-meta-vs, .player-meta-rank { font:inherit; padding:0; border:0; background:none; white-space:nowrap; }
b.player-meta-tag { display:inline; padding:0; border:0; background:none; vertical-align:baseline; margin-right:4px; }
/* Item 12: tag | name | opponent+rank | matchup, each in its own fixed track, so every
   row of a list or table (same-width containers) shares the four left edges. The tag
   track holds "PUP"; names wrap between words, never cut. */
/* Attempt 3: no size containment — a contained row has zero intrinsic width, which
   collapsed the Player Exposure table column. The name track's floor is its longest
   word, so a table column never shrinks below the row's content. */
.player-row { display:block; width:100%; min-width:0; }
.player-row-grid { display:grid; grid-template-columns:2.4em minmax(min-content,1fr) 3.3em 1.6em; column-gap:6px; align-items:baseline; }
.player-row-grid.player-row-norank { grid-template-columns:2.4em minmax(min-content,1fr) 3.3em; }
.player-row-grid > .player-meta { display:contents; }
.player-row-tag { grid-column:1; grid-row:1; min-width:0; }
.player-row-tag > b.player-meta-tag { margin-right:0; }
.player-row-name { grid-column:2; grid-row:1; min-width:0; overflow-wrap:normal; word-break:normal; white-space:normal; }
.player-row-grid > .player-meta > .player-meta-vs { grid-column:3; grid-row:1; }
.player-row-grid > .player-meta > .player-meta-rank { grid-column:4; grid-row:1; }
/* Booth ruling 689: the Player Exposure table centers its cells; inside the Player
   cell every column's text starts at its track's left edge, the same x on every row. */
#exposure-players td .player-row-grid { text-align:left; }
/* D-202 (0.12.2, ruling 706): Highest Exposure rows on ONE line — the tag, "Name · POS"
   (never wrapped or cut), the opponent and the rank in their own columns, then the total.
   Below 1280px the two lists stack (one full-width list). */
#weekly-workbench .highest-exposure .player-row-grid { grid-template-columns:2.4em minmax(0,1fr) 3.3em 1.6em; }
#weekly-workbench .highest-exposure .player-row-name { white-space:nowrap; }
@media (max-width: 1279px) {
  #weekly-workbench .highest-exposure .highest-exposure-columns { grid-template-columns:minmax(0,1fr); }
}
/* Booth ruling 711: at 1280+ the two lists stay side by side, but Team Exposure (a team
   code and its count) takes only the width its rows need, so Player Exposure has room for
   "tag | Name · POS | opponent | rank | N / M lineups" on one line. */
@media (min-width: 1280px) {
  /* Booth ruling 713: the Team column is capped (a team row "XXX  N / M lineups" fits in
     190px), so an opened breakdown never widens it; its contest names wrap inside it. */
  #weekly-workbench .highest-exposure .highest-exposure-columns { grid-template-columns:fit-content(190px) minmax(0,1fr); }
  #weekly-workbench .highest-exposure [data-highest-team] .highest-exposure-breakdown > div > span:first-child { min-width:0; overflow-wrap:anywhere; }
}
/* The played-picker menu can be very tight (about 50px of row): tag | card label, and
   the opponent on line 2 from the row edge; every option keeps the same left edges. */
.manual-played-suggestions .player-row-grid.player-row-norank { grid-template-columns:2.2em minmax(0,1fr); column-gap:0; }
.manual-played-suggestions .player-row-grid > .player-meta > .player-meta-vs { grid-column:1 / -1; grid-row:2; }
/* Option rows (Find Player, played picker) keep their pre-item-12 wrapping: a card
   label is not a bare name and may break anywhere rather than overflow its menu. */
.player-lookup-option .player-row-name { overflow-wrap:anywhere; }
/* D-246: the played-picker label wraps only at word boundaries (white-space stays normal);
   the player's name is its own nowrap span and is never broken inside a word.  At 600px and
   below the label shows the short expiry ("exp MM/DD") and hides the long expiry + Card #
   detail; the hidden spans stay in the DOM, and the posted value and datalist carry the full label. */
.manual-played-suggestions .player-row-name { overflow-wrap:normal; }
.manual-played-label-name { white-space:nowrap; }
.manual-played-label-exp-short { display:none; }
@media (max-width: 600px) {
  #weekly-workbench .manual-played-suggestions .manual-played-label-detail { display:none; }
  #weekly-workbench .manual-played-suggestions .manual-played-label-exp-short { display:inline; }
}
.player-meta-as-of, .player-meta-basis { color:var(--text-muted); font-size:12px; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101010; --surface: #1b1b1b; --surface-2: #242424; --surface-3: #303030;
  --text: #f3f3f3; --text-muted: #b7b7b7; --border: #414141; --border-2: #858585;
  --accent: #ff915e; --accent-dim: #392217; --accent-hover: #ff702b;
  --gold: #e2bd77; --gold-dim: #30291c; --danger: #ff9f9f; --success: #9dd5ac; --info: #b5cafa;
  --focus: #ffac85;
  --tag-q:#ffd166; --tag-red:#ff9f9f;
  --rank-good:#9dd5ac; --rank-mid:#ffd166; --rank-bad:#ff9f9f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #101010; --surface: #1b1b1b; --surface-2: #242424; --surface-3: #303030;
  --text: #f3f3f3; --text-muted: #b7b7b7; --border: #414141; --border-2: #858585;
  --accent: #ff915e; --accent-dim: #392217; --accent-hover: #ff702b;
  --gold: #e2bd77; --gold-dim: #30291c; --danger: #ff9f9f; --success: #9dd5ac; --info: #b5cafa;
  --focus: #ffac85;
  --tag-q:#ffd166; --tag-red:#ff9f9f;
  --rank-good:#9dd5ac; --rank-mid:#ffd166; --rank-bad:#ff9f9f;
  }
}
[hidden] { display: none !important; }
body { font-size: 16px; background-image: none; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
header[data-sticky-header] { position: sticky; top: 0; z-index: 30; height: auto; min-height: 0; padding: 12px 0; background: var(--surface); border-bottom: 1px solid var(--border); overflow: visible; }
header::after { content: none; }
.hero-content { width: 100%; max-width: 1440px; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
header h1 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.2; letter-spacing: -.02em; margin: 0; white-space: nowrap; }
.title-link { color: var(--text); text-decoration: none; }
.app-version { font-family: var(--font-body); font-size: 11px; vertical-align: middle; letter-spacing: 0; }
.app-version a { color: var(--text-muted); }
.hero-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.hero-nav a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 8px; font-size: 18px; color: var(--text-muted); font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; }
.hero-nav a:hover, .hero-nav a[aria-current] { color: var(--accent); border-color: var(--action); }
.theme-control { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.theme-control select { width: auto; min-height: 44px; margin: 0; }
main, .weekly-shell main { max-width: 1440px; margin: 0 auto; padding: 24px; }
h2, .weekly-shell h2, .contest-section h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; letter-spacing: -.01em; text-transform: none; text-wrap: balance; }
h3, .weekly-shell h3, .contest-section h3 { font-family: var(--font-body); font-weight: 700; font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--text); }
h4 { font-size: 16px; }
button, input, select, textarea { font-family: var(--font-body); }
input, select, textarea { color: var(--text); background: var(--surface); border-color: var(--border-2); color-scheme: inherit; border-radius: 4px; max-width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
button, button[type=submit], .button-link, .secondary-button, summary.secondary-button { border-radius: 4px; font-family: var(--font-body); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; min-height: 44px; box-shadow: none; }
button[type=submit], #generate-button { background: var(--action); color: #111; border: 1px solid var(--action); }
button[type=submit]:hover, #generate-button:hover { background: var(--accent-hover); color: #111; transform: none; box-shadow: none; }
button.secondary-button, button[type=submit].secondary-button, .button-link, .secondary-button, summary.secondary-button { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); box-shadow: none; }
button.secondary-button:hover, button[type=submit].secondary-button:hover, .button-link:hover, .secondary-button:hover { background: var(--surface-2); color: var(--accent); border-color: var(--accent); transform: none; box-shadow: none; }
button:disabled, button[type=submit]:disabled { opacity: .55; cursor: not-allowed; }
button[type=submit] { margin-top: 0; }
.panel, .lineup-block, .weekly-review-lineup, .weekly-history-lineup { border-radius: 4px; }
table, .lineup-card-list { font-variant-numeric: tabular-nums; }
th { background: var(--surface-2); color: var(--text-muted); }
td, th { font-size: 14px; letter-spacing: 0; }
.notice, .error, .infeasible, .notice-info, .notice-diff { border-radius: 4px; box-shadow: none; }
.error, .infeasible { color: var(--danger); }
.table-note, .field-hint, .pool-summary { font-size: 13px; }
.admin-badge, .verify-badge, .item-count, .slot-chip, .rule-chip { font-size: 12px; letter-spacing: 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.privacy-footer { font-size: 12px; color: var(--text-muted); max-width: 1392px; margin: 24px auto 0; padding: 18px 24px; overflow-wrap: anywhere; }
.game-day-banner { height: 110px; margin-bottom: 20px; background: #111 url('images/game-day-football.webp') center 48% / cover no-repeat; color: #fff; overflow: hidden; border-radius: 4px; display: flex; align-items: center; }
.game-day-banner > div { background: #111; padding: 12px 20px; max-width: 60%; }
.game-day-banner strong { font-family: var(--font-display); font-size: 32px; font-weight: 400; line-height: 1.15; display: block; }
.game-day-banner span { font-size: 17px; }
#weekly-workbench { font-size: 16px; }
#weekly-workbench .weekly-heading { padding: 16px 20px; }
#weekly-workbench .weekly-heading h2 { font-size: 28px; }
#weekly-workbench .weekly-heading > p { font-size: 13px; }
#weekly-workbench .weekly-sidebar h2 { font-family: var(--font-body); font-size: 17px; font-weight: 700; }
#weekly-workbench .weekly-lineup-select { padding: 10px 8px; border-left-width: 4px; }
#weekly-workbench .weekly-lineup-select.selected { border-color: transparent; border-left-color: var(--action); }
#weekly-workbench .weekly-summary-name { font-size: 15px; font-weight: 700; }
#weekly-workbench .weekly-summary-meta { font-size: 12px; }
#weekly-workbench .lineup-header > strong { font-family: var(--font-display); font-size: 30px; line-height: 1.2; font-weight: 400; }
#weekly-workbench .lineup-header { background: var(--surface); }
#weekly-workbench .lineup-metric strong, #weekly-workbench .weekly-point-summary strong { font-size: 25px; font-family: var(--font-body); font-weight: 700; color: var(--text); }
#weekly-workbench .lineup-metric-label, #weekly-workbench .weekly-point-summary small { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; }
#weekly-workbench .lineup-card-row { font-size: 14px; min-height: 54px; align-items: center; }
#weekly-workbench .weekly-card-columns { background: var(--surface-2); min-height: 36px; font-size: 12px; }
#weekly-workbench .weekly-point-cell small { font-size: 11px; }
#weekly-workbench .lineup-item-edit > summary { font-size: 13px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
/* D-189 (0.16.1 B3): above 600 px the Edit and Add triggers draw compact; the 44 px floor stays. */
@media (min-width: 601px) { #weekly-workbench .lineup-item-edit > summary { font-size: 11px; padding: 3px 5px; } }
#weekly-workbench .weekly-advanced > summary { font-size: 17px; padding: 14px; }
#weekly-workbench .weekly-advanced .workbench-tools-panel { background: var(--surface); }
#weekly-workbench .weekly-order-buttons button { color: var(--text-muted); border-color: var(--border-2); }
#weekly-workbench :focus-visible, .weekly-shell :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.weekly-shell .advanced-tools > summary { font-size: 17px; }
.weekly-shell .source-details { font-size: 13px; }
/* The header stays in view only on wide desktop layouts. */
@media (max-width: 1100px) {
  header[data-sticky-header] { position: static; top: auto; }
  .hero-nav a { font-size: 16px; }
}
@media (max-width: 850px) {
  .hero-content { gap: 8px 18px; }
  .hero-nav { order: 3; width: 100%; gap: 4px; }
  .hero-nav a { padding: 5px 8px; }
  .theme-control { margin-left: auto; }
}
@media (max-width: 600px) {
  header[data-sticky-header] { padding: 8px 0; }
  .hero-content { padding: 0 12px; gap: 4px 8px; }
  header h1 { font-size: 26px; }
  .hero-nav { flex-wrap: wrap; justify-content: flex-start; gap: 0 4px; }
  .hero-nav a { padding: 4px; }
  .theme-control { font-size: 12px; gap: 4px; }
  .theme-control select { font-size: 16px; padding: 4px; }
  main, .weekly-shell main { padding: 16px 12px; }
  .game-day-banner { height: 88px; margin-bottom: 16px; }
  .game-day-banner > div { padding: 10px 12px; max-width: 74%; }
  .game-day-banner strong { font-size: 23px; }
  .game-day-banner span { font-size: 14px; }
  #weekly-workbench .lineup-header > strong { font-size: 27px; }
  #weekly-workbench .lineup-card-row { font-size: 14px; }
  #weekly-workbench input, #weekly-workbench select { font-size: 16px; }
  #weekly-workbench .lineup-card-row > [data-cell-label]::before { font-size: 11px; }
  .admin-table-wrap { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .theme-control, .game-day-banner { display: none !important; } }

#stack-pick-feedback:empty { display: none; }
[data-stack-builder-team] > summary { padding: 12px; min-height: 44px; font-weight: 700; background: var(--surface-2); cursor: pointer; }
[data-stack-builder-team] > label { display: block; padding: 12px 0; }
[data-stack-search] { display: block; width: 100%; min-height: 44px; margin-top: 6px; }
.stack-choice-results { max-height: 440px; overflow-y: auto; padding: 3px; }
.stack-choice-row { border-bottom: 1px solid var(--border); padding: 12px 0; }
[data-stack-row]:focus { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Neutral metric labels keep orange reserved for actions and selection. */
#weekly-workbench .lineup-header { letter-spacing: 0; text-transform: none; }
#weekly-workbench .lineup-header span { color: var(--text-muted); }
#weekly-workbench .weekly-primary-accept button { min-width: 130px; }
#weekly-workbench .weekly-advanced > summary::after { content: '⌄'; float: right; }
#weekly-workbench .weekly-advanced[open] > summary::after { content: '⌃'; }
.file-upload-zone:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

#weekly-workbench .weekly-heading { padding: 12px 16px; }
#weekly-workbench .weekly-heading h2 { font-size: 22px; margin: 0; }
#weekly-workbench .weekly-heading > p { margin: 3px 0; }
#weekly-workbench .weekly-heading .workbench-bulk-bar { margin-top: 10px; align-items: start; }
#weekly-workbench .weekly-workflow-help { margin-top: 8px; font-size: 12px; }
#weekly-workbench .weekly-workflow-help > summary { cursor: pointer; }
#weekly-workbench .enter-week-form > .table-note,
#weekly-workbench .weekly-reoptimize-form > .table-note { display: block; font-size: 11px; }
#weekly-workbench .weekly-started-exceptions { margin-top: 4px; }

.csv-hint-note { opacity: 1; }

#weekly-workbench .lineup-slot-label { color: var(--text); }
#weekly-workbench .lineup-metric { display: flex; flex-direction: column; gap: 4px; margin-right: 16px; }
#weekly-workbench .lineup-state { padding: 4px 10px; border: 1px solid var(--border-2); border-radius: 4px; font-size: 13px; }

/* Secondary help shares one compact row; expanded text remains in normal flow. */
#weekly-workbench .weekly-help-row { display: flex; flex-wrap: wrap; align-items: start; gap: 0 24px; margin-top: 4px; }
#weekly-workbench .weekly-help-row > details { margin: 0; padding: 0; font-size: 12px; max-width: 100%; }
#weekly-workbench .weekly-help-row > details > summary { padding: 6px 0; margin: 0; min-height: 32px; cursor: pointer; }
#weekly-workbench .weekly-help-row > details[open] { flex: 1 1 300px; }
#weekly-workbench .weekly-heading .workbench-bulk-bar { margin-top: 6px; }
@media (min-width: 1000px) {
  #weekly-workbench .weekly-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; }
  #weekly-workbench .weekly-heading h2 { flex: 0 0 auto; }
  #weekly-workbench .weekly-heading > .table-note { flex: 1 1 300px; }
  #weekly-workbench .weekly-heading .workbench-bulk-bar, #weekly-workbench .weekly-help-row { flex-basis: 100%; }
  #weekly-workbench .weekly-heading .first-players-lock { flex-basis: 100%; }
}
@media (pointer: coarse) { #weekly-workbench .weekly-help-row > details > summary { min-height: 44px; } }

/* Keep every player visible while totals and secondary actions sit beside them. */
#weekly-workbench .weekly-lineup-feedback > .notice { margin: 12px 16px; }
#weekly-workbench .weekly-add { width: 100%; border-top: 1px solid var(--weekly-edge); }
#weekly-workbench .weekly-add > summary,
#weekly-workbench .weekly-move > summary {
  min-height: 44px;
  padding: 10px 0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
@media (min-width: 1280px) {
  #weekly-workbench .working-lineup:not(.lineup-unfilled),
  #weekly-workbench .accepted-lineup {
    display: grid;
    grid-template-columns: 161px minmax(0, 1fr);
    grid-template-areas: "overview cards" "feedback cards" "actions cards" "played played";
    grid-template-rows: min-content min-content min-content min-content;
    align-content: start;
    overflow: visible;
  }
  /* Rulings 625/631/633: the shortened overview gives Name the width it needs. */
  #weekly-workbench .accepted-lineup { grid-template-columns: 237px minmax(0, 1fr); }
  #weekly-workbench .weekly-lineup-overview { grid-area: overview; min-width: 0; }
  #weekly-workbench .weekly-lineup-feedback { grid-area: feedback; min-width: 0; }
  /* D-246: the played panel spans the card's full width below the overview column and the
     card list; with the panel hidden its row is empty and adds no height. */
  #weekly-workbench .working-lineup > .manual-played-editor { grid-area: played; }
  #weekly-workbench .working-lineup > .lineup-actions,
  #weekly-workbench .accepted-lineup > .lineup-actions { grid-area: actions; padding: 4px 8px; }
  #weekly-workbench .working-lineup > .lineup-card-list,
  #weekly-workbench .accepted-lineup > .lineup-card-list {
    grid-area: cards;
    align-self: start;
    align-content: start;
    min-width: 0;
    border-left: 1px solid var(--border);
  }
  #weekly-workbench .weekly-lineup-overview .lineup-header,
  #weekly-workbench .weekly-lineup-overview .weekly-accepted-heading { padding: 8px; gap: 4px; }
  #weekly-workbench .accepted-lineup .weekly-accepted-heading { padding-top: 4px; padding-bottom: 4px; }
  #weekly-workbench .weekly-lineup-overview .lineup-header > strong,
  #weekly-workbench .weekly-accepted-heading h2 { font-size: 22px; line-height: 1.15; margin: 0; flex-basis: 100%; }
  #weekly-workbench .weekly-accepted-heading > p { font-size: 13px; line-height: 1.2; margin: 0; flex-basis: 100%; }
  #weekly-workbench .weekly-lineup-overview .lineup-metric { min-width: 0; margin-right: 4px; gap: 2px; }
  #weekly-workbench .working-lineup .lineup-metric { min-width: 0; }
  #weekly-workbench .weekly-lineup-overview .lineup-metric strong,
  #weekly-workbench .weekly-lineup-overview .weekly-point-summary strong { font-size: 18px; line-height: 20px; }
  #weekly-workbench .weekly-lineup-overview .lineup-metric-label { font-size: 12px; line-height: 1.2; }
  #weekly-workbench .weekly-lineup-overview .weekly-point-summary { display: grid; gap: 0; padding: 4px 8px; }
  #weekly-workbench .weekly-lineup-overview .weekly-point-summary > span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }
  #weekly-workbench .weekly-lineup-overview .weekly-point-summary small { font-size: 13px; line-height: 18px; }
  #weekly-workbench .weekly-lineup-overview .weekly-point-disclosure { font-size: 12px; line-height: 1.3; margin: 0; padding: 0 8px 8px; }
  #weekly-workbench .accepted-lineup .weekly-lineup-overview .weekly-point-disclosure { padding-bottom: 4px; }
  #weekly-workbench .working-lineup .lineup-card-row {
    grid-template-columns: 37.5px minmax(92.5px, 1fr) 23px 30.5px 58.5px 28px 52px 60px 44px 44px;
    gap:7px;
    min-height: 44px;
    padding: 0 8px;
  }
  #weekly-workbench .working-lineup .lineup-card-row:has(> .lineup-defense),
  #weekly-workbench .working-lineup .weekly-card-columns:has(> .lineup-defense-header) {
    grid-template-columns: 37.5px minmax(92.5px, 1fr) 28px 23px 30.5px 58.5px 52px 60px 44px 44px;
  }
  #weekly-workbench .working-lineup .lineup-card-row:not(:has(.lineup-item-edit[open])) { row-gap: 0; }
  #weekly-workbench .working-lineup .weekly-point-cell { flex-direction: row; align-items: baseline; gap: 4px; flex-wrap: wrap; }
  #weekly-workbench .working-lineup .weekly-point-cell small { margin-top: 0; }
  #weekly-workbench .working-lineup .weekly-card-columns { min-height: 24px; }
  #weekly-workbench .accepted-lineup .lineup-card-row {
    grid-template-columns: 37.5px minmax(100.5px, 1fr) 23px 30.5px 58.5px 28px 52px 86px;
    gap:7px;
    min-height: 24px;
    padding: 0 8px;
    line-height: 20px;
  }
  #weekly-workbench .accepted-lineup .lineup-card-row:has(> .lineup-defense),
  #weekly-workbench .accepted-lineup .weekly-card-columns:has(> .lineup-defense-header) {
    grid-template-columns: 37.5px minmax(100.5px, 1fr) 28px 23px 30.5px 58.5px 52px 86px;
  }
  #weekly-workbench .accepted-lineup .weekly-point-cell { flex-direction: row; align-items: baseline; gap: 4px; flex-wrap: wrap; }
  #weekly-workbench .accepted-lineup .weekly-point-cell small { margin-top: 0; }
  #weekly-workbench .weekly-move { padding-top: 0; }

}

@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #fff;
    --text: #000; --text-muted: #333; --border: #999; --border-2: #777;
    --accent: #000; --accent-dim: #fff; --gold: #333; --gold-dim: #fff;
    --danger: #000; --success: #000; --info: #000;
  }
  body, main, .weekly-shell main { background: #fff; color: #000; }
  main, .weekly-shell main { max-width: none; margin: 0; padding: 0; }
  th { background: #fff; color: #000; }
  .weekly-help-row { display: none !important; }
}

/* Owner 2026-09-14: the same native header anchor owns Accept and Unaccept. */
#weekly-workbench .weekly-action-heading { position: relative; }
#weekly-workbench .weekly-action-heading > strong,
#weekly-workbench .weekly-action-heading > h2 {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding-right: 124px;
}
#weekly-workbench .weekly-action-heading > .weekly-primary-accept {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}
#weekly-workbench .weekly-action-heading .weekly-accept-button {
  min-width: 110px;
  min-height: 44px;
  padding: 10px 16px;
}
/* Ruling 625: a compact Lock/Unlock Lineup button at 1280 (same label). */
@media (min-width: 1280px) {
  #weekly-workbench .weekly-action-heading > strong,
  #weekly-workbench .weekly-action-heading > h2 { padding-right: 106px; }
  #weekly-workbench .weekly-action-heading .weekly-accept-button,
  #weekly-workbench .weekly-primary-accept button { min-width: 0; padding: 6px 10px; }
}

/* Exact-card lock indicators and NFL logos keep the existing roster columns. */
#weekly-workbench .lineup-team-logo { width:24px; height:24px; object-fit:contain; flex:0 0 24px; }
#weekly-workbench .lineup-team-fallback { width:24px; min-width:24px; font-size:10px; font-weight:700; color:var(--text-muted); text-align:center; }
#weekly-workbench .lineup-player-padlock { display:inline-flex; align-items:center; justify-content:center; color:var(--accent, #ff5b00); flex-shrink:0; }
#weekly-workbench .lineup-played-lock-action { display:flex; justify-content:center; align-items:center; min-height:44px; }
#weekly-workbench .lineup-manual-lock-edit { gap:6px; }
@media(max-width:700px) { #weekly-workbench .lineup-played-lock-action { grid-column:4; grid-row:1; } }
#weekly-workbench .lineup-manual-lock-edit { border-color:transparent; background:transparent; padding:0; }
#weekly-workbench .lineup-manual-lock-edit > span:last-child { display:flex; align-items:center; justify-content:center; min-height:44px; padding:6px 10px; border:1px solid var(--border-2, #666); border-radius:3px; background:var(--surface-2, #202020); }
#weekly-workbench .weekly-point-cell > .lineup-player-padlock { margin-left:4px; vertical-align:middle; }

/* Keep the badge beside the name and let full names wrap when space is tight. */
#weekly-workbench .lineup-player-cell .lineup-player-name { display:inline-flex; align-items:center; flex:1 1 auto; min-width:0; gap:4px; flex-wrap:nowrap; }
#weekly-workbench .lineup-player-cell .lineup-team-logo,
#weekly-workbench .lineup-player-cell .lineup-team-fallback { flex:none; width:20px; height:20px; }
#weekly-workbench .lineup-player-cell .lineup-player-text { display:inline-flex; align-items:center; min-width:0; gap:4px; flex-wrap:nowrap; }
#weekly-workbench .lineup-player-cell .lineup-player-label { display:block; min-width:0; white-space:normal; overflow-wrap:normal; }
#weekly-workbench .lineup-player-cell .lineup-player-line { display:inline-flex; align-items:center; min-width:0; flex-wrap:wrap; }
#weekly-workbench .lineup-player-cell .lineup-collection-badge { display:inline-flex; align-items:center; justify-content:center; flex:none; width:22px; min-width:22px; height:16px; padding:0 2px; border-top:2px solid #fc0b25; border-bottom:2px solid #0866eb; background:#050505; color:#fff; font:700 11px/1 var(--font-display); }
#weekly-workbench .lineup-player-cell .lineup-collection-badge--fury, #weekly-workbench .lineup-player-cell .lineup-collection-badge--image { border:0; background:transparent; height:16px; width:auto; min-width:0; padding:0; vertical-align:middle; }
@media(max-width:600px) {
  #weekly-workbench .lineup-player-group { flex-wrap:wrap; }
  #weekly-workbench .lineup-player-cell { display:inline-flex; }
  #weekly-workbench .lineup-player-cell .lineup-player-name { flex:0 1 auto; }
}

/* Round six: a dedicated lock cell leaves every Edit control unchanged. */
#weekly-workbench .working-lineup .lineup-card-row { grid-template-columns:32px minmax(142px,1fr) 22px 23px 58px 28px 45px 112px 44px 44px; gap:5px; }
/* Booth ruling 797: open/unavailable rows keep their original tracks. */
@media(min-width:601px) {
  #weekly-workbench .working-lineup .lineup-card-row:has(> .lineup-defense),
  #weekly-workbench .working-lineup .weekly-card-columns:has(> .lineup-defense-header) { grid-template-columns:32px minmax(142px,1fr) 28px 22px 23px 58px 45px 112px 44px 44px; gap:5px; }
}
@media (min-width: 1280px) {
  #weekly-workbench .working-lineup .lineup-card-row { grid-template-columns:37.5px minmax(92.5px,1fr) 23px 30.5px 58.5px 28px 52px 60px 44px 44px; gap:7px; }
  #weekly-workbench .working-lineup .lineup-card-row:has(> .lineup-defense),
  #weekly-workbench .working-lineup .weekly-card-columns:has(> .lineup-defense-header) { grid-template-columns:37.5px minmax(92.5px,1fr) 28px 23px 30.5px 58.5px 52px 60px 44px 44px; gap:7px; }
}
#weekly-workbench .working-lineup .lineup-item-edit > summary { grid-column:10; }
#weekly-workbench .lineup-lock-cell { grid-column:9; grid-row:1; display:flex; align-items:center; justify-content:center; min-height:44px; }
#weekly-workbench .lineup-manual-unlock { width:44px; min-width:44px; height:44px; padding:0; display:flex; align-items:center; justify-content:center; background:transparent; border:0; }
@media(max-width:600px) {
  #weekly-workbench .working-lineup .lineup-card-row { grid-template-columns:40px minmax(0,1fr) 45px 44px 72px; }
  #weekly-workbench .lineup-lock-cell { grid-column:4; grid-row:1; }
  #weekly-workbench .working-lineup .lineup-item-edit > summary { grid-column:5; grid-row:1; }
  #weekly-workbench .lineup-card-row.weekly-card-columns { min-height:20px; }
}

/* Keep the full roster columns scrollable inside their available editor width. */
@media(min-width:601px) {
  #weekly-workbench .working-lineup > .lineup-card-list {
    min-width:0;
    max-width:100%;
    overflow-x:auto;
    container-type:inline-size;
  }
  #weekly-workbench .working-lineup .lineup-item-edit[open] > .lineup-item-edit-panel {
    position:sticky;
    left:8px;
    width:calc(100cqw - 16px);
    max-width:100%;
  }
}

/* These two disclosures remain full-size targets with either pointer type. */
#weekly-workbench .weekly-help-row > .weekly-automatic-locks > summary,
#weekly-workbench .weekly-help-row > .weekly-workflow-help > summary {
  min-height:44px;
}

/* Native labels provide tap room without enlarging checkbox artwork. */
#weekly-workbench .manual-played-toggle,
#weekly-workbench.weekly-enhanced .weekly-select-all,
#weekly-workbench .toggle-row,
#weekly-workbench .weekly-started-exceptions > label {
  min-height:44px;
  display:flex;
  align-items:center;
  gap:8px;
}
#weekly-workbench #weekly-lineup-list li {
  grid-template-columns:44px minmax(92px,1fr) 62px auto;
}
#weekly-workbench .weekly-lineup-check-target {
  grid-column:1;
  width:44px;
  min-height:44px;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
#weekly-workbench .weekly-lineup-check-target > .weekly-lineup-check {
  width:16px;
  height:16px;
  flex:0 0 16px;
  margin:0;
}

/* Round nine: supporting header copy grows without changing headings or buttons. */
#weekly-workbench .weekly-heading > p,
#weekly-workbench .weekly-heading .table-note,
#weekly-workbench .weekly-heading .lineup-action-reason,
#weekly-workbench .weekly-heading #manual-played-help,
#weekly-workbench .weekly-heading .manual-played-toggle,
#weekly-workbench .weekly-heading .weekly-help-row > details,
#weekly-workbench .weekly-heading .weekly-help-row > details > summary {
  font-size:15px;
  line-height:1.4;
}

/* D-160: a registered open slot is a plain, control-free row in roster order. */
#weekly-workbench .lineup-open-slot-row > .lineup-open-slot { grid-column: 2 / -1; font-style: italic; }

/* Owner rulings 631/633 (2026-09-30): the overview column gives Name only the
   width the one-line rule needs (tag + logo + name + PT; EXPIRED sits on a
   second line), and stays as wide as that allows; its blocks stay in it. */
@media (min-width: 1280px) {
  #weekly-workbench .weekly-lineup-overview .lineup-header > strong,
  #weekly-workbench .weekly-accepted-heading h2 { font-size: 16px; line-height: 1.2; }
  /* Lock and Unlock share one anchor (top-right of the heading, as at r3), so
     the header does not jump between the labels; the contest name starts
     under the compact 44 px button instead of beside it. */
  #weekly-workbench .weekly-action-heading > strong,
  #weekly-workbench .weekly-action-heading > h2 { padding-right: 0; padding-top: 48px; min-height: 0; }
  /* Working: the state box shares the button's first row (left), so the name
     starts under both without an extra row. */
  #weekly-workbench .working-lineup .weekly-action-heading > strong { padding-top: 0; }
  #weekly-workbench .working-lineup .weekly-action-heading > .lineup-state { order: -1; display: inline-flex; align-items: center; box-sizing: border-box; min-height: 44px; margin-right: auto; }
  #weekly-workbench .weekly-action-heading > .weekly-primary-accept { position: absolute; top: 8px; right: 8px; }
  #weekly-workbench .working-lineup .weekly-lineup-overview .lineup-metric { flex: 1 1 100%; }
  #weekly-workbench .working-lineup .weekly-lineup-overview .lineup-header { padding: 8px 4px; }
  #weekly-workbench .working-lineup .weekly-lineup-overview .lineup-header > strong { font-size: 15px; }
  #weekly-workbench .working-lineup .weekly-lineup-overview .weekly-point-summary { padding: 4px; }
  #weekly-workbench .working-lineup .weekly-action-heading .weekly-accept-button { padding: 6px; }
  #weekly-workbench .working-lineup .weekly-lineup-overview .weekly-point-summary > span { grid-template-columns: minmax(0, 1fr); }
}

/* Owner ruling 633: on a lineup row an EXPIRED stamp sits on a second line,
   directly beneath the name (left edge under the name, past the logo); the
   first line stays tag + logo + name + PT.  Markup is unchanged. */
.lineup-player-cell .lineup-player-name:has(> .expired-tag),
#weekly-workbench .lineup-player-cell .lineup-player-name:has(> .expired-tag) { display: inline-flex; flex-wrap: wrap; align-items: center; row-gap: 2px; }
.lineup-player-cell .lineup-player-name:has(> .expired-tag) > .lineup-collection-badge { order: 1; }
.lineup-player-cell .lineup-player-name:has(> .expired-tag)::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
.lineup-player-cell .lineup-player-name > .expired-tag { order: 3; margin-left: 24px; }
#weekly-workbench .lineup-player-cell .lineup-player-name > .expired-tag { margin-left: 24px; }
