/* Matchday Insights - easier reading, every page (Greg, 2026-11: "option A").
   One font for everything you read - Inter (on this site it's loaded under
   the name 'JetBrains Mono') - in normal case, at sizes that are easy on a
   phone, with labels no longer tiny and spaced out. Barlow Condensed stays
   for the logo and the big page and section titles only.
   Linked from every page by app_tags.py (after the page's own styles), so a
   change here reaches the whole site without rebuilding any page. */

:root { --mi-read: 'JetBrains Mono', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* iPhones turned sideways blow up the text of some blocks on their own
   ("text autosizing") - on club pages the Upcoming rows without a PREVIEW
   link came out much bigger than the rows with one (Greg, 2026-11: "Font
   changes when preview not available on landscape"). Keep every size as
   written, on every page. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Numbers line up in columns (every digit the same width). */
html body { font-variant-numeric: tabular-nums; }

/* ---- 1. Text set in Barlow Condensed that people read -> Inter ---- */
html body .hero-desc, html body .hero-desc b,
html body .lh p, html body .lh b,
html body .lgt td, html body .lgt td a, html body .me td,
html body .doc p, html body .doc li, html body .doc a, html body .doc strong,
html body .callout p, html body .callout strong,
html body .cta-box p, html body .cp-sub, html body .hub-sub, html body .compare-sub, html body .compare-empty,
html body .mpanel p, html body .mpanel a, html body .mpanel b,
html body .related-link, html body .section summary,
html body #bracket details div, html body #form a, html body .upcoming-row a:not([href*="predictions"]) {
  font-family: var(--mi-read) !important; letter-spacing: 0 !important;
}
html body .hero-desc { font-size: 14px !important; line-height: 1.55 !important; }
html body .lh p { font-size: 13px !important; line-height: 1.55 !important; }
html body .lgt td, html body .me td { font-size: 12.5px !important; }
html body .doc p, html body .doc li, html body .callout p { font-size: 15px !important; line-height: 1.65 !important; }
html body .doc p.lede { font-size: 16.5px !important; }
html body .cta-box p, html body .cp-sub, html body .hub-sub, html body .compare-sub, html body .compare-empty { font-size: 15px !important; line-height: 1.5 !important; }
html body .mpanel p { font-size: 15px !important; line-height: 1.6 !important; }
html body .related-link { font-size: 14px !important; }
html body .section summary { font-size: 14.5px !important; font-weight: 600 !important; }
html body #bracket details div { font-size: 13px !important; }

/* ---- 2. Club names: normal case, never in capitals ---- */
html body .upcoming-row a:not([href*="predictions"]), html body #form a { font-size: 14.5px !important; font-weight: 600 !important; text-transform: none !important; }
html body .panel div[style*="font-size: 9px"] { font-size: 10.5px !important; letter-spacing: .2px !important; }
html body .my-c b { font-family: var(--mi-read) !important; font-size: 14px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important; }
html body .sb-t span { font-family: var(--mi-read) !important; font-size: 17px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: -.1px !important; }
html body .motw-nm { font-family: var(--mi-read) !important; font-size: 20px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: -.2px !important; line-height: 1.2 !important; }
html body .top-club, html body .top-club a { text-transform: none !important; }
html body .nav-club b { font-family: var(--mi-read) !important; font-size: 16px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important; }

/* ---- 3. Tabs and section headers: Inter, normal case ---- */
html body .days button.day, html body .day b,
html body .club-tabs button.club-tab, html body .mtabs button {
  font-family: var(--mi-read) !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 600 !important;
}
html body .days button.day { font-size: 14px !important; }
html body .day b { font-size: 13px !important; }
html body .club-tabs button.club-tab, html body .mtabs button { font-size: 15px !important; }
html body .cont-h b { font-family: var(--mi-read) !important; font-size: 14px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important; }
html body .section h2, html body .doc h2, html body .panel-title, html body .chart-title-text {
  font-size: 15px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--text) !important;
}

