/*
 * Content pages (docs, leaderboard, blog, changelog), built by build.mjs. Loaded after site.css and made only of its
 * tokens. Syntax colours are the --syn-* tokens from site.css's token block; the fallbacks keep code readable without them.
 */

.page main { padding-top: 72px; min-height: 70vh; }

/* ---------- prose: reading text set for reading (T.read 19/29), headings in Neue Montreal Medium ---------- */
.prose { font-weight: 400; font-size: 18px; line-height: 29px; color: var(--read); }
.prose > * + * { margin-top: 18px; }
.prose p, .prose li { text-wrap: pretty; }
.prose h1 { margin: 0; font-weight: 500; font-size: clamp(34px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.022em; color: var(--ink); }
.prose h2 { margin-top: 48px; font-weight: 500; font-size: 26px; line-height: 32px; letter-spacing: -0.012em; color: var(--ink); scroll-margin-top: 96px; position: relative; }
.prose h3 { margin-top: 32px; font-weight: 500; font-size: 20px; line-height: 26px; color: var(--ink); scroll-margin-top: 96px; position: relative; }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose .anchor { position: absolute; left: -24px; width: 20px; color: var(--mute); opacity: 0; transition: opacity 0.2s; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p { margin-bottom: 0; }
.prose p.lede { font-size: 21px; line-height: 31px; color: var(--soft); }
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(var(--ink-rgb), 0.3); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.prose a:hover { text-decoration-color: var(--ink); }
/* lists: a small round bullet in the muted ink, centred on the first line; numbers in the muted ink, tabular */
.prose ul, .prose ol { padding-left: 24px; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -17px; top: calc(0.5lh - 3px); width: 6px; height: 6px; border-radius: 3px; background: var(--mute); }
.prose li + li { margin-top: 10px; }
.prose ol > li { padding-left: 4px; }
.prose ol > li::marker { color: var(--mute); font-variant-numeric: tabular-nums; }
/* a list of named points: the name on its own line, the explanation beneath, a hairline between */
.prose ul.leads { padding-left: 0; }
.prose ul.leads > li { padding: 16px 0; border-top: 1px solid var(--line); color: var(--soft); }
.prose ul.leads > li:last-child { border-bottom: 1px solid var(--line); }
.prose ul.leads > li + li { margin-top: 0; }
.prose ul.leads > li::before { display: none; }
.prose ul.leads .lead { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 500; }
/* inline code: a quiet tint, no taller than the line, so a sentence full of names still reads as a sentence */
.prose code { font-family: var(--sans); font-weight: 400; font-size: 0.92em; line-height: inherit; padding: 1px 5px; border-radius: 6px; background: rgba(var(--ink-rgb), 0.07); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* on a phone a long header or URL wraps inside its chip, so it never pushes the page wider than the screen */
@media (max-width: 760px) { .prose code { white-space: normal; } }
.prose .ar, .prose p.ar { font-family: var(--arabic); direction: rtl; unicode-bidi: isolate; font-size: 1.08em; color: var(--ink); }
.prose p.ar { display: block; text-align: right; font-size: 20px; line-height: 38px; color: var(--read); }
.prose .quran { font-family: var(--quran); direction: rtl; unicode-bidi: isolate; font-size: 1.3em; line-height: 2; color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--line); color: var(--soft); }
.prose figure { margin-left: 0; margin-right: 0; }

/* tables (parameters, comparisons) */
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 23px; display: block; overflow-x: auto; scrollbar-width: none; }
.prose table::-webkit-scrollbar { display: none; }
.prose thead th { text-align: left; font-weight: 500; font-size: 14px; color: var(--mute); padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose tbody td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--soft); }
.prose tbody td:first-child code { white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }

