/* The selectors and the pages they open (team page v2, Phase C: docs/REDESIGN.md): Pick your team as a fact pack,
   the conference rows (the selector and the conference page), the polls against NAPPR+ on National, the team page's
   players and 4th down.
   One slice of the page's stylesheet. The files load in the order of their numbers (the <link> list in
   web/site_template.html) and several rules rely on that order at equal specificity: never reorder or merge
   them without running tests/layout_check.js. */

/* ---------- The Teams landing: the Top 25, or one conference's teams ---------- */
.tp-pk { margin: 0 0 4px; }
.tp-pk .pk-trig { min-width: 280px; }
.tp-ph { color: var(--muted); font-weight: 400; }
.tp-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 0 6px; font-family: var(--f-display); font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.02em; }
.tp-cl { font-family: var(--f-body); font-size: 0.82rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--score); white-space: nowrap; }
/* a team (the owner, Dec 2): the poll's rank, team, conference, AP, CFP, W-L, NAPPR+ (over a game), its FBS rank, and
   the poll's rank less NAPPR+'s; tight columns, the team takes the rest */
.tp-th, .tp-r { display: grid; grid-template-columns: 26px minmax(0, 1fr) 40px 26px 30px 40px 104px 34px 36px; gap: 8px; align-items: center; }
.tp-th { font-size: 0.75rem; color: var(--muted); padding: 4px 4px 3px; line-height: 1.15; align-items: end; }
.tp-th > span:nth-child(1), .tp-th > span:nth-child(n+3) { text-align: right; }
.tp-th small { display: block; font-size: 0.72rem; }
.tp-r { padding: 6px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; border-radius: 6px; font-variant-numeric: tabular-nums; }
.tp-r:hover { background: var(--surface); }
.tp-r:focus-visible { outline: 2px solid var(--score); outline-offset: -2px; }
.tp-k { text-align: right; font-weight: 700; font-size: 0.9rem; }
.tp-r .logo { margin-right: 0; }
.tp-cf, .tp-p, .tp-rec, .tp-net, .tp-gap { text-align: right; white-space: nowrap; font-size: 0.88rem; }
.tp-cf, .tp-p { color: var(--muted); font-size: 0.82rem; }
.tp-cf { overflow: hidden; text-overflow: ellipsis; }
.tp-r .tp-cfm { display: none; }
.tp-net b { font-weight: 700; font-size: 0.92rem; }
.tp-pg { color: var(--muted); font-size: 0.82rem; }
.tp-gap { font-weight: 700; }
.tp-gap.hi { color: var(--score); } .tp-gap.lo { color: var(--turn); }
.tp-lead { color: var(--muted); font-size: 0.86rem; line-height: 1.4; margin: -2px 0 10px; max-width: 70ch; }
/* "NAPPR+" at the head of the line links to the definition in the footer (#nappr) */
.tp-def { font-weight: 700; color: var(--score); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.tp-def:focus-visible { outline: 2px solid var(--score); outline-offset: 1px; border-radius: 2px; }
@media (max-width: 640px) {
  .tp-pk .pk-trig { min-width: 0; }
  /* the conference moves under the name, so the name has room */
  .tp-th, .tp-r { grid-template-columns: 20px minmax(0, 1fr) 20px 22px 32px 46px 24px 26px; gap: 3px; }
  .tp-th .tp-cf, .tp-r .tp-cf { display: none; }
  .tp-r .tp-cfm { display: block; font-size: 0.72rem; color: var(--muted); }
  .tp-k { font-size: 0.8rem; }
  .tp-r { padding: 6px 2px; }
  .tp-r .tp-nm { gap: 5px; }
  .tp-r .logo img { width: 18px; height: 18px; }
  .tp-r .tp-nm b { white-space: normal; font-size: 0.84rem; }     /* wrap, never cut a name */
  .tp-p, .tp-pg { font-size: 0.75rem; }
  .tp-rec, .tp-gap { font-size: 0.8rem; }
  .tp-net b { font-size: 0.84rem; }
  .tp-pg { display: block; }                                       /* over a game under the value */
  .tp-th { font-size: 0.7rem; }
}
.tp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.tp-pill:hover, .tp-pill:focus-visible { border-color: var(--score); }
/* a team (the conference page): place, name (polls under it), record (conference under it), NAPPR+ (rank under it) */
.tp-hd, .tp-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 48px 64px; gap: 8px; align-items: center; }
.tp-hd { font-size: 0.75rem; color: var(--muted); padding: 4px 4px 3px; line-height: 1.15; }
.tp-hd > span:nth-child(3), .tp-hd > span:nth-child(4) { text-align: right; }
.tp-hd small { display: block; font-size: 0.75rem; }
.tp-row { padding: 5px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; border-radius: 6px; }
.tp-row:hover { background: var(--surface); }
.tp-row:focus-visible { outline: 2px solid var(--score); outline-offset: -2px; }
.tp-pl { font-size: 0.75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tp-nm { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tp-nm > span { min-width: 0; }
.tp-nm b { display: block; font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-nm small, .tp-rec small, .tp-v small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.tp-rec, .tp-v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.88rem; }
.tp-v b { font-weight: 700; }
.tp-v small.hi { color: var(--score); font-weight: 700; } .tp-v small.lo { color: var(--turn); font-weight: 700; }
/* ---------- a conference as a row: its teams on the national scale ---------- */
.cf-lead { margin: 4px 0 14px; }
.cf-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 76px 64px; grid-template-areas: "pl nm rec sc" "sp sp sp sp"; gap: 2px 10px; align-items: center;
  padding: 10px 6px 8px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; border-radius: 6px; }
a.cf-row:hover { background: var(--surface); }
a.cf-row:focus-visible { outline: 2px solid var(--score); outline-offset: -2px; }
.cf-row.me { background: var(--surface); }
.cf-pl { grid-area: pl; font-family: var(--f-display); font-size: 0.92rem; color: var(--muted); text-align: right; }
.cf-nm { grid-area: nm; min-width: 0; }
.cf-nm b { display: block; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-nm small, .cf-sc small, .cf-rec small { display: block; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.cf-sc { grid-area: sc; text-align: right; font-variant-numeric: tabular-nums; }
.cf-rec { grid-area: rec; text-align: right; font-variant-numeric: tabular-nums; }
.cf-sp { grid-area: sp; min-width: 0; padding-top: 6px; }
.cf-st { position: relative; display: block; height: 22px; }
.cf-st i { position: absolute; }
.cf-z { top: -2px; bottom: -2px; width: 0; border-left: 1px dashed var(--line-strong); }
.cf-iqr { top: 5px; height: 12px; background: var(--line-strong); opacity: 0.3; border-radius: 2px; }
.cf-md { top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--ink); opacity: 0.6; }
.cf-d { top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; box-sizing: border-box; border: 1px solid var(--surface); opacity: 0.85; }
.cf-d.pos { background: var(--score); } .cf-d.neg { background: var(--turn); }
.cf-d.me { width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--ink); opacity: 1; }
.cf-ends { position: relative; display: block; height: 16px; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.cf-ends span { position: absolute; top: 0; white-space: nowrap; }
.cf-ends span.r { margin-left: -5px; } .cf-ends span.l { transform: translateX(-100%); margin-left: 5px; } .cf-ends span.e { margin-left: 0; }
.cf-axis { border-top: 0; padding-top: 0; }
.cf-axis .cf-sp { padding-top: 0; }
.cf-ax { position: relative; display: block; height: 16px; border-top: 1px solid var(--line-strong); }
.cf-ax span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-key .cf-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 5px; }
.cf-sw.pos { background: var(--score); } .cf-sw.neg { background: var(--turn); }
/* side by side from 640 px: the strip takes the right half */
@media (min-width: 640px) {
  .cf-row { grid-template-columns: 22px minmax(0, 1fr) 76px 64px minmax(0, 1.9fr); grid-template-areas: "pl nm rec sc sp"; }
  .cf-sp { padding-top: 0; }
  .cf-axis .cf-pl, .cf-axis .cf-nm, .cf-axis .cf-sc, .cf-axis .cf-rec { visibility: hidden; }
}
@media (max-width: 639px) { .cf-axis { grid-template-areas: "sp sp sp sp"; } .cf-axis > span:not(.cf-sp) { display: none; } }
/* the conference page: a few facts as big numbers */
.cf-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 16px; margin: 10px 0 4px; }
.cf-fact { display: flex; flex-direction: column; }
.cf-fact-l { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cf-fact-v { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cf-fact-s { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.cf-fact-s.hi { color: var(--score); font-weight: 700; } .cf-fact-s.lo { color: var(--turn); font-weight: 700; }
.cf-one .cf-row { border-top: 0; grid-template-columns: 22px minmax(0, 1fr) 76px 64px; grid-template-areas: "pl nm rec sc" "sp sp sp sp"; }
.cf-one .cf-row .cf-sp { padding-top: 8px; }
.cf-one .cf-axis { grid-template-areas: "sp sp sp sp"; padding-top: 0; } .cf-one .cf-axis > span:not(.cf-sp) { display: none; }

/* ---------- National: the polls against NAPPR+ ---------- */
.nb-pick { margin: 4px 0 10px; }
.nb-svg { max-width: 520px; margin-top: 8px; }
.nb-svg text { font-size: 11px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.nb-svg .nb-h { fill: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.nb-svg .nb-r { fill: var(--muted); }
.nb-svg .nb-l.out { fill: var(--muted); }
.nb-svg .nb-l.pos .nb-r { fill: var(--score); font-weight: 700; } .nb-svg .nb-l.neg .nb-r { fill: var(--turn); font-weight: 700; }
.nb-ln { fill: none; stroke-width: 1.5; }
.nb-ln.pos { stroke: var(--score); } .nb-ln.neg { stroke: var(--turn); } .nb-ln.near { stroke: var(--line-strong); opacity: 0.55; stroke-width: 1; }
.nb-ld { fill: none; stroke: var(--line-strong); stroke-width: 0.8; opacity: 0.6; }
.nb-d.pos { fill: var(--score); } .nb-d.neg { fill: var(--turn); } .nb-d.near { fill: var(--muted); }
.nb-d.out { fill: var(--surface); stroke: var(--muted); stroke-width: 1.2; }
.tm-key .nb-sw { width: 14px; height: 3px; background: var(--line-strong); }
.tm-key .nb-sw.out { width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--muted); box-sizing: border-box; }
.nb-c { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr) 92px; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line);
  font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.nb-c-n { color: var(--ink); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-c-b { position: relative; height: 10px; background: linear-gradient(var(--line-strong), var(--line-strong)) 50% 0 / 1px 100% no-repeat; }
.nb-c-b i { position: absolute; top: 1px; height: 8px; border-radius: 2px; }
.nb-c-b i.pos { background: var(--score); } .nb-c-b i.neg { background: var(--turn); }
.nb-c-v { text-align: right; font-weight: 700; white-space: nowrap; }
.nb-c-v small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }

/* ---------- the team page: players by position ---------- */
.pl-g + .pl-g, .pl-cols { margin-top: 16px; }
.pl-g h4 { margin: 0 0 4px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pl-l { list-style: none; margin: 0; padding: 0; }
.pl-l > li { border-top: 1px solid var(--line); }
.pl-r > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 12px; gap: 10px; align-items: center; padding: 7px 0; cursor: pointer; list-style: none; }
.pl-r > summary::-webkit-details-marker { display: none; }
.pl-r > summary::after { content: ""; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); justify-self: center; margin-top: -3px; }
.pl-r[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.pl-r > summary:hover .pl-n b { text-decoration: underline; text-underline-offset: 2px; }
.pl-r > summary:focus-visible { outline: 2px solid var(--score); outline-offset: 2px; border-radius: 3px; }
.pl-key .pl-r > summary { grid-template-columns: 24px minmax(0, 1fr) auto 12px; }
.pl-pos { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.pl-n { min-width: 0; }
.pl-n b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-n small, .pl-v small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.pl-v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-v b { font-size: 1.02rem; }
.pl-v small.hi { color: var(--score); font-weight: 700; } .pl-v small.lo { color: var(--turn); font-weight: 700; }
/* a player's parts, opened: plus and minus, adding up to his PAR */
.pl-d { padding: 0 22px 10px 0; }
.pl-key .pl-d { padding-left: 34px; }
.pl-parts { list-style: none; margin: 0; padding: 0; max-width: 260px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.pl-parts li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.pl-parts li.tot { border-top: 1px solid var(--line-strong); margin-top: 2px; padding-top: 4px; font-weight: 700; }
.pl-parts b.pos { color: var(--score); } .pl-parts b.neg { color: var(--turn); }
.pl-to { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); max-width: 46ch; }
.pl-hint { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); }
.pl-few { margin: 4px 0 0; font-size: 0.78rem; color: var(--muted); }
@media (min-width: 640px) { .pl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; } .pl-cols .pl-g + .pl-g { margin-top: 0; } }

/* ---------- the team page: 4th down, offense left, defense right ---------- */
/* 4th down's strips: offense left, defense right, at every width, so the two rates sit side by side */
.fd-s { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; align-items: end; }
.fd-s h4 { margin: 6px 0 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.fd-s .tm-s { border-top: 1px solid var(--line); }
@media (max-width: 639px) { .fd-s { gap: 0 12px; } .fd-s .tm-s-st { padding: 0 18px; } .fd-s .tm-s-l { font-size: 0.82rem; } }
.fd-cols .tm-grp + .tm-grp { margin-top: 18px; }
@media (min-width: 640px) { .fd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; } .fd-cols .tm-grp + .tm-grp { margin-top: 0; } }
.fd-t { width: 100%; border-collapse: collapse; margin-top: 12px; font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.fd-t caption { text-align: left; font-size: 0.78rem; color: var(--muted); padding-bottom: 4px; }
.fd-t th, .fd-t td { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
.fd-t thead th { font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.fd-t th:first-child { text-align: left; font-weight: 400; white-space: nowrap; }
.fd-t tr.tot th, .fd-t tr.tot td { border-top: 2px solid var(--line-strong); font-weight: 600; }
.fd-c { white-space: nowrap; }
.fd-p { display: inline-block; min-width: 2.6em; font-weight: 700; margin-left: 4px; }
.fd-p.up { color: var(--score); } .fd-p.dn { color: var(--turn); }
.fd-f { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