/* ---- 4. Small labels: a readable size, normal case, no wide spacing ---- */
html body th, html body .featured-title, html body .hstat-label, html body .stat-label,
html body .my-h, html body .myp-add-h, html body .motw-lab, html body .record span, html body .g span,
html body .sb-meta, html body .sb-st span, html body .rank-in, html body .club-rank,
html body .hero-eyebrow, html body .cp-ey, html body .hub-ey {
  text-transform: none !important; letter-spacing: .1px !important;
}
html body th { font-size: 11.5px !important; font-weight: 600 !important; }
html body .featured-title, html body .my-h, html body .myp-add-h, html body .motw-lab { font-size: 12.5px !important; font-weight: 600 !important; }
html body .hstat-label, html body .stat-label, html body .record span, html body .g span { font-size: 11.5px !important; }
html body .hero-eyebrow, html body .cp-ey, html body .hub-ey { font-size: 12px !important; }
html body .sb-meta, html body .sb-st span { font-size: 12px !important; }
html body .rank-in { font-size: 10px !important; }
html body .club-rank, html body .club-rank span { font-size: 14px !important; letter-spacing: 0 !important; text-transform: none !important; }

/* ---- 5. Nothing tiny: the smallest text goes up to 11-12px ---- */
html body .record-row-note { font-size: 10.5px !important; letter-spacing: 0 !important; }
html body .fmatch-meta { font-size: 11px !important; letter-spacing: 0 !important; }
html body .day span, html body .day small { font-size: 10.5px !important; letter-spacing: 0 !important; }
html body .comp-h a, html body .lt-key span { font-size: 10.5px !important; }
html body .top-club-rank, html body .rank-world, html body .sx .rk, html body .fmatch-rank { font-size: 11px !important; }
html body .club-code { font-size: 11.5px !important; }
html body .fmatch-pcts span { font-size: 11px !important; }
html body .mc-nm small, html body .odds .dr, html body .lm-o .dr { font-size: 11.5px !important; }
html body .mc-top span { font-size: 11.5px !important; letter-spacing: 0 !important; text-transform: none !important; }
html body .hero-link { font-size: 12px !important; letter-spacing: 0 !important; }
html body .tools button, html body .tools .count, html body .cont-h span, html body .hub-legend span, html body .panel span { font-size: 11.5px !important; }
html body .lt-sub, html body .ratings-h span, html body .motw-p span { font-size: 11px !important; letter-spacing: 0 !important; }
html body .mx p.key { font-size: 11.5px !important; line-height: 1.5 !important; }
html body .mc-f span.tag, html body .motw-go span.tag { letter-spacing: 0 !important; text-transform: none !important; font-size: 11px !important; }

/* Search boxes and drop-downs in the same reading font. */
html body input, html body select, html body textarea { font-family: var(--mi-read) !important; letter-spacing: 0 !important; }

/* Matches page on phones: a live rank move ("#2740→#2669") and the rating
   change no longer run off the edge - the change drops under the rank
   when they don't fit side by side. */
@media (max-width:640px){
  html body .m .side .sx{flex-wrap:wrap!important;column-gap:6px!important;row-gap:0!important;max-width:100%}
  html body .m .side.h .sx{justify-content:flex-end!important}
  html body .m .side .sx .rk{font-size:10.5px!important;white-space:nowrap}
  html body .m .side .sx .dl{font-size:11px!important;white-space:nowrap}
}

/* League tables on match pages fit a phone (no sideways scrolling): fixed
   column widths, and a long club name is shortened with "..." instead of
   widening the table. */