/* callouts */
.callout { margin: 20px 0 0; padding: 16px 20px; border-radius: 18px; background: var(--panel2); color: var(--soft); font-size: 17px; line-height: 26px; position: relative; padding-left: 48px; }
.callout::before { content: ""; position: absolute; left: 20px; top: 20px; width: 16px; height: 16px; border-radius: 8px; background: var(--ink); -webkit-mask: radial-gradient(circle at 50% 50%, transparent 2.5px, #000 3px); mask: radial-gradient(circle at 50% 50%, transparent 2.5px, #000 3px); }
.callout.warn::before { border-radius: 3px; transform: rotate(45deg) scale(0.86); }
.callout.tip::before { -webkit-mask: none; mask: none; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); border-radius: 0; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout strong { color: var(--ink); }
.callout code { background: var(--raised); } /* the callout is panel2 already: the chip stays visible on it */

/* ---------- code: highlighted at build time; the type system's own face (no monospace anywhere) ---------- */
.codeblock { position: relative; margin: 20px 0 0; border-radius: 20px; background: var(--fill); overflow: hidden; }
.codeblock figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 8px 0 18px; font-size: 14px; font-weight: 500; color: var(--mute); }
.codeblock .copy { position: static; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--panel2); color: var(--soft); font-size: 13px; font-weight: 500; }
.codeblock .copy:hover { background: var(--raised); color: var(--ink); }
.codeblock pre { margin: 0; padding: 4px 18px 18px; font-size: 15px; line-height: 24px; color: var(--soft); }
.codeblock pre::-webkit-scrollbar { display: none; }
/* a long example opens collapsed, its end fading out, with a button to show it all */
.codeblock.collapsed pre { max-height: 440px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.code-more { display: flex; justify-content: center; padding: 0 0 16px; }
.code-more button { height: 36px; padding: 0 16px; border-radius: 18px; background: var(--panel2); color: var(--soft); font-size: 14px; font-weight: 500; }
.code-more button:hover { background: var(--raised); color: var(--ink); }
.codeblock code { font: inherit; background: none; padding: 0; color: inherit; white-space: inherit; border-radius: 0; }
.codeblock .ar { font-family: var(--arabic); font-size: 16px; color: inherit; }


.code-tabs { margin: 20px 0 0; }
.code-tabs .ct-bar { display: flex; gap: 4px; padding: 4px; border-radius: 18px; background: var(--panel2); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.code-tabs .ct-tab { height: 32px; padding: 0 14px; border-radius: 16px; color: var(--soft); font-size: 14px; font-weight: 500; white-space: nowrap; }
.code-tabs .ct-tab[aria-selected="true"] { background: var(--ink); color: var(--black); }
.code-tabs .codeblock { margin-top: 8px; }
/* under the language tabs the block needs no title row: Copy floats in the corner */
.code-tabs .codeblock figcaption { position: absolute; top: 10px; right: 10px; height: auto; padding: 0; z-index: 1; }
.code-tabs .codeblock figcaption span { display: none; }
.code-tabs .codeblock pre { padding-top: 18px; padding-right: 84px; }

/* ---------- docs: sidebar · article · on this page ---------- */
.docs { display: grid; grid-template-columns: 232px minmax(0, 1fr) 200px; gap: 48px; padding-top: 40px; padding-bottom: 96px; align-items: start; }
.docs-sidebar, .docs-toc { position: sticky; top: 104px; max-height: calc(100vh - 128px); overflow-y: auto; scrollbar-width: none; }
.docs-sidebar::-webkit-scrollbar, .docs-toc::-webkit-scrollbar { display: none; }
.sb-group + .sb-group { margin-top: 28px; }
.sb-title { padding-left: 12px; }
.sb-title, .toc-title { display: block; margin-bottom: 10px; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--mute); }
.docs-sidebar ul, .docs-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-sidebar a { display: block; padding: 7px 12px; border-radius: 12px; font-size: 16px; line-height: 21px; color: var(--soft); transition: background-color 0.2s, color 0.2s; }
.docs-sidebar a:hover { color: var(--ink); background: var(--fill); }
.docs-sidebar a[aria-current="page"] { color: var(--black); background: var(--ink); }
.sb-mobile { display: none; }
.docs-toc a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--line); font-size: 14px; line-height: 19px; color: var(--mute); transition: color 0.2s, border-color 0.2s; }
.docs-toc .l3 a { padding-left: 24px; }
.docs-toc a:hover, .docs-toc a.on { color: var(--ink); border-left-color: var(--ink); }
.doc { min-width: 0; max-width: 760px; }
.doc .crumb { margin: 0 0 10px; font-size: 15px; color: var(--mute); }
.doc > h1 + * { margin-top: 18px; }
.next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px !important; }
.next a { display: grid; gap: 4px; padding: 18px 20px; border-radius: 20px; background: var(--fill); text-decoration: none !important; transition: background-color 0.2s; }
.next a:hover { background: var(--panel2); }
.next a strong { font-size: 18px; line-height: 23px; }
.next a span { font-size: 15px; line-height: 20px; color: var(--mute); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px !important; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 2px; padding: 16px 20px; border-radius: 20px; background: var(--fill); text-decoration: none !important; }
.pager a:hover { background: var(--panel2); }
.pager .next-page { text-align: right; grid-column: 2; }
.pager strong { font-size: 18px; }
@media (max-width: 1180px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .docs-sidebar { position: static; max-height: none; overflow: visible; }
  .sb-desktop { display: none; }
  .sb-mobile { display: block; border-radius: 18px; background: var(--fill); }
  .sb-mobile summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 16px; color: var(--soft); }
  .sb-mobile summary::-webkit-details-marker { display: none; }
  .sb-mobile .sb-inner { padding: 4px 18px 18px 30px; }
  .next { grid-template-columns: 1fr; }
  .prose .anchor { display: none; }
}

