/* site.css -- the tracker's few components (kit m40ct). Every value comes from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-body);
  line-height: 1.5; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--muted); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.02em; max-width: 22em; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: var(--fs-body); font-weight: 600; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* masthead */
.mast { border-bottom: 1px solid var(--line); }
.mastrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.wordmark { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.host { font-size: var(--fs-small); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.asof { margin: 0; font-size: var(--fs-small); color: var(--muted); }
.tabs { display: flex; gap: 24px; overflow-x: auto; white-space: nowrap; }
.tabs a { text-decoration: none; padding: 10px 0 12px; font-size: 15px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

main > section, main > figure { margin-top: var(--gap); }
.kicker { margin: 0 0 8px; font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.kicker a { color: var(--muted); }
.sub { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-dense); }
.src { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-small); }
.coming { color: var(--muted); font-style: italic; }
.more { margin-top: 20px; }

/* lead and big numbers */
.lead { padding-top: 8px; }
.bignums { display: flex; gap: 56px; flex-wrap: wrap; margin-top: 28px; }
.big { display: flex; flex-direction: column; }
.big .lbl { font-size: var(--fs-small); color: var(--muted); font-weight: 600; }
.big .num { font-size: var(--fs-big); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.big .chg { font-size: var(--fs-dense); color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; height: var(--btn-h); padding: 0 18px; border: 1px solid var(--text); border-radius: var(--radius);
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--text); background: transparent; }
.btn:hover { background: var(--soft); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.small { height: 36px; padding: 0 14px; font-size: var(--fs-small); }

/* tables */
.tablewrap { overflow-x: auto; margin-top: 16px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-dense); }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { font-size: var(--fs-small); color: var(--muted); font-weight: 600; }
tbody th { text-align: left; font-weight: 600; }
thead th:nth-child(2) { text-align: left; }
td.rk, th.rk { text-align: left; color: var(--muted); width: 2em; padding-left: 0; }
tr.us td, tr.us th { background: var(--soft); }
tr.us th { box-shadow: inset 3px 0 0 var(--accent); }
.h { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-small); }
td.act { text-align: right; }
.cmp { font-size: var(--fs-small); font-weight: 600; }
table.plain th, table.plain td { text-align: left; white-space: normal; vertical-align: top; }
table.side td, table.side th { width: 33%; }
table.side thead th.us { color: var(--text); }
ul.plain { padding-left: 20px; max-width: 46em; }
ul.plain li { margin: 6px 0; }

/* charts */
.chart { margin: 0; position: relative; }
.plot-wrap { position: relative; margin: 20px 0 0 52px; height: 260px; }
.plot, .cols { position: absolute; inset: 0; }
.plot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.plot line.grid { stroke: var(--line); stroke-width: 1; }
.plot line.zero { stroke: var(--muted); stroke-width: 1; }
.plot .ln { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.plot .ln.field { stroke: var(--field); stroke-width: 1.5; }
.plot .ln.pick { stroke: var(--pick); stroke-width: 2.5; }
.plot .ln.us { stroke: var(--accent); stroke-width: 3; }
.ylab { position: absolute; top: 0; bottom: 0; left: -52px; width: 46px; }
.yt { position: absolute; right: 0; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.xlab { position: absolute; left: 0; right: 0; bottom: -24px; height: 20px; }
.xt { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }
.xt.start { transform: none; }
.xt.end { transform: translateX(-100%); }
.legend { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--fs-small); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .key { width: 16px; height: 3px; border-radius: 2px; background: var(--field); }
.legend .us .key { background: var(--accent); }
.legend .pick .key { background: var(--pick); }
.barlist { list-style: none; padding: 0; margin: 18px 0 0; }
.barlist li { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 72px; gap: 12px; align-items: center; padding: 5px 0; font-size: var(--fs-dense); }
.barlist li.us .bl { font-weight: 700; }
.bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { position: relative; height: 16px; }
.track .z { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--muted); }
.bar { position: absolute; top: 2px; height: 12px; border-radius: 3px; background: var(--field); }
.bar.us { background: var(--accent); }
.bar.neg { background: var(--neg); }
.bar.neg.us { background: var(--accent); }
.bv { text-align: right; }
.cols { display: flex; align-items: stretch; gap: 4px; }
.cols .z { position: absolute; left: 0; right: 0; height: 1px; background: var(--muted); }
.grp { position: relative; flex: 1; display: flex; gap: 2px; }
.col { position: relative; flex: 1; border-radius: 2px; background: var(--field); }
.col.us { background: var(--accent); }
.col.pick { background: var(--pick); }
.col.none { background: transparent; }

/* best of */
.vow { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; margin-top: 8px; }
.vow h3 { font-size: 26px; letter-spacing: -0.02em; }
.vow h3 a { text-decoration: none; }
.vow .meta, .vow .stats { margin: 10px 0 0; color: var(--muted); }
.vow .btn { margin-top: 20px; }
.vow .read, .vcard .read, .pcard .read { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.thumb { display: block; border-radius: var(--radius); overflow: hidden; background: var(--soft); aspect-ratio: 16 / 9; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.grid { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 28px 24px; }
.vgrid { grid-template-columns: repeat(3, 1fr); }
.vcard h4 { margin-top: 10px; font-size: 15px; }
.vcard h4 a { text-decoration: none; }
.vcard .meta { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-small); }
.pgrid { grid-template-columns: repeat(3, 1fr); }
.pcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.pmeta { margin: 0; font-size: var(--fs-small); color: var(--muted); font-weight: 600; }
.ptext { margin: 0; font-size: 15px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.ptext.none { color: var(--muted); }
.pimg { border-radius: 6px; width: 100%; max-height: 360px; object-fit: cover; }
.pnums { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); }
.pnums b { color: var(--text); }
.pcard .btn { align-self: flex-start; margin-top: auto; }

/* compare */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pill { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: var(--fs-small); font-weight: 600; }
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill.on:hover { color: var(--bg); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.foot { margin-top: 72px; padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }

@media (max-width: 760px) {
  .vow, .cols2 { grid-template-columns: 1fr; gap: 20px; }
  .vgrid, .pgrid { grid-template-columns: 1fr; }
  .bignums { gap: 28px; }
  .barlist li { grid-template-columns: 112px 1fr 64px; gap: 8px; }
  .plot-wrap { height: 200px; margin-left: 46px; }
  .ylab { left: -46px; width: 40px; }
  th, td { padding: 8px 5px; }
  table.board { font-size: var(--fs-small); }
  table.board thead th { white-space: normal; vertical-align: bottom; }
  table.board tbody th { white-space: normal; min-width: 7.5em; }
  table.board .h, table.board .act { display: none; }
  td.rk, th.rk { width: 1.4em; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .vgrid, .pgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .vgrid { gap: 18px; }
  .vcard { display: grid; grid-template-columns: 136px 1fr; column-gap: 12px; align-items: start; }
  .vcard .thumb { grid-row: span 3; }
  .vcard h4 { margin-top: 0; font-size: 14px; }
}

/* re-sort without script (kit m40ctf): one radio per order, the checked one's table shows */
.sorter { margin-top: 16px; }
.sorter-lbl { font-size: var(--fs-small); color: var(--muted); font-weight: 600; margin-right: 10px; }
.sorter > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sorter > label { display: inline-block; margin: 0 6px 6px 0; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.sorter > input:checked + label { background: var(--text); color: var(--bg); border-color: var(--text); }
.sorter > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.sorts > .sort { display: none; }
.sorter > input:nth-of-type(1):checked ~ .sorts > .sort:nth-child(1),
.sorter > input:nth-of-type(2):checked ~ .sorts > .sort:nth-child(2),
.sorter > input:nth-of-type(3):checked ~ .sorts > .sort:nth-child(3),
.sorter > input:nth-of-type(4):checked ~ .sorts > .sort:nth-child(4) { display: block; }
.sorts .tablewrap { margin-top: 8px; }
.note { margin: 10px 0 0; font-size: var(--fs-dense); color: var(--muted); }