html body .mt td.cl { font-family: var(--mi-read) !important; font-size: 14px !important; font-weight: 600 !important; letter-spacing: 0 !important; }
@media (max-width:640px){
  html body .mt-scroll { overflow-x: visible !important; }
  html body table.mt { table-layout: fixed !important; width: 100% !important; }
  html body table.mt tr:first-child th:nth-child(1) { width: 38px; }
  html body table.mt tr:first-child th:nth-child(2) { width: auto; }
  html body table.mt tr:first-child th:nth-child(3) { width: 28px; }
  html body table.mt tr:first-child th.opt { width: 24px; }
  html body table.mt tr:first-child th:nth-last-child(2) { width: 36px; }
  html body table.mt tr:first-child th:last-child { width: 36px; }
  html body table.mt td.cl { max-width: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width:640px){ html body table.mt { min-width: 0 !important; } }

/* ---- Buttons and drop-downs that stand out (Greg, 2026-11) ------------
   The links under a page's title ("League & country rankings", "National
   team rankings"...) as green pills, and the drop-downs (continent, country,
   ranks, "Biggest upcoming matches", national teams) rounded with a thin
   arrow instead of the browser's own box. Both follow light and dark. */
html body .hero .hero-link, html body .hero-links .hero-link, html body .hero-link {
  display: inline-flex !important; align-items: center; gap: 6px;
  font-family: var(--mi-read, Inter, system-ui, sans-serif) !important;
  font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0 !important;
  color: var(--green) !important; background: rgba(61, 186, 94, .13) !important;
  border: 1.5px solid var(--green) !important; border-radius: 999px !important;
  padding: 8px 15px !important; text-decoration: none !important; line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  transition: background .15s, transform .15s, box-shadow .15s;
}
html body .hero-link:hover { background: rgba(61, 186, 94, .24) !important; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(61, 186, 94, .22); }
html body .hero-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (max-width: 640px) {
  html body .hero .hero-link, html body .hero-links .hero-link { font-size: 12.5px !important; padding: 7px 13px !important; }
  html body .hero-links { gap: 8px !important; padding-bottom: 2px; }
}

html body select.filter-select, html body select.featured-select, html body select#nt-conf {
  -webkit-appearance: none !important; appearance: none !important;
  font-family: var(--mi-read, Inter, system-ui, sans-serif) !important; font-size: 13px !important; font-weight: 600 !important;
  letter-spacing: 0 !important; line-height: 1.25 !important;
  color: var(--text) !important; background-color: var(--surface2, #161b26) !important;
  border: 1px solid var(--border2) !important; border-radius: 10px !important;
  padding: 9px 36px 9px 13px !important; min-height: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238c93ad' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 13px center !important; background-size: 12px 8px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14); outline: none; color-scheme: dark;
  transition: border-color .15s, box-shadow .15s;
}
html body select.filter-select:hover, html body select.featured-select:hover, html body select#nt-conf:hover { border-color: var(--green-dim, var(--green)) !important; }
html body select.filter-select:focus-visible, html body select.featured-select:focus-visible, html body select#nt-conf:focus-visible {
  border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(61, 186, 94, .22);
}
/* The list that opens follows the page's light/dark (it was always dark). */
html[data-theme="light"] body select.filter-select, html[data-theme="light"] body select.featured-select, html[data-theme="light"] body select#nt-conf { color-scheme: light; }
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) body select.filter-select, html:not([data-theme="dark"]) body select.featured-select, html:not([data-theme="dark"]) body select#nt-conf { color-scheme: light; }
}
/* Line-up names that link to a player page (live_tags.py, Greg 2026-11):
   the text colour, a faint underline, green on hover. */
.mf .lus a{color:inherit;text-decoration:none;border-bottom:1px solid var(--border2)}
.mf .lus a:hover{color:var(--green);border-color:var(--green)}

/* ---- Rankings on phones: one row per club (Greg, 2026-11: "smaller font
   ... like fotmob ... the info on one row instead of two"). Rank + arrow,
   flag, name + country code, rating + change, all on one line - about 14
   clubs on a screen instead of 8. Only the world ranking's rows (a
   .td-rank without .local, with an up/down arrow); league pages' local +
   world rank and the Leagues page stay as they are (Greg, 2026-11:
   "Leagues page got messed up"). The "#1 since" / record notes are left out here - the green or red
   box round the rank still marks a record. ---- */
