/* PRS Central design system. Tokens first; every page uses only these.
   Fonts: Archivo (OFL), Squada One (OFL, the lettering of PRS's division badges), JetBrains Mono (OFL). */
@font-face { font-family: "Archivo"; src: url("/static/fonts/Archivo-Variable.ttf") format("truetype"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Squada One"; src: url("/static/fonts/SquadaOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/JetBrainsMono-Variable.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: dark;
  --page: #0b0d10; --panel: #13161b; --raised: #1a1e25; --line: #262b33; --line-strong: #353c46;
  --text: #f2f4f7; --dim: #b0b8c3; --muted: #7c8592;
  --accent: #4f8cff; --accent-ink: #0b0d10; --pitch: #1f8a4c;
  --ok: #37c27a; --warn: #f2b33d; --danger: #f0566e;
  --guru: #ff66cc; --officials: #37c27a; --staff: #d9b24c; --media: #9a6bff; --tools: #f0a23b; --ai: #3fd0e0; --tracker: #4f8cff;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --radius: 3px; --wide: 1240px; --read: 680px;
  --font: "Archivo", system-ui, "Segoe UI", sans-serif;
  --display: "Archivo", system-ui, sans-serif;
  --badge: "Squada One", "Archivo", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root { color-scheme: light; --page: #f4f5f7; --panel: #ffffff; --raised: #ffffff; --line: #dde1e6; --line-strong: #c6ccd4;
          --text: #12151a; --dim: #46505c; --muted: #6a7480; --accent: #2563eb; --accent-ink: #ffffff; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--s4); top: var(--s4); background: var(--text); color: var(--page); padding: var(--s2) var(--s3); z-index: 10; }

/* ------------------------------------------------------------- shell */
.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: var(--wide); margin: 0 auto; padding: 0 var(--s5); height: 60px; display: flex; align-items: center; gap: var(--s5); }
.mark { display: flex; align-items: center; gap: var(--s2); text-decoration: none; font-family: var(--badge); font-size: 24px; letter-spacing: .04em; line-height: 1; }
.mark small { font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: var(--s5); flex: 1; }
.nav a { text-decoration: none; color: var(--dim); font-weight: 500; font-size: 14px; padding: var(--s2) 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.account { display: flex; align-items: center; gap: var(--s4); }
.account form { margin: 0; }
.menu-toggle { display: none; }
main { flex: 1; width: 100%; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--s5); }
.page { padding-top: var(--s7); padding-bottom: var(--s8); }
.read { max-width: var(--read); }
footer.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-in { max-width: var(--wide); margin: 0 auto; padding: var(--s6) var(--s5); display: flex; flex-wrap: wrap; gap: var(--s5); justify-content: space-between; }
.foot-in nav { display: flex; gap: var(--s4); flex-wrap: wrap; }
.foot-in a { text-decoration: none; }
.foot-in a:hover { color: var(--text); }

/* ------------------------------------------------------------- type */
h1, h2, h3 { font-family: var(--display); margin: 0; }
h1 { font-size: 40px; line-height: 1.05; font-weight: 800; font-stretch: 85%; letter-spacing: -.01em; }
h2 { font-size: 26px; line-height: 1.15; font-weight: 750; font-stretch: 88%; }
h3 { font-size: 17px; line-height: 1.25; font-weight: 700; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
.lede { font-size: 18px; color: var(--dim); max-width: 58ch; margin: var(--s4) 0 0; }
.dim { color: var(--dim); } .muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.prose p, .prose li { color: var(--dim); max-width: 68ch; }
.prose h2 { margin: var(--s6) 0 var(--s3); font-size: 22px; }
.prose h3 { margin: var(--s5) 0 var(--s2); }
.section { padding: var(--s8) 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head a { color: var(--dim); font-size: 14px; text-decoration: none; }
.section-head a:hover { color: var(--text); }

/* ------------------------------------------------------------- controls */
.button, button { display: inline-flex; align-items: center; gap: var(--s2); padding: 10px var(--s4); border-radius: var(--radius); border: 1px solid var(--text); background: var(--text); color: var(--page); font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover, button:hover { filter: brightness(.92); }
.button.secondary, button.secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.button.secondary:hover, button.secondary:hover { border-color: var(--text); filter: none; }
.button.small, button.small { padding: 6px var(--s3); font-size: 13px; }
button.quiet { background: none; border-color: transparent; color: var(--dim); font-weight: 500; padding: 0; }
button.quiet:hover { color: var(--text); }
button.danger { background: none; border-color: var(--danger); color: var(--danger); }
label { display: block; color: var(--dim); font-size: 13px; font-weight: 600; margin-bottom: var(--s1); }
.field { margin-bottom: var(--s4); }
.help { color: var(--muted); font-size: 13px; margin-top: var(--s1); }
input, select, textarea { font: 15px/1.4 var(--font); color: var(--text); background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px var(--s3); width: 100%; }
textarea { min-height: 240px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
form.inline { display: flex; gap: var(--s2); align-items: end; flex-wrap: wrap; }
form.inline input { width: 260px; max-width: 100%; }
form.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin: 0; }
form.row select { width: auto; }
.quiet-link { color: var(--dim); margin-left: var(--s3); }

/* ------------------------------------------------------------- notices and pills */
.notice { padding: var(--s3) var(--s4); border-radius: var(--radius); border: 1px solid var(--line); border-left-width: 3px; background: var(--panel); margin: var(--s4) 0; }
.notice.ok { border-left-color: var(--ok); }
.notice.bad { border-left-color: var(--danger); }
.notice.info { border-left-color: var(--accent); }
.notice.warn { border-left-color: var(--warn); }

/* a game's officials, with a remove control, and the form that adds one */
.crew-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.crew-row form { margin: 0; flex: none; }
.assign-form { display: grid; gap: var(--s2); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.assign-form label { font-size: 13px; font-weight: 600; color: var(--dim); }
.assign-form select { width: 100%; }
.assign-form button { justify-self: start; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px var(--s2); border-radius: 999px; border: 1px solid var(--line-strong); color: var(--dim); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.off { color: var(--muted); }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
.table-wrap table { border: 0; }
table:not(.table-wrap table) { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: 10px var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- home: hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(900px 400px at -10% 120%, color-mix(in srgb, var(--pitch) 26%, transparent), transparent 60%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background: repeating-linear-gradient(90deg, transparent 0 119px, color-mix(in srgb, var(--line) 60%, transparent) 119px 120px); mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); }
.hero .wrap { position: relative; padding-top: var(--s9); padding-bottom: var(--s8); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s7); align-items: end; }
.hero h1 { font-size: clamp(44px, 7vw, 84px); font-stretch: 75%; font-weight: 850; text-transform: uppercase; letter-spacing: -.01em; line-height: .92; }
.hero h1 span { display: block; color: var(--accent); }
.hero .actions { display: flex; gap: var(--s3); margin-top: var(--s6); flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 80%, transparent); }
.fact { padding: var(--s4) var(--s5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact:nth-child(2n) { border-right: 0; }
.fact:nth-last-child(-n+2) { border-bottom: 0; }
.fact b { display: block; font-family: var(--badge); font-size: 40px; line-height: 1; font-weight: 400; letter-spacing: .02em; }
.fact span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-top: var(--s2); }

/* ------------------------------------------------------------- leagues */
.leagues { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
.league { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.league-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--line); min-height: 72px; }
.league-head img { width: 36px; height: 36px; object-fit: contain; }
.light-badge { background: #fff; border-radius: 6px; padding: 3px; }
.league-head h3 { font-size: 15px; }
.league-head small { display: block; color: var(--muted); font-size: 12px; }
.clubs { list-style: none; margin: 0; padding: var(--s2) 0; }
.clubs li { display: flex; align-items: center; gap: var(--s3); padding: 7px var(--s4); font-size: 14px; }
.clubs li:hover { background: var(--raised); }
.crest { width: 22px; height: 22px; object-fit: contain; flex: none; }
.crest.lg { width: 40px; height: 40px; }
@media (prefers-color-scheme: dark) { .crest { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55)); } }
.code { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------- fixtures */
.gw-tabs { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.gw-tabs a { text-decoration: none; padding: 6px var(--s3); border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; color: var(--dim); }
.gw-tabs a[aria-current="true"] { background: var(--text); color: var(--page); border-color: var(--text); }
.fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--s3); }
.fixture { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); }
.fixture .side { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.fixture .side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.fixture .side.away { flex-direction: row-reverse; text-align: right; }
.fixture .vs { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; }
.fixture .vs b { display: block; font-family: var(--font); font-size: 11px; letter-spacing: .08em; color: var(--dim); }
.lg-PL { border-left-color: #8b5cf6; } .lg-BL { border-left-color: #ef4444; } .lg-LL { border-left-color: #f97316; }
.lg-SA { border-left-color: #22d3ee; } .lg-L1 { border-left-color: #a3e635; }

/* ------------------------------------------------------------- tiles (products, departments, launcher) */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tile, var(--accent)); }
.tile > a, .tile > div { display: flex; flex-direction: column; gap: var(--s2); height: 100%; padding: var(--s5); text-decoration: none; }
.tile > a:hover { background: var(--raised); }
.tile strong { font-size: 18px; font-weight: 750; font-stretch: 90%; }
.tile p { margin: 0; color: var(--dim); font-size: 14px; }
.tile .meta { margin-top: auto; padding-top: var(--s3); display: flex; gap: var(--s4); flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.tile .meta b { color: var(--text); font-family: var(--badge); font-size: 20px; font-weight: 400; display: block; }
.tile.soon { opacity: .75; }
.tile em { font-style: normal; font-size: 12px; color: var(--muted); }
.accent-guru { --tile: var(--guru); } .accent-officials { --tile: var(--officials); } .accent-staff { --tile: var(--staff); }
.accent-media { --tile: var(--media); } .accent-tools { --tile: var(--tools); } .accent-ai { --tile: var(--ai); } .accent-tracker { --tile: var(--tracker); }

/* ------------------------------------------------------------- department page */
.dept-head { display: flex; gap: var(--s5); align-items: start; padding-bottom: var(--s6); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); }
.dept-head .swatch { width: 56px; height: 56px; border-radius: var(--radius); background: var(--tile); flex: none; display: grid; place-items: center; font-family: var(--badge); font-size: 26px; color: #0b0d10; }
.two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s7); }
.side-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); align-self: start; }
.side-card h3 { margin-bottom: var(--s3); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: var(--s2) 0; border-bottom: 1px solid var(--line); color: var(--dim); }
.list li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------- news */
.news-list { display: grid; gap: var(--s3); }
.news-item { display: grid; grid-template-columns: 120px 1fr; gap: var(--s5); padding: var(--s5); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.news-item:hover { background: var(--raised); }
.news-item time { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.news-item h3 { margin-bottom: var(--s2); }
.news-item p { margin: 0; color: var(--dim); }
article.post header { margin-bottom: var(--s6); }
article.post time { color: var(--muted); font-family: var(--mono); font-size: 13px; }

/* ------------------------------------------------------------- empty states */
.empty { padding: var(--s7) var(--s5); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--dim); }
.empty h3 { color: var(--text); margin-bottom: var(--s2); }
.empty .button { margin-top: var(--s4); }

/* ------------------------------------------------------------- tabs, misc */
.tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); overflow-x: auto; }
.tabs a { padding: var(--s3) 0; text-decoration: none; color: var(--dim); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.steps { padding-left: var(--s5); }
.steps li { margin-bottom: var(--s3); color: var(--dim); }
.phrase { display: inline-block; margin-top: var(--s2); padding: var(--s2) var(--s3); background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 15px; user-select: all; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.swatches div { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 12px; }
.swatches i { display: block; height: 56px; }
.swatches span { display: block; padding: var(--s2); color: var(--dim); font-family: var(--mono); }
.demo-row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin: var(--s3) 0 var(--s5); }

.page > h2 { margin: var(--s6) 0 var(--s3); font-size: 20px; }
.page > h1 + p { margin-top: var(--s2); }
.page > form { margin-top: var(--s4); }

/* ------------------------------------------------------------- workspaces */
.workspace { padding: var(--s5) 0 var(--s8); }
.ws-head { padding-top: var(--s3); }
.ws-eyebrow { display: flex; align-items: center; gap: var(--s2); }
.ws-eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--tile); }
.workspace h1 { font-size: 30px; }
.ws-section { margin-top: var(--s7); }
.ws-foot { margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--line); }
.crumb { color: var(--muted); font-size: 13px; margin: 0 0 var(--s3); }
.crumb a { color: var(--dim); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.filters { margin: var(--s4) 0 var(--s5); }
.stat-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s5); }
.stat { display: block; padding: var(--s4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.stat:hover { background: var(--raised); }
.stat b { display: block; font-family: var(--badge); font-weight: 400; font-size: 36px; line-height: 1; }
.stat b small { font-size: 18px; color: var(--muted); }
.stat span { display: block; margin-top: var(--s2); color: var(--muted); font-size: 12px; font-weight: 600; }
.stat.attention { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.stat.attention b { color: var(--warn); }
.matches { display: grid; gap: var(--s2); }
.match { display: grid; grid-template-columns: 170px minmax(0, 1fr) 220px 150px; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); text-decoration: none; }
.match:hover { background: var(--raised); }
.match-when { font-size: 13px; font-weight: 600; }
.match-when small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; }
.match-teams { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: center; gap: var(--s3); }
.team { display: flex; align-items: center; gap: var(--s2); min-width: 0; font-weight: 600; }
.team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.away { justify-content: flex-end; text-align: right; }
.score { text-align: center; font-family: var(--badge); font-size: 22px; line-height: 1; }
.score i, .mh-score i { font-style: normal; color: var(--muted); padding: 0 4px; }
.match-crew { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.crew { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--dim); }
.crew.ref { color: var(--text); border-color: color-mix(in srgb, var(--officials) 60%, var(--line)); }
.crew small { color: var(--muted); }
.match-status { justify-self: end; }
.crest-blank { display: inline-block; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-strong); }
.lg-UEFA, .lg-UCL { border-left-color: #3b82f6; } .lg-UEL { border-left-color: #f59e0b; } .lg-UECL { border-left-color: #10b981; }
.match-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s5); padding: var(--s6) var(--s5); margin-bottom: var(--s6); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--radius); }
.match-hero.lg-PL { border-top-color: #8b5cf6; } .match-hero.lg-BL { border-top-color: #ef4444; } .match-hero.lg-LL { border-top-color: #f97316; }
.match-hero.lg-SA { border-top-color: #22d3ee; } .match-hero.lg-L1 { border-top-color: #a3e635; }
.mh-team { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; }
.mh-team h2 { font-size: 22px; }
.mh-mid { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; }
.mh-score { font-family: var(--badge); font-size: 64px; line-height: 1; }
.mh-when { color: var(--dim); font-size: 14px; }
.crest.lg { width: 56px; height: 56px; }

/* ------------------------------------------------------------- utilities (no inline styles: the page policy forbids them) */
.mt0 { margin-top: 0 !important; } .mt4 { margin-top: var(--s4); } .mt5 { margin-top: var(--s5); } .mt6 { margin-top: var(--s6); }
.m0 { margin: 0; } .small { font-size: 13px; } .flush { border-top: 0; padding-top: var(--s6); }
.facts-demo { max-width: 420px; }
.sw-page { background: var(--page); } .sw-panel { background: var(--panel); } .sw-raised { background: var(--raised); }
.sw-line { background: var(--line); } .sw-text { background: var(--text); } .sw-dim { background: var(--dim); } .sw-muted { background: var(--muted); }
.sw-accent { background: var(--accent); } .sw-ok { background: var(--ok); } .sw-warn { background: var(--warn); } .sw-danger { background: var(--danger); }
.sw-guru { background: var(--guru); } .sw-officials { background: var(--officials); } .sw-staff { background: var(--staff); }
.sw-media { background: var(--media); } .sw-tools { background: var(--tools); } .sw-ai { background: var(--ai); } .sw-tracker { background: var(--tracker); }

/* ------------------------------------------------------------- Tools Hub */
.pill.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.tool-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.tool-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 230px; gap: var(--s4); align-items: center; padding: var(--s3) var(--s4); text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.tool-row:first-child { border-top: 0; }
.tool-row:hover { background: var(--raised); }
.tool-main strong { display: block; }
.tool-main small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-meta { color: var(--dim); font-size: 13px; display: flex; align-items: center; gap: var(--s2); }
.tool-state { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.owner-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sw-general { background: var(--dim); }
.tag { font-size: 12px; font-weight: 600; padding: 2px var(--s2); border-radius: 4px; background: var(--raised); color: var(--dim); border: 1px solid var(--line); white-space: nowrap; }
.tag-never { color: var(--danger); } .tag-runnable { color: var(--accent); } .tag-report { color: var(--ok); } .tag-link { color: var(--accent); } .tag-move, .tag-retire { color: var(--warn); }
.owner-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
.owner-card { display: block; padding: var(--s4); border: 1px solid var(--line); border-top: 3px solid var(--tile, var(--dim)); border-radius: var(--radius); background: var(--panel); text-decoration: none; color: inherit; }
.owner-card:hover { background: var(--raised); }
.owner-card b { display: block; font-family: var(--badge); font-weight: 400; font-size: 36px; line-height: 1; margin: var(--s2) 0; }
.owner-card .owner-name { font-weight: 600; }
.owner-card small { color: var(--muted); font-size: 12px; }
.accent-general { --tile: var(--dim); }
.ws-section.tight { margin-top: var(--s6); }
.cat-head { font-size: 16px; margin-bottom: var(--s3); }
.tool-head { margin-bottom: 0; }
.tool-head h1 { margin: 0; }
.tool-facts { display: grid; grid-template-columns: 180px minmax(0, 1fr); margin: 0 0 var(--s7); border-top: 1px solid var(--line); }
.tool-facts dt, .tool-facts dd { padding: var(--s3) 0; border-bottom: 1px solid var(--line); margin: 0; }
.tool-facts dt { color: var(--muted); font-size: 13px; font-weight: 600; padding-right: var(--s4); }
.tool-facts dd.mono { word-break: break-word; }
form.stack { display: grid; gap: var(--s2); justify-items: start; }
form.stack select, form.stack input { width: 100%; }
pre.key { font-family: var(--mono); font-size: 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); white-space: pre-wrap; word-break: break-all; margin: var(--s3) 0; }
details.log summary { cursor: pointer; color: var(--dim); font-size: 13px; margin-top: var(--s1); }
details.log pre { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; max-height: 260px; overflow: auto; background: var(--raised); padding: var(--s3); border-radius: var(--radius); }

/* ------------------------------------------------------------- phones and tablets */
@media (max-width: 1100px) {
  .leagues { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .hero .wrap { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s8); }
  .two { grid-template-columns: 1fr; gap: var(--s5); }
}
@media (max-width: 760px) {
  .bar-in { height: auto; min-height: 56px; flex-wrap: wrap; padding: var(--s2) var(--s4); gap: var(--s3); }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: var(--s4); padding-bottom: var(--s1); }
  .account { margin-left: auto; }
  .account .who { display: none; }
  .wrap { padding: 0 var(--s4); }
  .page { padding-top: var(--s6); }
  h1 { font-size: 32px; }
  .section { padding: var(--s7) 0; }
  .fixtures { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 1fr; gap: var(--s2); }
  .dept-head { flex-direction: column; gap: var(--s3); }
  .fact b { font-size: 32px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match { grid-template-columns: 1fr auto; grid-template-areas: "when status" "teams teams" "crew crew"; gap: var(--s2) var(--s3); }
  .match-when { grid-area: when; } .match-status { grid-area: status; } .match-teams { grid-area: teams; } .match-crew { grid-area: crew; }
  .match-hero { grid-template-columns: 1fr; gap: var(--s4); }
  .mh-score { font-size: 48px; }
  .tool-row { grid-template-columns: 1fr; gap: var(--s2); }
  .tool-state { justify-content: flex-start; }
  .owner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-facts { grid-template-columns: 1fr; }
  .tool-facts dt { border-bottom: 0; padding-bottom: 0; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .match { grid-template-columns: 150px minmax(0, 1fr) 140px; }
  .match-crew { display: none; }
  .owner-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-row { grid-template-columns: minmax(0, 1fr) 200px; }
  .tool-meta { display: none; }
}

/* Staff: the organisation chart, an indented tree drawn from reports_to */
.org-tree { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.org-tree .org-tree { margin-top: var(--s2); padding-left: var(--s5); border-left: 2px solid var(--line); }
.org-box { display: grid; gap: 2px; padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--tile, var(--staff)); border-radius: var(--radius); }
.org-box.vacant { border-style: dashed; border-left-style: solid; }
.position-card .section-head { flex-wrap: wrap; }

/* Tools Hub: a run started from the site */
.run-output { max-height: 32rem; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); font-size: .85rem; }
.run-facts { margin-top: var(--s3); }

/* Tools Hub documentation */
.guide-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s5); margin-top: var(--s4); }
.guide-layout { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); }
.guide h1 { font-size: 30px; margin-top: 0; }
.guide p, .guide li { max-width: none; }
.guide table { display: block; overflow-x: auto; font-size: 14px; margin: var(--s3) 0; }
.guide pre { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.guide code { font-size: .9em; }