/* ---------- list pages: blog, changelog, leaderboard index ---------- */
.list-page { padding-top: 56px; padding-bottom: 104px; }
.list-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: 40px; }
.list-head .lead { margin: 0; }
.back { color: var(--mute); }
.back::before { content: "← "; }
.back:hover { color: var(--ink); }
.read-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-size: 16px; color: var(--ink); }
.read-more svg { transition: transform 0.25s var(--ease); }
a:hover .read-more svg { transform: translateX(3px); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 980px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; min-height: 240px; transition: background-color 0.25s var(--ease), transform 0.25s var(--ease); }
.post-card:hover { background: var(--panel); }
.post-card strong { font-weight: 500; font-size: 22px; line-height: 27px; letter-spacing: -0.008em; color: var(--ink); }
.post-card .desc { font-weight: 400; font-size: 16px; line-height: 23px; color: var(--soft); }
.post-card.big { min-height: 0; padding: 36px; gap: 16px; }
.post-card.big strong { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; letter-spacing: -0.02em; max-width: 820px; }
.post-card.big .desc { font-size: 19px; line-height: 28px; max-width: 720px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 400; font-size: 14px; line-height: 18px; color: var(--mute); }
.meta > * + *::before { content: "·"; margin-right: 16px; color: var(--dim); }

.post { padding-top: 56px; padding-bottom: 104px; }
.post-head { display: grid; gap: 16px; max-width: 680px; margin: 0 auto 40px; }
.post-head .lead { margin: 0; }
.post-body { max-width: 680px; margin: 0 auto; }
.post .more { max-width: 1180px; margin: 96px auto 0; padding-top: 32px; border-top: 1px solid var(--line); }

/* changelog: dates on the left, what changed on the right */
.releases .release { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 40px; padding: 32px 0; border-top: 1px solid var(--line); margin: 0; }
.releases .release:first-child { border-top: 0; padding-top: 0; }
.releases .release header { display: contents; }
.releases .release time { grid-column: 1; grid-row: 1 / span 3; font-size: 15px; line-height: 32px; color: var(--mute); font-variant-numeric: tabular-nums; position: sticky; top: 104px; align-self: start; }
.releases .release h2 { grid-column: 2; margin: 0; }
.releases .release > :not(header) { grid-column: 2; max-width: 720px; } /* a reading measure, as in the docs and posts */
/* a release: its date and title; "In this release", every change linked; then the changes, grouped, each a small
   heading with its text beneath, at a reading measure */