@media (max-width: 640px) {
  html body .table-wrap tbody tr:has(> td.td-rank > .m-mv) { height: 46px; }
  html body .table-wrap tbody tr:has(> td.td-rank > .m-mv) > td { padding-top: 0 !important; padding-bottom: 0 !important; vertical-align: middle; }
  html body .table-wrap td.td-rank:has(> .m-mv) { width: 44px !important; text-align: left !important; padding-left: 12px !important; white-space: nowrap; font-size: 12.5px !important; font-weight: 600 !important; }
  html body .table-wrap td.td-rank:has(> .m-mv) .record-box-green,
  html body .table-wrap td.td-rank:has(> .m-mv) .record-box-red { padding: 0 4px; }
  html body .table-wrap td.td-rank:has(> .m-mv) .m-mv { display: inline !important; margin: 0 0 0 4px !important; }
  html body .table-wrap td.td-rank:has(> .m-mv) .m-mv .move-badge { font-size: 9.5px; vertical-align: 1px; }
  html body .table-wrap td.td-rank:has(> .m-mv) .m-mv .move-badge.nc { display: none; }
  /* A confederation picked: the cell is .local ("1", "#71 world", arrow) -
     the same one-row look, the continent rank + arrow; "#71 world" goes
     (Greg, 2026-11: "when filtering for a confederation it reverts back to
     the old font type that sometimes requires a scroll"). League pages'
     .local cells have no arrow, so they keep their own layout. */
  html body .table-wrap td.td-rank.local:has(> .m-mv) .rank-world { display: none !important; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .td-club { padding-left: 2px !important; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .club-cell { gap: 9px; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .club-cell .country-badge { min-width: 18px; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .club-cell > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .club-name-text { font-size: 13px !important; font-weight: 600 !important; min-width: 0; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .club-code { font-size: 10px !important; color: var(--muted) !important; margin: 0 !important; flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The club column takes what's left and long words shrink to "...", so the
     rating always fits on screen - league pages show the league's full name
     there ("Liga Profesional Argentina") and pushed the rating off the side
     (Greg, 2026-11: "you have to scroll to see the rating"). */
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .td-club { width: 100%; max-width: 0; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .club-cell { min-width: 0; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .club-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .record-row-note { display: none !important; }
  /* min-width keeps the rating and its change on one line now the club column
     takes the rest; padding keeps them off the screen's edge (Greg, 2026-11:
     "move the ratings slightly to the left"). */
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .td-elo { width: 140px !important; min-width: 140px !important; padding-right: 16px !important; box-sizing: border-box; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .elo-cell { flex-direction: row !important; align-items: center !important; justify-content: flex-end; gap: 8px !important; }
  /* The live line ("LIVE -11.7 → #2") goes under the rating, wrapping if it must -
     on one line it made the table wider than the phone (Greg, 2026-11). */
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .elo-cell { flex-wrap: wrap !important; row-gap: 2px !important; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .elo-cell > :not(.row-lr) { white-space: nowrap; }
  html body .table-wrap:has(td.td-rank > .m-mv) thead th:last-child { padding-right: 16px !important; }
  /* The heading sits over the rating, not the change: 16px edge + 38px
     change slot + 8px gap (Greg, 2026-11: "Elos not lining up" - th:last-
     child was the hidden Change heading, so "Elo" sat at the screen edge). */
  html body .table-wrap:has(td.td-rank > .m-mv) thead th[data-col="elo"] { text-align: right !important; padding-right: 62px !important; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .row-lr { flex: 0 0 100%; order: 9; margin-top: 0; text-align: right; white-space: normal; font-size: 10px; line-height: 1.25; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .elo-number { font-size: 12.5px !important; font-weight: 600 !important; }
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .m-chg { display: block !important; flex: none; width: 38px; text-align: right; }
  /* The change as plain coloured text, no box - calmer (Greg, 2026-11: picked
     "B" from a mock-up: "I don't want it looking too crowded"). */
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .m-chg .change-pill { font-size: 11px !important; font-weight: 600 !important; min-width: 38px; display: inline-block; text-align: right; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; font-variant-numeric: tabular-nums; }
  /* Straight columns (Greg, 2026-11: "align it, it's not straight"): the change
     sits in a fixed 38px slot and every digit is the same width, so ratings
     and changes line up down the table. */
  html body .table-wrap tr:has(> td.td-rank > .m-mv) .elo-number { font-variant-numeric: tabular-nums; text-align: right; }
}

/* ---- Light mode a little whiter (Greg, 2026-11): the page background was
   a warm off-white (#f5f6f2) with greenish-grey lines; now a plain near-white
   with neutral grey lines, and the top-10 rows no longer tinted green (the
   top 3 keep a faint green). Cards and rows were already white. Both ways of
   getting light mode: the phone's setting and the button. ---- */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) { --bg: #fbfbfb; --border: #ebebeb; --border2: #e0e0e0; }
  html:not([data-theme="dark"]) .hero { background: linear-gradient(180deg, #ffffff, #fbfbfb) !important; }
  html:not([data-theme="dark"]) tbody tr { border-bottom-color: #eeeeee !important; }
  html:not([data-theme="dark"]) thead tr { background: #fcfcfc; }
  html:not([data-theme="dark"]) .elo-bar { background: #ebebeb !important; }
  html:not([data-theme="dark"]) .comp-h { background: #fcfcfc !important; }
  html:not([data-theme="dark"]) tbody tr.top3 { background: #f4faf6 !important; }
  html:not([data-theme="dark"]) tbody tr.top10 { background: #ffffff !important; }
}
html[data-theme="light"] { --bg: #fbfbfb; --border: #ebebeb; --border2: #e0e0e0; }
html[data-theme="light"] .hero { background: linear-gradient(180deg, #ffffff, #fbfbfb) !important; }
html[data-theme="light"] tbody tr { border-bottom-color: #eeeeee !important; }
html[data-theme="light"] thead tr { background: #fcfcfc; }
html[data-theme="light"] .elo-bar { background: #ebebeb !important; }
html[data-theme="light"] .comp-h { background: #fcfcfc !important; }
html[data-theme="light"] tbody tr.top3 { background: #f4faf6 !important; }
html[data-theme="light"] tbody tr.top10 { background: #ffffff !important; }

/* ---- Matches on phones: two short lines a match, like the rankings
   (Greg, 2026-11: "I don't like the draw % below the chart ... minimize
   the height of everything"). Line 1: name, crest, time or score, crest,
   name. Line 2: each side's rank (and rating change) at the ends, our
   chances in the middle - the three numbers on one line (home left, draw
   middle, away right) over a thin bar; no separate "draw 30%" line. A fat
   bar with the numbers inside was tried and dropped (Greg, 2026-11: "I
   don't like the look of the fat bar"). The .op line comes from
   generate_matches_page; an older page shows just the thin bar. ---- */
@media (max-width: 640px) {
  html body :is(.comp, .mi-top, .my-box) .m {
    grid-template-columns: minmax(0,1fr) 22px 78px 22px minmax(0,1fr) !important;
    grid-template-areas: "hn hc mid ac an" "hx ob ob ob ax" "up up up up up";
    column-gap: 6px !important; row-gap: 4px; padding: 8px 12px !important; align-items: center;
  }
  html body :is(.comp, .mi-top, .my-box) .m .side { display: contents !important; }
  html body :is(.comp, .mi-top, .my-box) .m .side .nm {
    font-size: 13px !important; font-weight: 500 !important; letter-spacing: 0 !important; line-height: 1.2 !important;
    display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2 !important;
    white-space: normal !important; overflow: hidden; min-width: 0; max-width: 100%;
  }
  html body :is(.comp, .mi-top, .my-box) .m .side .nm.lost { font-weight: 400 !important; }
  html body :is(.comp, .mi-top, .my-box) .m:has(.nm.lost) .side .nm:not(.lost) { font-weight: 650 !important; }
  html body :is(.comp, .mi-top, .my-box) .m .side.h .nm { grid-area: hn; justify-self: end; text-align: right; }
  html body :is(.comp, .mi-top, .my-box) .m .side:not(.h) .nm { grid-area: an; justify-self: start; text-align: left; }
  html body :is(.comp, .mi-top, .my-box) .m .side .crest { width: 20px; height: 20px; justify-self: center; }
  html body :is(.comp, .mi-top, .my-box) .m .side .crest.fi { width: 20px; height: 15px; border-radius: 2px; background-size: cover; }
  html body :is(.comp, .mi-top, .my-box) .m .side.h .crest { grid-area: hc; }
  html body :is(.comp, .mi-top, .my-box) .m .side:not(.h) .crest { grid-area: ac; }
  html body :is(.comp, .mi-top, .my-box) .m .mid { grid-area: mid; }
  html body :is(.comp, .mi-top, .my-box) .m .side .sx { display: flex !important; gap: 5px; align-items: center; min-width: 0; }
  html body :is(.comp, .mi-top, .my-box) .m .side.h .sx { grid-area: hx; justify-self: end; }
  html body :is(.comp, .mi-top, .my-box) .m .side:not(.h) .sx { grid-area: ax; justify-self: start; }
  html body :is(.comp, .mi-top, .my-box) .m .side .sx .rk { display: inline !important; font-size: 10px !important; }
  html body :is(.comp, .mi-top, .my-box) .m .side .sx .dl { font-size: 10px !important; }
  html body :is(.comp, .mi-top, .my-box) .m .ko { font-size: 12px !important; font-weight: 500; }
  html body :is(.comp, .mi-top, .my-box) .m .sc { font-size: 19px !important; }
  html body :is(.comp, .mi-top, .my-box) .m .mid .x { font-size: 9px !important; margin-top: 0; }
  html body :is(.comp, .mi-top, .my-box) .m .odds { grid-area: ob !important; display: block !important; width: 100%; margin: 0 !important; }
  html body :is(.comp, .mi-top, .my-box) .m .odds .pc, html body :is(.comp, .mi-top, .my-box) .m .odds .dr { display: none !important; }
  html body :is(.comp, .mi-top, .my-box) .m .odds .op { display: flex !important; justify-content: space-between; margin-bottom: 3px; line-height: 1; }
  html body :is(.comp, .mi-top, .my-box) .m .odds .op b { font-size: 10px; font-weight: 700; color: var(--text2); }
  html body :is(.comp, .mi-top, .my-box) .m .odds .op b:first-child { color: #2e9e4f; }
  html body :is(.comp, .mi-top, .my-box) .m .odds .op b:last-child { color: #e5484d; }
  html body :is(.comp, .mi-top, .my-box) .m .odds .bar { height: 4px; border-radius: 2px; }
  html body :is(.comp, .mi-top, .my-box) .m .up { grid-area: up !important; margin: 0 !important; }
  /* Results (no chances bar): the score and crests sit across both lines,
     rank and rating change straight under each name. */
  html body :is(.comp, .mi-top, .my-box) .m:not(:has(.odds)) { grid-template-areas: "hn hc mid ac an" "hx hc mid ac ax" "up up up up up"; row-gap: 1px; }
  html body :is(.comp, .mi-top, .my-box) .m:not(:has(.odds)) .side .nm { align-self: end; }
  html body :is(.comp, .mi-top, .my-box) .m:not(:has(.odds)) .side .sx { align-self: start; }
  html body .comp .comp-n { font-size: 13.5px !important; }
}
@media (max-width: 640px) {
  html body :is(.comp, .mi-top, .my-box) .m .md { grid-column: 1 / -1 !important; grid-row: auto; }
}

/* ---- Club pages on phones: the important things on the first screen
   (2026-11, Greg's pick from a list of ideas). A smaller header, the
   written summary cut to three lines (it's all still in the page for
   Google), then the rating chart and the next matches straight after the
   tabs; the stat cards and the rest follow. Order only - nothing removed. ---- */
@media (max-width: 640px) {
  html body .club-page .back-to-rankings { display: none; }
  html body .club-header { padding: 12px 14px 14px !important; }
  html body .club-header .club-crest { width: 48px !important; height: 48px !important; }
  html body .club-header .club-name { font-size: 28px !important; line-height: 1.05 !important; }
  html body .club-header .club-meta, html body .club-header .club-meta a { font-size: 12.5px !important; }
  html body .club-header .club-rank, html body .club-header .club-rank span { font-size: 13px !important; }
  html body .club-header .star { font-size: 12px !important; padding: 5px 10px !important; min-height: 0 !important; }
  html body p.club-summary { font-size: 13.5px !important; line-height: 1.5 !important; margin: 10px 0 !important;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  html body p.club-summary { cursor: pointer; }
  html body p.club-summary.open { -webkit-line-clamp: unset; }
  html body .club-tab { padding-top: 8px !important; padding-bottom: 8px !important; }
  html body #tab-overview:not([hidden]) { display: flex; flex-direction: column; }
  html body #tab-overview > * { order: 10; }
  html body #tab-overview > .charts-grid { display: contents; }
  html body #tab-overview > .charts-grid > .chart-panel:first-child { order: 1; margin-top: 4px; }
  html body #tab-overview > #upcoming-panel { order: 2; }
  html body #tab-overview > #form { order: 3; }
  /* The section links go back to the top of the Overview, where they stay as
     you scroll - the re-ordering had left them halfway down the page (Greg,
     2026-11: "the tabs on the club page are down by the middle"). */
  html body #tab-overview > .pg-jump { order: 0; }
  html body #tab-overview > .charts-grid > .chart-panel:not(:first-child) { order: 11; }
}

/* World map page (best-club-in-every-country): the club card and the zoom
   buttons were always dark, so in light mode the text was dark on dark
   (Greg, 2026-11). They follow light/dark now; generate_map_page does the
   same from its next rebuild. */
html body .mapwrap .card, html body .mapwrap .zoomb button {
  background: var(--surface2, #161b26) !important; color: var(--text, #dde0ec) !important; }
html body .mapwrap .card b { color: var(--text, #fff) !important; }

/* Phones: the bottom tab bar sits inside the top header. The header was
   "sticky", and on iPhones a sticky header can drift while the page is
   scrolled - taking the tab bar with it, which then floated up to the
   middle of the screen with the header gone off the top (Greg, 2026-11).
   A header fixed to the top doesn't drift, so the bar stays at the bottom.
   The page starts 46px lower to make room for it, as before. */
@media (max-width: 640px) {
  html body .site-nav { position: fixed !important; top: 0; left: 0; right: 0; }
  html body { padding-top: 46px; }
  html { scroll-padding-top: 54px; }
}
/* The bar still floated up mid-screen while scrolling a confederation's
   ranking (Greg, 2026-11). Those rows were wider than the phone (a "LIVE"
   line ran off the right edge), and a page that can slide sideways makes
   iPhones misplace fixed bars. The page itself never slides sideways now
   (tables keep their own sideways scroll), and the bar gets its own layer
   so it is redrawn in place. A transform on .site-nav itself would pin
   the bar to the header, so only the bar gets one. */
@media (max-width: 640px) {
  html, html body { overflow-x: clip; }
  html body .site-nav .header-right { -webkit-transform: translateZ(0); transform: translateZ(0); }
}

/* Lighter type across the site (Greg, 2026-11: "I like the font change.
   Build it throughout"): team names regular, the winner semi-bold, the
   loser a touch lighter, scores not heavy. Same rule as the competition
   pages. */
html body .m .nm{font-weight:500}
html body .m .nm.lost{font-weight:400}
html body .m:has(.nm.lost) .nm:not(.lost){font-weight:650}
.m .sc{font-weight:600}
.fmatch-name{font-weight:500}
.am-opp{font-weight:500}

/* The store apps (html.mi-store, app_install.js - Greg, 2026-11): the same
   as the installed app's "@media (display-mode: standalone)" rules in
   app_tags.py, for wrappers that don't count as standalone (the iPhone one).
   Keep the two alike. */
@media (max-width:640px){html.mi-store body .site-nav .header-right{padding-bottom:max(env(safe-area-inset-bottom),10px)!important}
html.mi-store body{padding-bottom:calc(60px + max(env(safe-area-inset-bottom),10px))}}
html.mi-store .mx-head,html.mi-store .mx .key{display:none!important}
html.mi-store .hub-hero .hub-ey,html.mi-store .hub-hero .hub-h1,html.mi-store .hub-hero .hub-sub{display:none!important}
html.mi-store body .hub-hero{padding:12px 0 4px!important}
html.mi-store body .hub-hero .hub-legend{margin-top:0!important}
html.mi-store .compare-page .back-to-rankings,html.mi-store .compare-page .compare-title,html.mi-store .compare-page .compare-sub{display:none!important}
html.mi-store body .compare-page{padding-top:14px!important}
html.mi-store-tab .hero .hero-eyebrow,html.mi-store-tab .hero .hero-title,html.mi-store-tab .hero .hero-desc,html.mi-store-tab .hero .hero-stats,html.mi-store-tab .hero::after{display:none!important}
html.mi-store-tab body .hero{padding:10px 14px 2px!important;min-height:0!important}
html.mi-store-tab body .hero .hero-links{margin:0 0 6px!important}
html.mi-store-tab body .hero>.hero-link{margin:0 6px 8px 0!important}
html.mi-store-tab body .table-wrap~.hero .hero-eyebrow{display:block!important}

/* "Our odds · N matches left" line was cut off top and bottom on league
   pages (pulled up under the key, Greg 2026-11) - room above and a full
   line height. */
html body .cp-odds{margin-top:12px}
html body .cp-oh{line-height:1.5;padding:2px 0;margin:0 0 6px;position:relative;z-index:1;overflow:visible}

/* ---- Match reports and league round-ups (match_recap.py, Greg 2026-11) ---- */
html body .mr-box { margin: 14px 0 16px; padding: 14px 16px; border: 1px solid var(--border2, rgba(128,128,128,.25)); border-radius: 12px; background: var(--surface2, transparent); }
html body .mr-h { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; }
html body .mr-box p { font-family: var(--mi-read); font-size: 14.5px; line-height: 1.6; margin: 0 0 8px; color: var(--text); }
html body .mr-box p b { font-weight: 650; }
html body .mr-src { font-family: var(--mi-read); font-size: 11.5px; color: var(--muted, #7880a0); margin-top: 4px; }
html body .rr .rr-lines { margin: 4px 0 12px; padding-left: 18px; font-family: var(--mi-read); font-size: 14px; line-height: 1.6; }
html body .rr .rr-lines b { font-weight: 650; }
html body .rr-list { display: grid; gap: 0; }
html body .rr-row { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(128,128,128,.16); font-family: var(--mi-read); font-size: 14px; }
html body .rr-t { font-weight: 400; overflow-wrap: anywhere; }
html body .rr-t.h { text-align: right; }
html body .rr-t.w { font-weight: 650; }
html body .rr-s { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
html body .rr-s a { color: var(--green, #3dba5e); text-decoration: none; }