.releases .rel-summary { margin-top: 10px; font-size: 19px; line-height: 28px; color: var(--soft); max-width: 640px; text-wrap: pretty; }
.rel-label { display: block; margin: 0 0 8px; font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; color: var(--mute); }
/* the groups stack, one under another; each group's entries run in two even columns (one on a phone), so a long
   code name never squeezes its neighbours into wrapping */
.releases .rel-toc { margin-top: 24px; padding: 24px 28px; border-radius: 20px; background: var(--fill); display: flex; flex-direction: column; gap: 24px; }
.rel-toc ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 32px; }
.rel-toc ul { list-style: none; margin: 0; padding: 0; }
/* each entry carries its group's mark in place of a bullet: an arrow for a change, a plus for something new, a check
   for a fix. 16px, in the muted ink, centred on the first line past the item's padding; the text keeps one left edge */
.prose .rel-toc ul { padding-left: 0; }
.prose .rel-toc ul > li { padding-left: 24px; text-wrap: pretty; }
.prose .rel-toc ul > li::before { left: 0; top: calc(4px + 11px - 8px); width: 16px; height: 16px; border-radius: 0; background: var(--mute); -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; transition: background-color 0.2s var(--ease, ease); }
.prose .rel-toc ul > li:hover::before { background: var(--ink); }
.rel-toc-main { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 1 1-1.4-1.4l4.3-4.3H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E"); }
.rel-toc-new { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4a1 1 0 0 1 1 1v6h6a1 1 0 1 1 0 2h-6v6a1 1 0 1 1-2 0v-6H5a1 1 0 1 1 0-2h6V5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E"); }
.rel-toc-fixes { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.7 6.3a1 1 0 0 1 0 1.4l-10 10a1 1 0 0 1-1.4 0l-5-5a1 1 0 1 1 1.4-1.4l4.3 4.3 9.3-9.3a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E"); }
.rel-toc li { break-inside: avoid; margin: 0; padding: 4px 0; font-size: 16px; line-height: 22px; }
.rel-toc li + li { margin-top: 0; }
.rel-toc a { color: var(--soft); text-decoration: none; }
.rel-toc a:hover { color: var(--ink); }
.rel-toc code, .releases .change h3 code { font-size: inherit; font-weight: inherit; padding: 0; background: none; color: inherit; } /* a code name used as a title reads as a title */
.releases .rel-group { margin-top: 40px; }
.releases .rel-group > .rel-label { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.releases .change { padding: 20px 0; border-bottom: 1px solid var(--line); }
.releases .change:last-child { border-bottom: 0; }
.releases .change h3 { margin: 0 0 6px; font-size: 19px; line-height: 25px; font-weight: 500; color: var(--ink); scroll-margin-top: 96px; }
.releases .change h3 .anchor { left: -22px; }
.releases .change p { margin: 0; font-size: 17px; line-height: 27px; color: var(--soft); }
@media (max-width: 760px) { .releases .release { grid-template-columns: minmax(0, 1fr); } .releases .release time { grid-row: auto; position: static; line-height: 20px; } .releases .release h2, .releases .release > :not(header) { grid-column: 1; } }

/* ---------- leaderboard ---------- */
.lb { padding-top: 56px; padding-bottom: 104px; }
.lb-head { display: grid; gap: 14px; max-width: 820px; margin-bottom: 28px; }
.lb-head .lead { margin: 0; }
.lb-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.lb-tabs a { height: 40px; padding: 0 16px; border-radius: 20px; display: inline-flex; align-items: center; background: var(--panel2); color: var(--soft); font-size: 16px; font-weight: 500; }
.lb-tabs a:hover { color: var(--ink); }
.lb-tabs a[aria-current="page"] { background: var(--ink); color: var(--black); }

/* the facts above the table: what it is ranked by, how many, from how many sources */
.lb-facts { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.lb-facts > div { display: grid; gap: 4px; padding: 16px 28px 16px 0; margin-right: 28px; border-right: 1px solid var(--line); }
.lb-facts > div:last-of-type { border-right: 0; }
.lb-facts .label { font-size: 13px; line-height: 16px; }
.lb-facts strong { font-weight: 500; font-size: 17px; line-height: 22px; color: var(--ink); }
.lb-method-link { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--panel2); color: var(--soft); font-size: 15px; font-weight: 500; }
.lb-method-link:hover { color: var(--ink); background: var(--raised); }
.lb-method-link svg { transform: rotate(0deg); }
/* what the columns mean: one term to a line, the term in ink and its meaning beside it */
.lb-terms { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 24px; max-width: 760px; margin: 4px 0 14px; font-size: 15px; line-height: 21px; }
.lb-terms div { display: contents; } /* each term and its meaning line up in two columns, one pair to a row */
.lb-terms dt { flex-shrink: 0; color: var(--ink); font-weight: 500; }
.lb-terms dd { margin: 0; color: var(--mute); font-weight: 400; }
.lb-terms .yn { width: 15px; height: 15px; vertical-align: -3px; }
.lb-terms .yn.yes { color: var(--ink); }
.lb-hint { margin: 0 0 16px; max-width: 900px; line-height: 21px; }
.lb-hint strong { color: var(--soft); font-weight: 500; }
.lb-hint .yn { width: 15px; height: 15px; vertical-align: -3px; }
.lb-hint .yn.yes { color: var(--ink); }
@media (max-width: 760px) {
  .lb-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-tabs a { justify-content: center; padding: 0 10px; font-size: 15px; white-space: nowrap; }
  .lb-facts > div { padding: 12px 0; margin-right: 0; border-right: 0; flex: 1 1 100%; border-bottom: 1px solid var(--line); }
  .lb-facts > div:last-of-type { border-bottom: 0; }
  .lb-method-link { margin: 12px 0; }
}

/* the table: few columns, short headers, one row per entry; a row opens to show everything else */
.lb-table { overflow-x: auto; scrollbar-width: thin; }
.lb-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 20px; }
.lb-grid thead th { padding: 14px 12px; text-align: left; font-weight: 500; font-size: 13px; line-height: 16px; color: var(--mute); white-space: nowrap; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.lb-grid thead button { color: inherit; font: inherit; display: inline-flex; align-items: center; gap: 4px; }
.lb-grid thead button::after { content: "↕"; opacity: 0.4; font-size: 11px; }
.lb-grid thead button[data-dir="asc"]::after { content: "↑"; opacity: 1; }
.lb-grid thead button[data-dir="desc"]::after { content: "↓"; opacity: 1; }
.lb-grid thead button:hover { color: var(--ink); }
.lb-grid thead th.metric button { color: var(--ink); }
.lb-grid .is-num { text-align: right; }
.lb-grid thead .is-num button { flex-direction: row-reverse; }
.lb-grid .is-bool { text-align: center; }
.lb-grid thead .is-bool { white-space: normal; max-width: 84px; }
.lb-grid thead .is-bool button { justify-content: center; text-align: center; }

.lb-grid tbody.entry > tr.main > * { padding: 16px 12px; vertical-align: middle; border-top: 1px solid var(--line); }
.lb-grid tbody.entry:first-of-type > tr.main > * { border-top: 0; }
.lb-grid tr.main { cursor: pointer; transition: background-color 0.15s; }
.lb-grid tr.main:hover { background: rgba(var(--ink-rgb), 0.03); }
.lb-grid tbody.entry.open > tr.main { background: rgba(var(--ink-rgb), 0.04); }
.lb-grid td { color: var(--soft); font-weight: 400; }
.lb-grid .rank { width: 40px; padding-left: 20px !important; color: var(--mute); font-weight: 500; font-size: 15px; }
.lb-grid tbody.entry[data-rank="1"] .rank, .lb-grid tbody.entry[data-rank="2"] .rank, .lb-grid tbody.entry[data-rank="3"] .rank { color: var(--ink); }
.lb-grid th.name { text-align: left; font-weight: 400; min-width: 200px; max-width: 300px; }
.lb-grid .name .n { display: block; font-weight: 500; font-size: 16px; line-height: 21px; color: var(--ink); overflow-wrap: anywhere; }
.lb-grid .name .prov { display: block; font-size: 13px; line-height: 17px; color: var(--mute); margin-top: 2px; }
.lb-grid .name .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.lb-grid .tag { height: 22px; font-size: 12px; padding: 0 8px; background: var(--panel2); color: var(--soft); }
.lb-grid .tag.warn { background: var(--highlight); color: var(--ink); }
.lb-grid .na { color: var(--mute); }
.lb-grid .sep { color: var(--mute); }
.lb-grid .unit { color: var(--mute); }
.lb-grid .clip { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* the ranking score: its value, and a bar on its own scale (0 to 1, 0 to 100, or seven pips) */
.lb-grid td.metric { width: 168px; }
.score { display: grid; gap: 7px; }
.score .v { font-weight: 500; font-size: 17px; line-height: 20px; color: var(--ink); }
.score .of { color: var(--mute); font-weight: 400; font-size: 14px; }
.score .bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; width: 140px; }
.score .bar i { display: block; height: 100%; border-radius: 2px; background: var(--soft); }
.lb-grid tbody.entry[data-rank="1"] .score .bar i { background: var(--ink); }
.pips { display: flex; gap: 4px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.on { background: var(--soft); }
.lb-grid tbody.entry[data-rank="1"] .pips i.on { background: var(--ink); }

.yn { width: 18px; height: 18px; vertical-align: middle; }
.yn.yes { color: var(--ink); }
.yn.no { color: var(--mute); }

/* the row's details */
.lb-grid .more { width: 44px; padding-right: 16px !important; text-align: right; }
.lb-toggle { width: 32px; height: 32px; border-radius: 16px; display: inline-grid; place-items: center; background: var(--panel2); color: var(--soft); transition: background-color 0.2s, color 0.2s; }
.lb-toggle:hover { background: var(--raised); color: var(--ink); }
.lb-toggle svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.lb-toggle[aria-expanded="true"] { background: var(--ink); color: var(--black); }
.lb-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.lb-grid tr.detail > td { padding: 0 16px 22px 72px; background: rgba(var(--ink-rgb), 0.04); }
.detail-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 16px 40px; padding-top: 4px; max-width: 1040px; }
.d-note { grid-column: 1 / -1; margin: 0; max-width: 760px; font-size: 16px; line-height: 25px; color: var(--read); }
.d-fields { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; align-content: start; }
.d-fields div { display: grid; gap: 3px; min-width: 0; }
.d-fields dt { font-size: 13px; line-height: 16px; color: var(--mute); font-weight: 500; }
.d-fields dd { margin: 0; font-size: 15px; line-height: 21px; color: var(--soft); overflow-wrap: anywhere; }
.d-fields .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.d-sources { display: grid; gap: 8px; align-content: start; }
.d-sources ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; line-height: 21px; }
.d-sources li::marker { color: var(--mute); }
.d-sources a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(var(--ink-rgb), 0.3); text-underline-offset: 3px; overflow-wrap: anywhere; }
.d-sources a:hover { text-decoration-color: currentColor; }

.lb-sub { margin: 48px 0 8px; }
.lb-sub-lead { margin: 0 0 16px; max-width: 720px; }

/* phones: each entry becomes a card: rank, name and score first, then the figures two to a row */
@media (max-width: 760px) {
  .lb-table { overflow: visible; }
  .lb-grid, .lb-grid tbody, .lb-grid tr, .lb-grid td, .lb-grid th { display: block; }
  .lb-grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lb-grid tbody.entry { border-top: 1px solid var(--line); }
  .lb-grid tbody.entry:first-of-type { border-top: 0; }
  .lb-grid tr.main { display: flex; flex-wrap: wrap; align-items: center; padding: 16px 16px 12px; }
  .lb-grid tbody.entry > tr.main > * { border-top: 0; padding: 0; }
  .lb-grid .rank { order: 0; width: 32px; padding-left: 0 !important; align-self: flex-start; line-height: 21px; }
  .lb-grid tr.main > th.name { order: 1; }
  .lb-grid tr.main > td.more { order: 2; }
  .lb-grid tr.main > td:not(.rank):not(.more) { order: 3; }
  .lb-grid th.name { flex: 1 1 0; min-width: 0; max-width: none; }
  .lb-grid .more { width: auto; padding-right: 0 !important; align-self: flex-start; }
  .lb-grid td.metric { flex: 1 1 100%; width: auto; padding: 14px 0 8px 32px !important; }
  .lb-grid td.metric::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 13px; color: var(--mute); }
  .score .bar { width: 100%; max-width: 280px; }
  .lb-grid tr.main > td:not(.rank):not(.metric):not(.more) { flex: 0 0 50%; padding: 8px 8px 0 32px; text-align: left; font-size: 15px; }
  .lb-grid tr.main > td:not(.rank):not(.metric):not(.more)::before { content: attr(data-label); display: block; font-size: 12px; line-height: 16px; color: var(--mute); margin-bottom: 2px; }
  .lb-grid tr.main > td.is-bool { display: flex; align-items: center; gap: 8px; }
  .lb-grid tr.main > td.is-bool::before { margin: 0 !important; order: 2; font-size: 14px !important; color: var(--soft) !important; }
  .lb-grid .clip { max-width: 100%; }
  .lb-grid tr.detail > td { padding: 4px 16px 20px 48px; }
  .detail-in { grid-template-columns: 1fr; }
  .d-fields { grid-template-columns: 1fr; }
}

/* below the table: how it's ranked and the caveats in one readable column (a measure of about 65 characters), each note
   led by its first sentence; then the sources in two columns */
.lb-foot { display: grid; gap: 56px; margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.lb-read { max-width: 680px; }
.lb-read .h3, .lb-sources .h3 { margin: 0 0 16px; }
.lb-metric { margin: 0 0 8px; font-size: 18px; line-height: 29px; font-weight: 400; color: var(--soft); text-wrap: pretty; }
.lb-metric strong { color: var(--ink); font-weight: 500; }
.lb-notes { list-style: none; margin: 0; padding: 0; display: grid; }
.lb-notes li { padding: 16px 0; border-top: 1px solid var(--line); font-size: 17px; line-height: 27px; font-weight: 400; color: var(--soft); text-wrap: pretty; }
.lb-notes li:last-child { border-bottom: 1px solid var(--line); }
.lb-notes strong { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 500; }
.lb-sources .small { margin: -8px 0 16px; }
.lb-sources ol { margin: 0; padding-left: 28px; columns: 2 360px; column-gap: 48px; font-size: 16px; line-height: 23px; font-weight: 400; color: var(--soft); }
.lb-sources li { break-inside: avoid; padding: 0 0 12px; }
.lb-sources li::marker { color: var(--mute); font-variant-numeric: tabular-nums; }
.lb-sources li .small { display: block; margin: 2px 0 0; }
.lb-foot a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(var(--ink-rgb), 0.3); text-underline-offset: 3px; overflow-wrap: anywhere; }

/* the leaderboard index: each board's top five with its score */
.lb-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .lb-cards { grid-template-columns: 1fr; } }
.lb-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; transition: background-color 0.25s var(--ease); }
.lb-card:hover { background: var(--panel); }
.lb-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.lb-card li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.lb-card li.lb-card-head { padding: 0 0 8px; border-top: 0; font-size: 13px; color: var(--mute); }
.lb-card li .tabular { color: var(--mute); }
.lb-card li .n { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-card li .s { color: var(--soft); text-align: right; }
.lb-card li.lb-card-head span:last-child { text-align: right; }

/* ---------- the 404: in the site's layout, the compass, one line and the way back, in the middle of the page ---------- */
.lost { min-height: calc(100vh - 260px); display: grid; place-items: center; align-content: center; gap: 22px; text-align: center; padding: 160px var(--g) 96px; max-width: 640px; margin: 0 auto; }
.lost .nf { display: block; width: 160px; height: 160px; margin-bottom: -6px; }
.lost .nf img { width: 100%; height: 100%; }
.lost .lead { text-wrap: balance; color: var(--soft); }
/* the glass icons come twice: as set for the dark theme, and for light with the colour a step deeper */
.t-light, [data-theme="light"] .t-dark { display: none !important; }
[data-theme="light"] .t-light { display: block !important; }
