/* Barlow, self-hosted (SIL Open Font License, see assets/fonts/OFL.txt) */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/barlow-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 800; font-display: swap; src: url("../assets/fonts/barlow-800.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 600; font-display: swap; src: url("../assets/fonts/barlow-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 700; font-display: swap; src: url("../assets/fonts/barlow-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 800; font-display: swap; src: url("../assets/fonts/barlow-800-italic.woff2") format("woff2"); }

/* one theme per mode: light by default, dark when the device is dark, and either one forced with
   <html data-theme="light"> or <html data-theme="dark">. The report's A4 sheets keep light paper in both (.sheet) */
:root {
  color-scheme: light;
  --page: #f2f2f4;
  --panel: #e9e9ec;
  --card: #ffffff;
  --tile: #f0f0f3;
  --ink: #0b0b0c;
  --ink-2: #3a3a3e;
  --ink-3: #6e6e73;
  --line: #e5e5ea;
  --head: #e9e9ec;
  --band: var(--card);
  --band-line: var(--line);
  --box: #f0f0f3;
  --box-line: #e0e0e5;
  --chip: #ffffff;
  --chip-line: #d9d9de;
  --crest-tile: #ffffff;
  --live: #3d7a0a;
  --tbp: #c2410c;
  --lime: #b8ee3c;
  --lime-bar: #bdeb4f;
  --on-lime: #0b0b0c;
  --purple: #8b4ad3;
  --purple-ink: #8b4ad3;
  --red: #e5484d;
  --win: #3fb950;
  --draw: #b4b4b4;
  --loss: #e5484d;
  /* a lime accent on an ink-coloured button (lime on black; a dark green on white in dark mode) */
  --ink-accent: #b8ee3c;
  /* worked out from the tokens above, so they follow the mode */
  --on-ink: var(--card);
  --hover: color-mix(in srgb, var(--card) 94%, var(--ink));
  --tile-hover: color-mix(in srgb, var(--tile) 92%, var(--ink));
  --head-hover: color-mix(in srgb, var(--head) 92%, var(--ink));
  --soft: color-mix(in srgb, var(--ink) 6%, transparent);
  --soft-2: color-mix(in srgb, var(--ink) 12%, transparent);
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #000000;
    --panel: #1f1f22;
    --card: #141416;
    --tile: #2a2a2e;
    --ink: #ffffff;
    --ink-2: #e5e5ea;
    --ink-3: #8e8e93;
    --line: #2a2a2e;
    --head: #1f1f22;
    --band: #141416;
    --band-line: #2a2a2e;
    --box: #2a2a2e;
    --box-line: #3a3a3f;
    --chip: #1c1c1e;
    --chip-line: #2c2c30;
    --crest-tile: #ffffff;
    --live: #b8ee3c;
    --tbp: #ff9f0a;
    --purple-ink: #b48cff;
    --ink-accent: #3d7a0a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000;
  --panel: #1f1f22;
  --card: #141416;
  --tile: #2a2a2e;
  --ink: #ffffff;
  --ink-2: #e5e5ea;
  --ink-3: #8e8e93;
  --line: #2a2a2e;
  --head: #1f1f22;
  --band: #141416;
  --band-line: #2a2a2e;
  --box: #2a2a2e;
  --box-line: #3a3a3f;
  --chip: #1c1c1e;
  --chip-line: #2c2c30;
  --crest-tile: #ffffff;
  --live: #b8ee3c;
  --tbp: #ff9f0a;
  --purple-ink: #b48cff;
  --ink-accent: #3d7a0a;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
/* where the gutter can't be reserved, always show the page scrollbar, so short and long pages are the same width */
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 500 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* link underlines, one look everywhere: a thin line set clear of descenders and of a second line, in a softer shade
   of the text, fading in on hover; the ink skips round descenders. Links inside running text keep a faint line */
.provenance a, .muted a,
a.team-cell span, a.fixture-team span, .tf-opp span, .nm-club span, .mm-club .mm-team, a.pcard-team, a.rp span,
a.fixture-score, a.mm-score, a.tf-result .tf-score, .mp-club span, .mp-goals a, .lineup-list a span, a.mr-team span {
  text-decoration-line: underline;
  text-decoration-thickness: max(1px, 0.065em);
  text-underline-offset: 0.22em;
  text-decoration-skip-ink: auto;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.18s ease, color 0.15s ease;
}
.provenance a, .muted a { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.provenance a:hover, .muted a:hover,
a.team-cell:hover span, a.fixture-team:hover span, .tf-opp:hover span, .nm-club:hover span, .mm-club:hover .mm-team, a.pcard-team:hover,
a.rp:hover span, a.fixture-score:hover, a.mm-score:hover, a.tf-result:hover .tf-score, .mp-club:hover span,
.mp-goals a:hover, .lineup-list a:hover span, a.mr-team:hover span {
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}
/* names cut off with an ellipsis clip at their box: room below the text for the line, without moving anything */
.table .team-cell span, .fixture-team span, .tf-opp span, .rp span, .lineup-list a span { padding-bottom: 0.14em; margin-bottom: -0.14em; }
@media (prefers-reduced-motion: reduce) {
  .provenance a, .muted a, a.team-cell span, a.fixture-team span, .tf-opp span, .nm-club span, .mm-club .mm-team, a.pcard-team,
  a.rp span, a.fixture-score, a.mm-score, a.tf-result .tf-score, .mp-club span, .mp-goals a, .lineup-list a span { transition: none; }
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- shell */

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 20px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 24px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 40px;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 26px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  min-width: 132px;
}

/* the PSA mark (one drawing in index.html, in the text's colour: ink in light, white in dark), then "Hub" */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.brand-mark { flex: none; width: auto; height: 23px; aspect-ratio: 1225 / 228.67; fill: currentColor; stroke: none; }
.brand-word { font-size: 25px; line-height: 1; }
@media screen and (max-width: 1240px) {
  .brand .brand-mark { height: 20px; }
  .brand-word { font-size: 22px; }
}

.mainnav { display: flex; gap: 34px; }

.mainnav a {
  position: relative;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 0;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.mainnav a:hover, .mainnav a.active { color: var(--ink); }

.mainnav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateX(-50%);
}

.actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.event-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--chip);
  border-radius: 999px;
  padding: 7px 12px;
  white-space: nowrap;
}

.iconbtn, .avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--head);
  transition: background 0.15s ease, transform 0.1s ease;
}

.iconbtn:hover { background: var(--head-hover); }
.iconbtn:active, .avatar:active, .railbtn:active, .sportbtn:active { transform: scale(0.96); }

.iconbtn.has-dot::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--head);
}

.avatar { background: var(--ink); color: var(--on-ink); }
.avatar svg { width: 20px; height: 20px; }
.avatar.signed-in { background: var(--lime); color: var(--on-lime); }
.avatar.signed-in b { font-size: 13px; font-weight: 800; font-style: italic; letter-spacing: 0.02em; }

.rail {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 12px;
  align-self: start;
  height: calc(100vh - 100px);
  min-height: 420px;
}

.rail-sports { display: flex; flex-direction: column; gap: 12px; }

.sportbtn, .railbtn {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--card);
  transition: background 0.15s ease, transform 0.1s ease;
}

.sportbtn:hover, .railbtn:hover { background: var(--hover); }
.sportbtn.active { background: var(--lime); color: var(--on-lime); }
.sportbtn svg, .railbtn svg { width: 20px; height: 20px; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.railbtn.logout { color: var(--red); }

.content { grid-column: 2; grid-row: 2; min-width: 0; }
main { outline: none; }

.provenance {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- shared pieces */

.title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--soft);
  border-radius: 999px;
  padding: 3px 7px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 12px;
  min-height: 36px;
}

.panel-body {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  flex: 1;
  min-width: 0;
}

.arrow {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.arrow:hover { background: var(--soft); }

.seg { display: inline-flex; background: var(--soft); border-radius: 8px; padding: 2px; }

.seg button {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
/* the highlight slides to the picked button (js/app.js); while it travels the button itself shows no background */
.seg { position: relative; }
.seg > button { position: relative; z-index: 1; }
.seg-ghost { position: absolute; z-index: 0; border-radius: 6px; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); pointer-events: none; }
.seg button.seg-arriving[aria-pressed="true"] { background: transparent; box-shadow: none; }

/* page changes fade across with a small rise; the top bar and rail stay put */
#view { view-transition-name: page; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(page) { animation: none; }
::view-transition-old(page) { animation: 140ms ease-out both page-out; }
::view-transition-new(page) { animation: 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both page-in; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

.head-tools { display: flex; align-items: center; gap: 8px; }

.crest {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--crest-tile);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: grid;
  place-items: center;
}

.crest img { width: 78%; height: 78%; object-fit: contain; }
.crest.lg { width: 60px; height: 60px; border-radius: 12px; }
.crest.sm { width: 24px; height: 24px; border-radius: 6px; }

.num { font-variant-numeric: tabular-nums; }

.empty { color: var(--ink-3); font-size: 13px; padding: 24px 8px; text-align: center; }

/* ---------------------------------------------------------------- home grid */

.dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.dash .players { grid-column: span 4; }
.dash .momentum { grid-column: span 8; }
.dash .stats { grid-column: span 5; }
.dash .news { grid-column: span 7; }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.35; } }

@keyframes goal {
  0% { color: var(--purple); transform: scale(1.5); }
  100% { color: inherit; transform: scale(1); }
}

/* top players */

.players-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
}

.pcard {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  min-height: 124px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.pcard-name { font-size: 16px; font-weight: 700; line-height: 1.05; max-width: 62%; }
.pcard-team { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; max-width: 50%; line-height: 1.2; }
.pcard-label { font-size: 11px; color: var(--ink-2); margin-top: auto; }
.pcard-goals { font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }

.kit {
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 50%;
  max-width: 116px;
  z-index: -1;
}

.kit svg { width: 100%; height: auto; stroke: none; }

/* attack momentum */

.momentum-body { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; }

.mm-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: center;
  min-width: 0;
}

.mm-club, .mm-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.mm-mid { gap: 2px; }

.mm-team { font-size: 12px; font-weight: 600; max-width: 104px; line-height: 1.2; }
.mm-score { font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: 0.08em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mm-clock { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chart { display: grid; grid-template-rows: auto 1fr; gap: 10px; min-width: 0; }
.ticks { position: relative; height: 14px; font-size: 11px; color: var(--ink-3); }
.ticks span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }

.bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--minutes), minmax(0, 1fr));
  column-gap: 3px;
  min-height: 180px;
}

.bar { display: grid; grid-template-rows: 1fr 1fr; row-gap: 3px; }
.bar i { display: block; width: 100%; max-width: 7px; justify-self: center; }
.bar .up { align-self: end; height: var(--h); background: var(--lime-bar); border-radius: 4px 4px 1px 1px; }
.bar .down { align-self: start; height: var(--a); background: var(--purple); border-radius: 1px 1px 4px 4px; }
.bar.future .up, .bar.future .down { background: var(--tile); }
.bar.now .up, .bar.now .down { animation: grow 0.6s ease-out; transform-origin: center bottom; }
.bar.now .down { transform-origin: center top; }

@keyframes grow { from { transform: scaleY(0); } }

.ht-line { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1px dashed var(--box-line); }
.ht-line b { position: absolute; top: -14px; left: 0; transform: translateX(-50%); color: var(--ink-3); font-size: 9.5px; font-weight: 700; }
.bar { position: relative; }
.mm-goal { position: absolute; left: 50%; z-index: 1; width: 11px; height: 11px; transform: translateX(-50%); }
.mm-goal.home { top: -2px; }
.mm-goal.away { bottom: -2px; }
.mm-goal .mev { width: 11px; height: 11px; }

.momentum .panel-head { flex-wrap: wrap; row-gap: 8px; }
.mm-pick button { white-space: nowrap; }

.mm-legend { display: flex; gap: 14px; font-size: 11px; color: var(--ink-2); }
.mm-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* standings */

.table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.table th { font-size: 11px; font-weight: 500; color: var(--ink-3); text-align: center; padding: 0 4px 10px; }
.table td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.table th.team, .table td.team { text-align: left; }
.table td.team { font-weight: 600; }
.table .team-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.table .team-cell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table td.pts { font-weight: 700; }
/* the full standings (Teams page, 11 columns): the numbers get set widths and the team name takes the rest; on a narrow
   panel GF, GA and the next match step aside, so the numbers never run into each other */
.panel-body:has(> .table > thead th:nth-child(11)) { container-type: inline-size; }
.table:has(> thead th:nth-child(11)) th.team { width: auto !important; }
.table:has(> thead th:nth-child(11)) th:is(:nth-child(2), :nth-child(3), :nth-child(4), :nth-child(5)) { width: 28px; }
.table:has(> thead th:nth-child(11)) th:is(:nth-child(6), :nth-child(7)) { width: 32px; }
.table:has(> thead th:nth-child(11)) th:nth-child(8) { width: 38px; }
.table:has(> thead th:nth-child(11)) th:nth-child(9) { width: 34px; }
@container (max-width: 559px) {
  .table:has(> thead th:nth-child(11)) :is(th, td):is(:nth-child(6), :nth-child(7), :nth-child(11)) { display: none; }
}
@media screen and (max-width: 760px) {
  .table:has(> thead th:nth-child(11)) th:is(:nth-child(2), :nth-child(3), :nth-child(4), :nth-child(5)) { width: 24px; }
  .table:has(> thead th:nth-child(11)) th:nth-child(8) { width: 34px; }
  .table:has(> thead th:nth-child(11)) th:nth-child(9) { width: 30px; }
}
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: var(--hover); }

.label-sm { display: none; }
.live-tag { font-size: 11px; font-weight: 700; color: var(--purple-ink); text-transform: uppercase; letter-spacing: 0.04em; }

.form { display: inline-flex; gap: 4px; }
.form b { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; color: #fff; }
.form .W { background: var(--win); }
.form .D { background: var(--draw); }
.form .L { background: var(--loss); }

/* news */

.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-content: space-evenly; }

.nitem { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; }

.thumb {
  position: relative;
  aspect-ratio: 92 / 80;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.45' stroke-width='1.2'%3E%3Crect x='4' y='4' width='84' height='72' rx='1'/%3E%3Cpath d='M46 4v72'/%3E%3Ccircle cx='46' cy='40' r='13'/%3E%3Crect x='4' y='24' width='12' height='32'/%3E%3Crect x='76' y='24' width='12' height='32'/%3E%3C/g%3E%3C/svg%3E") center / cover,
    repeating-linear-gradient(90deg, #2f8b45 0 11.5px, #2a7f3e 11.5px 23px);
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.thumb img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48%;
  height: 48%;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ntitle {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.ntime { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.nsummary { font-size: 13px; color: var(--ink-2); margin-top: 6px; text-wrap: pretty; }

/* ---------------------------------------------------------------- pages */

.page { display: grid; gap: 16px; }
.page-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.day { margin-top: 18px; }
.day:first-child { margin-top: 0; }
.day h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.fixture {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px minmax(0, 1fr) minmax(0, 150px) 34px;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-top: 1px solid var(--line);
}

.fixture-time { font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fixture-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.fixture-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixture-team.home { justify-content: flex-end; text-align: right; }
.fixture-score { text-align: center; font-weight: 800; font-style: italic; font-size: 16px; font-variant-numeric: tabular-nums; }
.fixture-score.pending { font-style: normal; font-weight: 600; font-size: 11px; color: var(--ink-3); }
.fixture-score.live { color: var(--purple-ink); }
.fixture-venue { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixture-group { font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--tile); border-radius: 6px; text-align: center; padding: 3px 0; }

.kit-sm { width: 26px; flex: none; }
.kit-sm svg { width: 100%; height: auto; stroke: none; }

.searchbox {
  font: inherit;
  font-size: 13px;
  border: 0;
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  padding: 7px 10px;
  min-width: 0;
  width: 180px;
}

select.searchbox { width: auto; max-width: 200px; }

.news-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.news-page .nitem { grid-template-columns: 132px minmax(0, 1fr); align-items: start; }

/* ---------------------------------------------------------------- team pages */

.table tbody tr.highlight, .table tbody tr.highlight:hover { background: rgba(184, 238, 60, 0.24); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

.tcard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tcard:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); }
.tcard .crest { grid-row: span 2; width: 48px; height: 48px; }
.tcard-name { font-weight: 700; line-height: 1.2; align-self: end; }
.tcard-meta { font-size: 12px; color: var(--ink-3); align-self: start; }

.team-page {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "hero hero" "fixtures next" "fixtures goals" "squad group" "squad news";
  gap: 16px;
}

.tp-fixtures { grid-area: fixtures; }
.tp-next { grid-area: next; }
.tp-goals { grid-area: goals; }
.tp-squad { grid-area: squad; }
.tp-group { grid-area: group; }
.tp-news { grid-area: news; }

.team-hero {
  grid-area: hero;
  background: var(--band);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 16px; transition: color 0.15s ease; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; }

.team-id-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.crest.xl { width: 88px; height: 88px; border-radius: 18px; background: var(--crest-tile); }
.team-title { margin: 0; font-size: 34px; font-weight: 800; font-style: italic; text-transform: uppercase; line-height: 1; letter-spacing: -0.01em; text-wrap: balance; }
.team-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.team-tags span { font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--tile); border-radius: 999px; padding: 4px 9px; }

.team-tiles { display: grid; grid-template-columns: repeat(4, minmax(78px, 1fr)); gap: 8px; }

.ttile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-height: 62px;
  background: var(--tile);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.ttile.pos { background: var(--lime); color: var(--on-lime); }
.ttile-value { font-size: 22px; font-weight: 800; font-style: italic; line-height: 1; font-variant-numeric: tabular-nums; }
.ttile > span:last-child { font-size: 11px; color: var(--ink-3); }
.ttile.pos > span:last-child { color: color-mix(in srgb, var(--on-lime) 72%, var(--lime)); }

.tfix {
  display: grid;
  grid-template-columns: 52px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}

.tfix:first-child { border-top: 0; padding-top: 0; }
.tf-date { font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tf-ha { font-size: 10px; font-weight: 700; color: var(--ink-2); background: var(--tile); border-radius: 5px; text-align: center; padding: 3px 0; }
.tf-opp { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.tf-opp span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-result { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.tf-score, .tf-live { font-size: 16px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.tf-live { color: var(--purple-ink); }
.tf-clock { font-size: 11px; color: var(--purple-ink); font-variant-numeric: tabular-nums; }
.tf-time { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tf-pending { font-size: 11px; color: var(--ink-3); }

.nm { display: grid; gap: 14px; align-content: center; }
.nm-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.nm-club { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.2; min-width: 0; }
.nm-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nm-big { font-size: 24px; font-weight: 800; font-style: italic; color: var(--ink); white-space: nowrap; }
.nm-venue { text-align: center; font-size: 12px; color: var(--ink-2); background: var(--tile); border-radius: 8px; padding: 7px 10px; }

.gchart { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; height: 210px; padding-top: 18px; margin-bottom: 12px; }
.gcol { display: grid; grid-template-rows: 1fr 1fr auto; row-gap: 3px; justify-items: center; min-width: 0; }
.gbar { position: relative; width: 100%; max-width: 34px; min-height: 2px; height: var(--v); }
.gbar.up { align-self: end; background: var(--lime-bar); border-radius: 6px 6px 2px 2px; }
.gbar.down { align-self: start; background: var(--purple); border-radius: 2px 2px 6px 6px; }
.gbar b { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink-2); }
.gbar.up b { bottom: 100%; margin-bottom: 2px; }
.gbar.down b { top: 100%; margin-top: 2px; }
.glabel { font-size: 10px; font-weight: 700; color: var(--ink-3); margin-top: 18px; }

.news-list { display: grid; gap: 14px; }
.news-list .nitem { align-items: start; }

/* ---------------------------------------------------------------- player pages */

.player-page { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.player-page .team-hero { grid-area: auto; grid-column: 1 / -1; }
.pp-main, .pp-side { display: grid; gap: 16px; min-width: 0; }
.kit-xl { display: block; width: 76%; }
.kit-xl svg { display: block; width: 100%; height: auto; stroke: none; }
.team-tags a { font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--tile); border-radius: 999px; padding: 4px 9px; transition: background 0.15s ease, color 0.15s ease; }
.team-tags a:hover { background: var(--tile-hover); color: var(--ink); }
a.pcard-name { display: block; }
/* the whole card opens the player (the team name keeps its own link above it), and lifts like the match cards */
a.pcard-name::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
a.pcard-team { position: relative; z-index: 2; }
.pcard { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.pcard:has(a.pcard-name:hover) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); }
.pcard .kit { transition: transform 0.2s ease; }
.pcard:has(a.pcard-name:hover) .kit { transform: translateY(-2px); }
a.pcard-name:focus-visible { outline: none; }
.pcard:has(a.pcard-name:focus-visible) { box-shadow: 0 0 0 2px var(--ink); }
.tag-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-counts span { font-size: 12px; background: var(--tile); border-radius: 8px; padding: 5px 9px; }
.tag-counts b { font-weight: 800; font-style: italic; margin-right: 5px; }
.muted { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }

/* ---------------------------------------------------------------- match coder */

.coder-intro { margin: 0 0 14px; font-size: 13px; color: var(--ink-2); max-width: 72ch; }
/* the coder's landing page: three steps, the save line, the matches in the order a coder wants them */
.coder-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cstep { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 6px 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--tile); }
.cstep-n { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 800; }
.cstep h3 { margin: 4px 0 0; font-size: 14px; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 0.01em; }
.cstep p { margin: 0; font-size: 12px; color: var(--ink-2); text-wrap: pretty; }
.cstep-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cpill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--chip); box-shadow: inset 0 0 0 1px var(--chip-line); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.cpill svg { width: 14px; height: 14px; stroke-width: 2; }
.cpill.dark { background: var(--ink); color: var(--ink-accent); box-shadow: none; }
.coder-saveline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 4px; }
.coder-saveline .ok { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--live); }
.coder-saveline .ok svg { width: 14px; height: 14px; }
.coder-saveline .pill { box-shadow: inset 0 0 0 1px var(--chip-line); }
.coder-sec { margin-top: 10px; }
.sec-name { margin: 12px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.pick-field { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pick-field .searchbox { background: var(--card); }
.coder-row { border-radius: 8px; transition: background 0.15s ease; }
.coder-row:hover { background: var(--hover); }
.coder-row .fixture-group { background: none; }
.has-video { font-weight: 700; color: var(--purple-ink); }
.coder-open svg { width: 16px; height: 16px; color: var(--ink-3); }

/* the coding page: a slim bar, the source and screen choice when setting up, then the working area sized to the
   screen (a laptop at 125% shows about 1093 x 480), and below it the timeline, lists and stats */
.coder { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; }

.coder-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 7px 10px 7px 14px; border-radius: 12px; background: var(--band); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.coder-head .back { margin: 0; color: var(--ink-3); }
.coder-head .back:hover { color: var(--ink); }
.coder-title { font-size: 16px; font-weight: 800; font-style: italic; white-space: nowrap; font-variant-numeric: tabular-nums; }
.src-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--lime); color: var(--on-lime); font-size: 12.5px; font-weight: 800; white-space: nowrap; transition: box-shadow 0.15s ease; }
.src-chip svg { width: 16px; height: 16px; stroke-width: 2; }
.src-chip i { font-style: normal; font-size: 10px; }
.src-chip:hover, .src-menu[open] > .src-chip { box-shadow: 0 0 0 2px var(--ink); }
/* the source: one menu in the bar, the four ways to code a match, each with a line saying what it is */
.src-list { left: 0; right: auto; width: min(330px, calc(100vw - 32px)); gap: 2px; padding: 6px; }
.src-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 11px; row-gap: 1px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-align: left; transition: background 0.15s ease; }
.src-opt svg { grid-row: 1 / 3; width: 22px; height: 22px; stroke-width: 1.8; }
.src-opt b { font-size: 14px; font-weight: 800; line-height: 1.15; }
.src-opt small { font-size: 11.5px; line-height: 1.3; color: var(--ink-2); }
.src-opt:hover { background: var(--tile); }
.src-opt[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.src-opt[aria-pressed="true"] svg { color: var(--ink-accent); }
.src-opt[aria-pressed="true"] small { color: color-mix(in srgb, var(--on-ink) 75%, var(--ink)); }
.screen-seg { background: var(--soft); }
.screen-seg button { padding: 5px 10px; color: var(--ink-2); }
.screen-seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.coder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.coder-head .pill { padding: 6px 12px; }
.tagger-menu summary { padding: 6px 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.tagger-menu summary b { color: var(--ink); }
.tagger-menu .tagger { display: grid; gap: 4px; color: var(--ink-2); }
.tagger-menu .tagger .searchbox { width: 200px; }
.coder-head .saved { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.saved-short { display: none; }
@media (max-width: 1360px) {
  .saved-more, .coder-head .back span { display: none; }
  .saved-short { display: inline; }
  .coder-head { column-gap: 9px; }
  .tagger-menu summary b::after { content: " ✎"; font-weight: 400; color: var(--ink-3); }
  .tagger-menu .tagger-word { display: inline; }
}
.video-frame { container-type: inline-size; }
.blind-clock { font-size: clamp(26px, 11cqi, 64px) !important; }
@container (max-width: 440px) { .blind-face p { display: none; } }
/* a linked video or blind coding needs no source row, unless the source is picked again (to change the link) */
.src-row[data-linked="true"]:not(.open) { display: none; }

.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 8px 14px; background: var(--card); color: var(--ink); white-space: nowrap; transition: background 0.15s ease, transform 0.1s ease; }
.pill:hover { background: var(--hover); }
.pill:active { transform: scale(0.97); }
.pill.primary { background: var(--lime); color: var(--on-lime); }
.pill.danger { color: var(--red); }
.coder-head .pill { background: var(--tile); }
.coder-head .pill:hover { background: var(--tile-hover); }

.saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.saved svg { width: 14px; height: 14px; color: var(--live); }
.saved.bad { color: var(--red); }
.saved.flash { animation: saved 0.9s ease-out; }

@keyframes saved { from { color: var(--live); } }

.coder-video { grid-area: video; }
.level-side { display: contents; }

.coder-video .panel-head { flex-wrap: wrap; }
.src-later { font-size: 12px; color: var(--ink-3); }
#source-controls { min-width: 0; }
.src-note { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.cam-tools .searchbox { width: 170px; }
.pill[disabled] { opacity: 0.45; cursor: default; }
.vfile { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.blind-face { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; color: #e6e6e6; }
.blind-clock { font-size: 52px; font-weight: 800; font-style: italic; line-height: 1; font-variant-numeric: tabular-nums; }
.blind-face p { margin: 0; max-width: 46ch; font-size: 13px; color: #bdbdbd; text-wrap: pretty; }

.tagger { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.tagger .searchbox { width: 120px; padding: 6px 10px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; display: grid; gap: 8px; width: 290px; padding: 12px; border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--line); }
.menu-body .pill { background: var(--tile); text-align: left; }
.menu-body .muted { margin: 2px 0 0; }
.src.warn { color: var(--red); }
.review { display: grid; gap: 10px; padding: 14px; }
.review-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.review-frame video { position: absolute; inset: 0; width: 100%; height: 100%; }
.review .pill { justify-self: end; background: var(--tile); }

.video-form { display: flex; gap: 8px; min-width: 0; }
.video-form .searchbox { width: 300px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #0b0b0b; border-radius: var(--radius-sm); overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; font-size: 13px; color: #d6d6d6; }
.video-empty p { margin: 0; max-width: 44ch; text-wrap: pretty; }
.video-empty.over { background: rgba(0, 0, 0, 0.82); }

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tbtn { display: inline-grid; place-items: center; height: 34px; min-width: 46px; padding: 0 10px; border-radius: 9px; background: var(--tile); font-size: 12px; font-weight: 700; transition: background 0.15s ease, transform 0.1s ease; }
.tbtn:hover { background: var(--tile-hover); }
.tbtn:active { transform: scale(0.96); }
.tbtn.play, .tbtn.play:hover { background: var(--ink); color: var(--on-ink); min-width: 54px; }
.tbtn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.vtime { min-width: 56px; margin: 0 4px; font-size: 18px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.transport .seg { margin-left: auto; }
.keys { margin: 12px 0 0; font-size: 11px; color: var(--ink-3); line-height: 1.9; }
kbd { font: inherit; font-size: 10px; font-weight: 700; color: var(--ink-2); background: var(--tile); border-radius: 4px; padding: 1px 5px; }

.event-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ebtn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; background: var(--tile); font-size: 12px; font-weight: 700; transition: background 0.15s ease, color 0.15s ease; }
.ebtn:hover { background: var(--tile-hover); }
.ebtn kbd { background: var(--card); }
.ebtn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.ebtn[aria-pressed="true"] kbd { background: color-mix(in srgb, var(--on-ink) 16%, transparent); color: var(--on-ink); }

.squads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.squad.home { --side: var(--lime); --side-ink: var(--on-lime); }
.squad.away { --side: var(--purple); --side-ink: #fff; }
.squad-team { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 8px; padding: 6px 8px; border-radius: 9px; font-size: 13px; font-weight: 700; text-align: left; transition: background 0.15s ease; }
.squad-team span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.squad-team:hover { background: var(--tile); }
.squad-team.on { background: var(--tile); box-shadow: inset 0 0 0 2px var(--side); }
.squad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pbtn { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 8px; border-radius: 8px; background: var(--tile); font-size: 12px; font-weight: 600; text-align: left; transition: background 0.15s ease, color 0.15s ease; }
.pbtn:hover { background: var(--tile-hover); }
.pbtn b { min-width: 18px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.pbtn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbtn.on, .pbtn.on:hover { background: var(--side); color: var(--side-ink); }

.pitch { display: block; width: 100%; height: auto; aspect-ratio: 111 / 74; border-radius: var(--radius-sm); stroke: none; }
#pitch { cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.pitch .grass { fill: #2a8341; }
.pitch .stripe { fill: #2f8f47; }
.pitch .lines { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 0.35; }
.pitch .spots { fill: rgba(255, 255, 255, 0.85); }
.mark { stroke: #fff; stroke-width: 0.3; }
.mark.home, .mark-end.home, .shot.home { fill: var(--lime-bar); }
.mark.away, .mark-end.away, .shot.away { fill: #a978ff; }
.mark-line { stroke-width: 0.45; stroke-linecap: round; }
.mark-line.home, .shot-line.home, .shot.off.home { stroke: var(--lime-bar); }
.mark-line.away, .shot-line.away, .shot.off.away { stroke: #a978ff; }
.mark.old, .mark-line.old, .mark-end.old { opacity: 0.4; }
.mark.hl { stroke-width: 0.6; }
.drag-line { stroke: #fff; stroke-width: 0.5; stroke-dasharray: 1 1; }
.shot { stroke: #fff; stroke-width: 0.3; }
.shot.goal { stroke-width: 0.6; }
.shot.off { fill: none; stroke-width: 0.5; }
.shot-line { stroke-width: 0.35; stroke-opacity: 0.7; }
.tag-status { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.shot-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11px; color: var(--ink-2); }
.shot-key { display: inline-flex; align-items: center; gap: 4px; }
.shot-key .k { display: inline-block; width: 9px; height: 9px; margin-left: 4px; border-radius: 50%; background: var(--ink-2); }
.shot-key .k:first-child { margin-left: 0; }
.shot-key .k.goal { border-radius: 1px; transform: rotate(45deg) scale(0.85); }
.shot-key .k.off { background: none; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.home { background: var(--lime-bar); }
.dot.away { background: #a978ff; }
.dot.ring { box-shadow: inset 0 0 0 1.5px var(--ink-3); }

.tag-scroll { position: relative; max-height: 440px; overflow-y: auto; }
.tag-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.tag-log tbody tr { cursor: pointer; }
.tag-log tbody tr.on, .tag-log tbody tr.on:hover { background: rgba(184, 238, 60, 0.24); }
.tag-log .where { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.src { font-size: 10px; font-weight: 700; color: var(--ink-3); background: var(--tile); border-radius: 5px; padding: 1px 5px; margin-left: 4px; }
.del { width: 28px; height: 28px; border-radius: 8px; font-size: 17px; line-height: 1; color: var(--ink-3); transition: background 0.15s ease, color 0.15s ease; }
.del:hover { background: var(--tile); color: var(--red); }

.import-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--page); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3); }
.import-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.import-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px; }
.import-form p { margin: 0; font-size: 13px; }
.slot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.slot-team { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; }
.slot { display: grid; grid-template-columns: 34px 64px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.slot span { color: var(--ink-3); }
.slot select { min-width: 0; padding: 6px; border: 1px solid var(--chip-line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 12px; }
.mode { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; border: 0; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.import-form .pill { background: var(--card); }
.import-form .pill.primary { background: var(--lime); color: var(--on-lime); }

/* ---------------------------------------------------------------- live coding (team level) */

@keyframes hit { from { filter: brightness(0.8); transform: scale(0.96); } }

.table.vs th, .table.vs td { text-align: center; }
.table.vs tbody th { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 7px 4px; border-top: 1px solid var(--line); }
.table.vs tbody td { font-weight: 700; }
.table.vs tbody tr { cursor: help; }

.tl { display: grid; gap: 4px; }
.tl-ruler { position: relative; height: 16px; margin-left: 110px; font-size: 10px; color: var(--ink-3); }
.tl-ruler span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.tl-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px; align-items: center; }
.tl-row b { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 18px; border-radius: 5px; background: var(--tile); }
.tl-item { position: absolute; top: 3px; height: 12px; background: var(--c); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.tl-item.mark { width: 4px; margin-left: -2px; }
.tl-item.mark.away, .tl-item.bar.away { box-shadow: inset 0 0 0 1px rgba(80, 30, 140, 0.45); }
.tl-item:hover { filter: brightness(0.9); }
.sub { margin: 16px 0 8px; font-size: 12px; font-weight: 800; font-style: italic; text-transform: uppercase; }
.matrix-wrap { overflow-x: auto; }
.table.matrix { table-layout: auto; font-size: 12px; }
.table.matrix th { white-space: nowrap; }

.editor-dialog { width: min(1180px, calc(100vw - 24px)); }
.editor-top { display: flex; gap: 14px; }
.editor-top label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.editor-top .searchbox { width: 220px; background: var(--card); }
.editor-top input[type=number] { width: 70px; }
.editor-top { flex-wrap: wrap; align-items: center; }
.editor-top .muted { flex: 1 1 320px; margin: 0; }
.editor-list { display: grid; gap: 8px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
/* one button per card: each field with its caption, only the fields its type uses */
.ed-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 0; padding: 10px 12px 11px; border: 0; border-radius: 10px; background: var(--card); }
.ed-f { display: grid; gap: 3px; min-width: 0; }
.ed-f > span { font-size: 10px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.ed-row .searchbox { width: 100%; min-width: 0; padding: 6px 8px; font-size: 12.5px; background: var(--tile); }
.ed-row input[type=color] { width: 40px; height: 32px; padding: 0; border: 0; background: none; }
.f-label { flex: 2 1 220px; }
.f-label .searchbox { font-weight: 700; }
.f-color { flex: 0 0 auto; }
.f-key { flex: 0 0 78px; }
.f-kind { flex: 0 0 132px; }
.f-team { flex: 0 0 176px; }
.f-role { flex: 1 1 230px; }
.f-num { flex: 0 0 84px; }
.f-group { flex: 0 0 112px; }
.f-adds { flex: 1 1 210px; }
.f-checks { flex: 0 0 auto; grid-template-columns: auto auto; column-gap: 12px; align-items: center; }
.f-checks > span { grid-column: 1 / -1; }
.ed-check { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; font-size: 12px; color: var(--ink); white-space: nowrap; }
.ed-move { display: inline-flex; gap: 3px; margin-left: auto; }
.ed-move .tbtn { min-width: 30px; height: 30px; padding: 0; }
.ed-row[data-kind="head"] .ed-f:not(.f-label, .f-color, .f-kind, .f-span),
.ed-row[data-kind="period"] .ed-f:not(.f-label, .f-color, .f-key, .f-kind, .f-span),
.ed-row:not([data-kind="fixed"]) .f-fixed,
.ed-row:not([data-kind="bar"]):not([data-kind="fixed"]) .f-group { display: none; }
.grow { flex: 1; }

/* ---------------------------------------------------------------- player coding (after the match) */

.pc-teams button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; }
.pc-teams button small { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); }
.pc-teams button.home[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--lime-bar), 0 1px 2px rgba(0, 0, 0, 0.08); }
.pc-teams button.away[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--purple), 0 1px 2px rgba(0, 0, 0, 0.08); }
.pc-menu .menu-body label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pc-menu .menu-body .searchbox { width: 100%; max-width: none; background: var(--tile); }
.pc-note { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(184, 238, 60, 0.24); font-size: 12px; text-wrap: pretty; }
.pc-note .pill { margin-left: auto; background: var(--card); }
.pc-num { display: inline-grid; place-items: center; min-width: 44px; height: 38px; padding: 0 8px; border-radius: 9px; background: var(--side); color: var(--side-ink); font-size: 22px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.pc-num.empty { background: var(--tile); color: var(--ink-3); }
.pc-warn { font-size: 11px; font-weight: 600; color: var(--red); }
#pc-pitch { cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.pc-end { font: 700 2.4px var(--font); fill: rgba(255, 255, 255, 0.6); letter-spacing: 0.05px; }
.pc-mark circle { stroke: #fff; stroke-width: 0.3; }
.pc-mark.home circle { fill: var(--lime-bar); }
.pc-mark.away circle { fill: #a978ff; }
.pc-mark.stop circle { fill: #fff; stroke: var(--red); stroke-width: 0.5; }
.pc-mark text { font: 800 1.9px var(--font); fill: #0b0b0c; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pc-mark.away text { fill: #fff; }
.pc-mark.stop text { fill: #0b0b0c; }
.pc-mark.old { opacity: 0.45; }
.pc-mark.hl circle { stroke-width: 0.75; }
.pc-link { stroke-width: 0.4; stroke-linecap: round; }
.pc-link.home { stroke: var(--lime-bar); }
.pc-link.away { stroke: #a978ff; }
.pc-link.old { opacity: 0.4; }
.pc-goal { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--tile); transition: background 0.15s ease, box-shadow 0.15s ease; }
.pc-goal.active { background: rgba(184, 238, 60, 0.2); box-shadow: inset 0 0 0 2px var(--lime); }
.goalmouth { display: block; width: 100%; height: auto; border-radius: 6px; stroke: none; cursor: crosshair; }
.gm-bg { fill: #2e8a46; }
.gm-ground { fill: #25723a; }
.gm-net { fill: rgba(255, 255, 255, 0.1); }
.gm-mesh { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 0.025; }
.gm-frame { fill: none; stroke: #fff; stroke-width: 0.12; }
.gm-shot { stroke: #fff; stroke-width: 0.05; }
.gm-shot.home { fill: var(--lime-bar); }
.gm-shot.away { fill: #a978ff; }
.gm-shot.goal { stroke: #0b0b0c; stroke-width: 0.09; }
.gm-shot.hl { stroke-width: 0.12; }
.pc-goal-side p { margin: 0 0 8px; font-size: 12px; color: var(--ink-2); text-wrap: pretty; }
.pc-goal-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-goal-btns .pill { background: var(--card); }
.pc-onpitch { margin-top: 12px; }
.pc-tl .tl-row { grid-template-columns: 150px minmax(0, 1fr); }
.pc-tl .tl-ruler { margin-left: 156px; }
.pc-tl .tl-row b small { font-weight: 600; color: var(--ink-3); }
.pc-tl .tl-track { overflow: hidden; }
.tl-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 9%, transparent) 0 4px, transparent 4px 8px); }
.tl-half { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.tl-item.hl { box-shadow: 0 0 0 2px var(--ink); z-index: 1; }
.pc-table td small { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--ink-2); }
.pc-row-tools { display: flex; gap: 2px; justify-content: flex-end; }
.pc-editing td { background: rgba(184, 238, 60, 0.16); }
.pc-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pc-edit .searchbox { max-width: 190px; padding: 6px 8px; font-size: 12px; background: var(--card); }
.pc-edit .pill { padding: 6px 11px; background: var(--card); }
.pc-edit .pill.primary { background: var(--lime); color: var(--on-lime); }
.versions-body { width: 330px; }
.ver-save { display: flex; gap: 6px; }
.ver-save .searchbox { flex: 1; width: auto; background: var(--tile); }
.ver-list { display: grid; gap: 4px; max-height: 240px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.ver-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: var(--tile); }
.ver-list li span { display: grid; min-width: 0; }
.ver-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ver-list small { font-size: 11px; color: var(--ink-2); }
.ver-list .pill { padding: 5px 10px; background: var(--card); }
.live-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.live-sel .pill { padding: 5px 10px; background: var(--card); }
.pc-table td b { font-weight: 700; }

.lineup-dialog { width: min(1120px, calc(100vw - 24px)); }
.lu-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lu-team { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 12px; background: var(--card); }
.lu-head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 800; font-style: italic; text-transform: uppercase; }
.lu-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lu-top label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.lu-team .searchbox { width: 100%; max-width: none; padding: 6px 8px; font-size: 12px; background: var(--tile); }
.lu-top .searchbox { width: auto; }
.lu-team .pill { justify-self: start; background: var(--tile); }
.lu-dot circle { stroke: #fff; stroke-width: 0.4; }
.lu-team.home .lu-dot circle { fill: var(--lime-bar); }
.lu-team.away .lu-dot circle { fill: #a978ff; }
.lu-dot text { font: 800 3.2px var(--font); text-anchor: middle; dominant-baseline: central; fill: #0b0b0c; }
.lu-team.away .lu-dot text { fill: #fff; }
.lu-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.lu-slot { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.lu-team h4 { margin: 6px 0 0; font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.lu-sub { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto 62px auto; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.lu-change { display: grid; grid-template-columns: auto 62px auto minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.lu-none { margin: 0; }
.lu-error { align-self: center; font-size: 12px; font-weight: 600; color: var(--red); }

/* ---------------------------------------------------------------- staff: sign-in and editing in the page */

.auth-dialog { width: min(420px, calc(100vw - 32px)); }
.auth-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.auth-form .searchbox { width: 100%; padding: 9px 12px; font-size: 14px; }
.auth-error { min-height: 16px; font-size: 12px; font-weight: 600; color: var(--red); }
.auth-dialog.wide { width: min(760px, calc(100vw - 32px)); }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-links:empty { display: none; }
.auth-users { overflow-x: auto; }
.auth-users .table { min-width: 600px; }
.auth-users td { padding: 7px 4px; }
.auth-users td small { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.auth-users select.searchbox { width: 100%; max-width: none; padding: 6px 8px; font-size: 12px; background: var(--tile); }
.auth-row-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.auth-row-acts .pill { padding: 5px 10px; font-size: 12px; }
.auth-off td { color: var(--ink-3); }
.auth-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 120px auto; align-items: end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.auth-add h3 { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.auth-add .searchbox { padding: 8px 10px; font-size: 13px; }
.auth-add select.searchbox { width: 100%; max-width: none; }
.auth-temp { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius); background: var(--tile); }
.auth-temp code { font: 700 16px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; user-select: all; }
@media screen and (max-width: 560px) {
  .auth-add { grid-template-columns: minmax(0, 1fr); }
  /* one card per user: name, then role and last sign-in, then the buttons */
  .auth-users .table, .auth-users tbody { display: block; min-width: 0; }
  .auth-users thead { display: none; }
  .auth-users tr { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
  .auth-users td { padding: 0; border: 0; text-align: left; }
  .auth-users td.team { grid-column: 1 / -1; }
  .auth-users td:nth-child(3) { font-size: 12px; color: var(--ink-3); }
  .auth-users td:nth-child(3)::before { content: "Last sign-in: "; }
  .auth-row-acts { grid-column: 1 / -1; justify-content: flex-start; }
}
.tp-squad .panel-head .pill { background: var(--card); }
.sq-table td { padding: 5px 4px; }
.sq-table .searchbox { width: 100%; max-width: none; padding: 6px 8px; background: var(--tile); }
.sq-edit { overflow-x: auto; }
.sq-table { min-width: 640px; }
.sq-table td small { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--red); }
.sq-removed td { color: var(--ink-3); }
.sq-removed td.team { text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.sq-removed .pill { background: var(--tile); padding: 5px 10px; }
.sq-actions { flex-wrap: wrap; margin-top: 12px; }
.sq-actions .pill { background: var(--tile); }
.sq-actions .pill.primary { background: var(--lime); color: var(--on-lime); }
.sq-error { align-self: center; font-size: 12px; font-weight: 600; color: var(--red); }
.lu-saved { margin: -4px 0 0; font-size: 11px; color: var(--ink-3); }

/* ---------------------------------------------------------------- team report (A4 sheets, print to PDF) */

.report-page { display: grid; gap: 16px; }
.report-controls .head-tools { flex-wrap: wrap; justify-content: flex-end; }
.report-controls .searchbox { background: var(--card); }
.rc-matches { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-chip { position: relative; display: inline-grid; gap: 1px; padding: 8px 12px; border-radius: 10px; background: var(--tile); cursor: pointer; transition: background 0.15s ease, box-shadow 0.15s ease; }
.rc-chip input { position: absolute; opacity: 0; pointer-events: none; }
.rc-chip b { font-size: 12px; font-weight: 800; }
.rc-chip small { font-size: 11px; color: var(--ink-2); }
.rc-chip.on { background: rgba(184, 238, 60, 0.28); box-shadow: inset 0 0 0 2px var(--lime); }
.rc-chip:focus-within { outline: 2px solid var(--purple); outline-offset: 2px; }
.report { display: grid; justify-content: center; gap: 24px; }
/* the arrowheads drawn on the sheets: their outline is the text colour where they are defined, kept the sheets' ink */
.rp-defs { position: absolute; width: 0; height: 0; color: #121212; }

.sheet {
  color-scheme: light;
  --page: #f3f3f3; --panel: #e3e3e3; --card: #ffffff; --tile: #f3f3f3; --ink: #121212; --ink-2: #5f5f5f; --ink-3: #a1a1a1;
  --line: #ececec; --head: #e3e3e3; --band: #050505; --band-line: #2b2b2b; --box: #f3f3f3; --box-line: #dcdcdc;
  --chip: #ffffff; --chip-line: #dcdcdc; --crest-tile: #fafafa; --live: #3d7a0a; --purple-ink: #8b4ad3; --on-ink: #ffffff;
  --ink-accent: #b8ee3c; --hover: #fafafa; --tile-hover: #ececec; --soft: rgba(0, 0, 0, 0.06); --soft-2: rgba(0, 0, 0, 0.12);
}
.sheet .crest { background: var(--tile); box-shadow: none; }
.sheet { position: relative; display: flex; flex-direction: column; width: 210mm; min-height: 297mm; padding: 10mm 10mm 7mm; background: #fff; color: var(--ink); border-radius: 6px; box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08); font-size: 10px; line-height: 1.35; overflow: hidden; }
.sh-head { display: flex; align-items: center; gap: 14px; padding-bottom: 9px; margin-bottom: 12px; border-bottom: 2px solid var(--ink); }
.sh-brand { font-size: 18px; font-weight: 800; font-style: italic; letter-spacing: -0.03em; white-space: nowrap; }
/* the PSA mark (index.html's #psa-mark, in the sheet's text colour). On the sheets it takes the room "PSA Hub" took, so
   the head keeps its size; on the cover it is followed by "Hub", as in the site's top bar */
.sh-head .sh-brand { position: relative; }
.sh-word { visibility: hidden; }
.sh-mark { width: auto; aspect-ratio: 1225 / 228.67; fill: currentColor; stroke: none; }
.sh-head .sh-mark { position: absolute; top: 50%; left: 0; width: 100%; height: auto; transform: translateY(-50%); }
.cv-band .sh-mark { height: 0.82em; margin-right: 0.3em; vertical-align: -0.1em; }
.sh-sec { display: grid; padding-left: 14px; border-left: 1px solid #dcdcdc; }
.sh-sec small { font-size: 8.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.sh-sec b { font-size: 13px; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 0.06em; }
.sh-team { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; font-size: 13px; font-weight: 800; font-style: italic; text-transform: uppercase; text-align: right; }
.sh-body { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sh-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 8.5px; color: var(--ink-2); }
.sh-foot b { font-size: 11px; font-style: italic; color: var(--ink); }
.src-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: -0.5px; }
.src-dot.mock { background: var(--purple); }
.src-dot.coded { background: var(--lime); }
.src-dot.mixed { background: linear-gradient(90deg, var(--lime) 50%, var(--purple) 50%); }

.rh { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12px; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 0.02em; }
.rh small { font-weight: 600; font-style: normal; color: var(--ink-3); }
.rh .rp { font-style: normal; text-transform: none; font-size: 12px; }
.rlg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 6px; font-size: 9px; color: var(--ink-2); text-wrap: pretty; }
.k { display: inline-block; width: 9px; height: 9px; margin-right: 3px; vertical-align: -1px; }
.k.circle { border-radius: 50%; }
.k.square { border-radius: 2px; }
.k.diamond { transform: rotate(45deg) scale(0.8); }
.k.w { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.k.lime { background: var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink); }
.k.bad { background: #ff8a8a; box-shadow: inset 0 0 0 1.5px #7a1d1d; }
.k.dark { background: var(--ink); }
.k.yellow { background: #ffd84d; box-shadow: inset 0 0 0 1.5px var(--ink); }
.k.miss { box-shadow: inset 0 0 0 1.5px var(--ink-3); border-radius: 50%; }
.k.ln-k { width: 14px; height: 0; border-top: 2px solid #9a9a9a; vertical-align: 2px; }
.k.ln-k.lime { border-color: #8fbf1c; }
.k.ln-k.bad { border-top-style: dashed; border-color: #e5484d; }
.k.ln-k.dash { border-top-style: dashed; border-color: #6d6d6d; }

.rt-wrap { min-width: 0; }
.rt { width: 100%; border-collapse: collapse; font-size: 9.5px; font-variant-numeric: tabular-nums; }
.rt th { padding: 0 4px 5px; font-size: 8px; font-weight: 600; line-height: 1.2; color: var(--ink-3); text-align: right; vertical-align: bottom; white-space: nowrap; }
.rt td { padding: 4px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.rt th.l, .rt td.l { text-align: left; }
.rt td small { margin-left: 2px; font-size: 8px; color: var(--ink-3); }
.rt tr.grp td { padding: 9px 4px 4px; font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.rt tr.tot td { font-weight: 700; }
.rt.dense td { padding: 3.5px 3px; }
.rt td.none { color: var(--ink-3); }
.tc-bar { height: 6px; margin: 0 0 6px; border-radius: 3px; background: var(--purple); overflow: hidden; }
.tc-bar i { display: block; height: 100%; background: var(--lime-bar); }
.rt.tc th { text-align: center; }
.rt.tc td { text-align: center; }
.rt.tc td.l, .rt.tc th.l { text-align: left; }
.rp { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; color: var(--ink); }
.rp span { overflow: hidden; text-overflow: ellipsis; }
.rn { display: inline-grid; place-items: center; flex: none; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--ink); font-size: 8px; font-weight: 800; font-style: normal; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.kpi { display: grid; align-content: start; gap: 1px; padding: 8px 10px; border-radius: 8px; background: var(--tile); }
.kpi b { font-size: 19px; font-weight: 800; font-style: italic; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 9px; color: var(--ink-2); }
.kpi small { font-size: 8px; color: var(--ink-3); }

.rb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.rb-r { display: grid; gap: 10px; padding-top: 20px; min-width: 0; }

.rpitch { display: block; width: 100%; height: auto; border-radius: 4px; stroke: none; }
.rpitch .grass { fill: #2a8040; }
.rpitch .stripe { fill: #2e8a46; }
.rpitch .lines { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 0.35; }
.rpitch .spots { fill: rgba(255, 255, 255, 0.75); }
.rpitch .zone, .pitch .zone { stroke: rgba(255, 255, 255, 0.85); stroke-width: 0.45; stroke-dasharray: 1.6 1.2; }
.zone-t { font: 700 2.2px var(--font); fill: rgba(255, 255, 255, 0.85); text-anchor: middle; letter-spacing: 0.3px; }
.pitch .dir { fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 0.5; stroke-linecap: round; stroke-linejoin: round; }
.mk circle, .mk rect, .mk path { stroke-width: 0.3; }
.mk.w circle, .mk.w rect, .mk.w path { fill: #fff; stroke: #1a1a1a; }
.mk.lime circle, .mk.lime rect, .mk.lime path { fill: var(--lime); stroke: #1a1a1a; }
.mk.bad circle, .mk.bad rect, .mk.bad path { fill: #ff8a8a; stroke: #7a1d1d; }
.mk.dark circle, .mk.dark rect, .mk.dark path { fill: #1a1a1a; stroke: #fff; }
.mk.yellow path { fill: #ffd84d; stroke: #1a1a1a; }
.mk.red path { fill: #ff5a5a; stroke: #1a1a1a; }
.mk.miss circle, .mk.miss rect { fill: none; stroke: #fff; stroke-width: 0.35; stroke-dasharray: 0.6 0.45; }
.rgoal .mk.miss circle { stroke-width: 0.05; stroke-dasharray: 0.08 0.06; }
.rgoal .mk circle, .rgoal .mk path { stroke-width: 0.04; }
.mk text { font: 800 1.45px var(--font); fill: #1a1a1a; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.mk.dark text { fill: #fff; }
.ln { stroke: rgba(255, 255, 255, 0.85); stroke-width: 0.35; }
.ln.thin { stroke: rgba(255, 255, 255, 0.5); stroke-width: 0.22; }
.ln.bad { stroke: #ff8a8a; stroke-dasharray: 0.8 0.6; }
.ln.lime { stroke: var(--lime); stroke-width: 0.45; }
.ln.dash { stroke: #fff; stroke-dasharray: 1 0.8; }
.link { stroke: #fff; stroke-linecap: round; opacity: 0.92; }
.pd circle { fill: #fff; stroke: #1a1a1a; stroke-width: 0.35; }
.pd text { font: 800 2.7px var(--font); fill: #1a1a1a; text-anchor: middle; dominant-baseline: central; }
.pd .pd-name { font: 600 2.2px var(--font); fill: #fff; }
.pd.subbed circle { fill: rgba(255, 255, 255, 0.7); stroke-dasharray: 0.8 0.5; }
.sw .pd text { font-size: 3.6px; }

.gp { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 4px; }
.gp-cols { grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); font-size: 8.5px; font-weight: 700; color: var(--ink-2); text-align: center; }
.gp-rows { grid-row: 2; display: grid; grid-template-rows: repeat(3, 1fr); align-items: center; font-size: 8.5px; font-weight: 700; color: var(--ink-2); text-align: right; }
.gp-pitch { grid-row: 2; grid-column: 2; min-width: 0; }
.cell.lime { fill: var(--lime); }
.cell.purple { fill: var(--purple); }
.cell.better { fill: var(--lime); }
.cell.worse { fill: #e5484d; }
.cell.even { fill: #8f8f8f; }
.k.cmp { border-radius: 2px; }
.k.cmp.better { background: var(--lime); }
.k.cmp.worse { background: #e5484d; }
.k.cmp.even { background: #b9b9b9; }
.ln.high { stroke-dasharray: 1.1 0.8; }
.cell-p { font: 800 5.4px var(--font); fill: #fff; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: rgba(0, 0, 0, 0.4); stroke-width: 0.6; }
.cell-s { font: 600 2.7px var(--font); fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.4; }
.cell-line { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 0.35; stroke-dasharray: 1.2 1; }

.fms { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fm { display: grid; gap: 10px; min-width: 0; }
.fm.main { grid-row: span 4; }
.fm.alt { grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr); align-items: start; gap: 8px; }
.fm.alt .fv { padding: 1.5px 0; }
.fm.alt .fv-a, .fm.alt .fv-b { height: 14px; }
.fm-side h3 { margin: 0; font-size: 24px; font-weight: 800; font-style: italic; line-height: 1; }
.fm.alt .fm-side h3 { font-size: 18px; }
.fm-side p { margin: 2px 0 8px; color: var(--ink-2); }
.fm-side p b { font-size: 15px; color: var(--ink); }
.fv-head { display: flex; justify-content: space-between; font-size: 8px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.fv { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; gap: 6px; padding: 3px 0; border-top: 1px solid var(--line); }
.fv em { font-size: 8px; font-style: normal; color: var(--ink-2); text-align: center; text-transform: uppercase; letter-spacing: 0.03em; }
.fv-a, .fv-b { position: relative; display: flex; align-items: center; height: 16px; }
.fv-a { justify-content: flex-start; }
.fv-b { justify-content: flex-end; }
.fv-a i, .fv-b i { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.fv-a i { right: 0; background: rgba(184, 238, 60, 0.75); }
.fv-b i { left: 0; background: rgba(139, 74, 211, 0.35); }
.fv b { position: relative; font-size: 10px; font-variant-numeric: tabular-nums; }

.mh { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--band); color: #fff; }
.mh-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; font-weight: 800; font-style: italic; line-height: 1.1; text-transform: uppercase; }
.mh-team:last-child { flex-direction: row-reverse; text-align: right; }
.mh-team .crest { background: #fafafa; }
.mh-mid { display: grid; justify-items: center; gap: 4px; text-align: center; }
.mh-mid > b { font-size: 30px; font-weight: 800; font-style: italic; line-height: 1; white-space: nowrap; }
.mh-mid span { font-size: 9px; color: #bdbdbd; }
.mh .cv-src.mock { background: rgba(185, 140, 240, 0.2); color: #dcc7ff; }
.mh .cv-src.coded { background: rgba(184, 238, 60, 0.22); color: var(--lime); }
.mh .pill { padding: 5px 10px; font-size: 10px; background: var(--lime); }
.mg { display: grid; grid-template-columns: minmax(0, 1fr) 176px minmax(0, 1fr); gap: 12px; align-items: start; }
.mg-pitch .rlg { justify-content: center; }
.mg-dims { display: flex; justify-content: center; gap: 12px; margin: 5px 0 0; font-size: 9px; color: var(--ink-2); }
.rt.lu td { padding: 3.5px 3px; }
.rt.lu td.pos { width: 34px; font-size: 8px; font-weight: 700; color: var(--ink-3); text-align: left; }
.rt.lu tr.came-on td { color: var(--ink-2); }
.rt.lu tr.came-on .rn { box-shadow: inset 0 0 0 1px var(--ink-3); }
.evs { text-align: right; }
.evs svg.ev { width: 10px; height: 10px; margin-left: 4px; vertical-align: -1.5px; stroke: none; }
.evs small { margin-left: 1px; font-size: 8px; color: var(--ink-2); }
.ev.goal circle { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.ev.goal path { fill: var(--ink); }
.ev.yc rect { fill: #ffd84d; }
.ev.rc rect { fill: #ff5a5a; }
.ev.off path { fill: none; stroke: var(--red); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ev.on path { fill: none; stroke: #2f9e44; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sws { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.sw { min-width: 0; }
.sw h4 { margin: 0 0 3px; font-size: 10px; font-weight: 800; font-style: italic; }
.sw h4 small { font-weight: 600; font-style: normal; color: var(--ink-3); }

.bus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bu { display: grid; align-content: start; gap: 6px; min-width: 0; }
.bu-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin: 0; font-size: 9px; color: var(--ink-2); }
.bu-sum b { color: var(--ink); }

.fin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fin-l { display: grid; gap: 6px; min-width: 0; }
.fin-r { display: grid; gap: 12px; padding-top: 20px; min-width: 0; }
.rgoal { display: block; width: 100%; height: auto; border-radius: 4px; stroke: none; }
.sbins { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; height: 66px; }
.sbin { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 0; text-align: center; font-size: 8px; }
.sbin b { font-size: 10px; }
.sbin i { display: block; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--lime-bar); }
.sbin span { padding-top: 2px; color: var(--ink-3); white-space: nowrap; }

.sp2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sp2 h4 { margin: 0 0 3px; font-size: 8.5px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.05em; text-transform: uppercase; }
.zones-t { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: 4px 0 0; font-size: 8.5px; color: var(--ink-2); }
.zones-t b { color: var(--ink); }

.gloss { columns: 2; column-gap: 24px; }
.gloss div { break-inside: avoid; margin-bottom: 11px; }
.gloss h4 { margin: 0 0 3px; padding-bottom: 3px; border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 800; }
.gloss p { margin: 0; font-size: 9.5px; color: var(--ink-2); text-wrap: pretty; }
.gloss .gl-f, .gl-xg .gl-f { margin-top: 3px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.gl-xg { display: grid; gap: 6px; padding: 11px 13px 12px; border-radius: 8px; background: #f4f6ee; }
.xgb { stroke: none; }
.xgb.b1 { fill: #7cc03e; } .xgb.b2 { fill: #9ad73d; } .xgb.b3 { fill: #b8ee3c; } .xgb.b4 { fill: #f1fcd8; }
.xgk { display: inline-block; width: 16px; height: 9px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.xgk.b0 { background: #2a8040; } .xgk.b1 { background: #7cc03e; } .xgk.b2 { background: #9ad73d; } .xgk.b3 { background: #b8ee3c; }
.xgk.b4 { background: #f1fcd8; box-shadow: inset 0 0 0 1px #d4dcc0; }
.xgl circle { fill: var(--ink); }
.xgl text { font: 700 1.25px var(--font); fill: var(--ink); dominant-baseline: central; paint-order: stroke; stroke: rgba(255, 255, 255, 0.8); stroke-width: 0.35; }
.xgl.dim circle { fill: #fff; }
.xgl.dim text { fill: #fff; stroke: rgba(0, 0, 0, 0.35); }
.xg-key { margin-top: 6px; }
.xg-foot { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; }
.xg-foot p { margin: 0; font-size: 9.5px; color: var(--ink-2); text-wrap: pretty; }
.gl-xg p { margin: 0; font-size: 9.5px; color: var(--ink-2); text-wrap: pretty; }
.gl-xg p b { color: var(--ink); }
.gl-xg .gl-f.big { font-size: 12.5px; font-weight: 800; }
.gl-t { border-collapse: collapse; font-size: 9px; font-variant-numeric: tabular-nums; }
.gl-t th { padding: 2px 12px 2px 0; text-align: left; font-weight: 700; color: var(--ink-2); }
.gl-t td { padding: 2px 10px; text-align: center; border-left: 1px solid #dfe3d4; }
.gl-t tr:first-child td { font-weight: 700; }

.sheet.cover { padding: 0; }
.cv-band { display: grid; align-content: start; gap: 10px; min-height: 120mm; padding: 14mm 14mm 14mm; background: var(--band); color: #fff; }
.cv-band .sh-brand { font-size: 22px; }
.cv-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase; color: var(--lime); }
.cv-id { display: flex; align-items: center; gap: 18px; margin-top: auto; }
.cv-id .crest.xl { background: #fafafa; }
.cv-id h1 { margin: 0; font-size: 34px; font-weight: 800; font-style: italic; line-height: 1; text-transform: uppercase; }
.cv-id p { margin: 8px 0 0; font-size: 12px; color: #bdbdbd; }
.cv-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 10mm 14mm 0; }
.cv-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.cv-match { display: grid; min-width: 0; }
.cv-match b { font-size: 12px; }
.cv-match small { font-size: 9px; color: var(--ink-3); }
.cv-src { padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.cv-src.mock { background: rgba(139, 74, 211, 0.12); color: var(--purple); }
.cv-src.coded { background: rgba(184, 238, 60, 0.35); color: #3d5200; }
.cv-date { font-size: 10px; color: var(--ink-2); white-space: nowrap; }
.cv-notes { display: grid; gap: 6px; margin-top: auto; padding: 12px 14px; border-radius: 10px; background: var(--tile); }
.cv-notes p { margin: 0; font-size: 10px; color: var(--ink-2); text-wrap: pretty; }
.cv-notes p.cv-fine { font-size: 8.5px; color: var(--ink-3); }
.cv-notes b { color: var(--ink); }
.cover .sh-foot { margin: 10px 14mm 7mm; }

/* ---------------------------------------------------------------- a match's own page */

.match-page { display: grid; gap: 16px; }
.match-hero { background: var(--band); color: var(--ink); border-radius: var(--radius-lg); padding: 18px 22px 18px; }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; }
.mp-club { display: flex; align-items: center; gap: 16px; min-width: 0; font-size: 22px; font-weight: 800; font-style: italic; line-height: 1.15; text-transform: uppercase; }
.mp-club.home { justify-content: flex-end; text-align: right; }
.mp-club .crest { background: var(--crest-tile); }
.mp-mid { display: grid; justify-items: center; gap: 6px; text-align: center; }
.mp-score { font-size: 52px; font-weight: 800; font-style: italic; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-status { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.mp-status b { font-variant-numeric: tabular-nums; }
.mp-meta { font-size: 11px; color: var(--ink-3); }
.mp-goals { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--band-line); font-size: 12px; color: var(--ink-2); }
.mp-goals ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.mp-goals ul:first-child { text-align: right; }
.mp-goals b { margin-left: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mp-goals a:hover { color: var(--ink); }
.mp-ball svg { width: 14px; height: 14px; stroke: none; }
.mp-ball .mev.goal circle { fill: #fff; }
.mp-ball .mev.goal path { fill: #0b0b0c; }
.mp-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.mp-links a { font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--tile); border-radius: 999px; padding: 5px 11px; transition: background 0.15s ease, color 0.15s ease; }
.mp-links a:hover { background: var(--tile-hover); color: var(--ink); }
.mp-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "lineups stats" "lineups shots" "momentum momentum"; gap: 16px; align-items: start; }
.mp-lineups { grid-area: lineups; }
.mp-stats { grid-area: stats; }
.mp-shots { grid-area: shots; }
.mp-momentum { grid-area: momentum; }
.mp-lineups .head-tools .pill { background: var(--card); }
.lp circle { stroke: #fff; stroke-width: 0.3; }
.lp.home circle { fill: var(--lime-bar); }
.lp.away circle { fill: #a978ff; }
.lp text { font: 800 2.4px var(--font); fill: #0b0b0c; text-anchor: middle; dominant-baseline: central; }
.lp.away text { fill: #fff; }
.lp .lp-name { font: 600 2.1px var(--font); fill: #fff; }
.lineup-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.lineup-team { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12px; font-weight: 800; font-style: italic; text-transform: uppercase; }
.lineup-team span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-team small { margin-left: auto; font-size: 11px; font-weight: 700; font-style: normal; color: var(--ink-2); }
.lineup-list { display: grid; margin: 0; padding: 0; list-style: none; }
.lineup-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 2px; border-top: 1px solid var(--line); font-size: 12px; }
.lineup-list li.came-on { color: var(--ink-2); }
.lineup-list li.lu-subs { display: block; margin-top: 6px; padding: 8px 2px 4px; border-top: 2px solid var(--line); color: var(--ink-3); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.lineup-list .lpos { font-size: 10px; font-weight: 700; color: var(--ink-3); }
.lineup-list a { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.lineup-list a b { min-width: 18px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.lineup-list a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.levs { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.levs svg.mev { width: 11px; height: 11px; margin-left: 4px; stroke: none; }
.levs small { font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mev.goal circle { fill: #fff; stroke: #0b0b0c; stroke-width: 1; }
.mev.goal path { fill: #0b0b0c; }
.mev.yc rect { fill: #ffd84d; }
.mev.rc rect { fill: #ff5a5a; }
.mev.off path { fill: none; stroke: var(--red); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mev.on path { fill: none; stroke: #2f9e44; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ms { display: grid; gap: 2px; }
.ms-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; row-gap: 4px; padding: 6px 0; border-top: 1px solid var(--line); cursor: help; }
.ms-row:first-child { border-top: 0; }
.ms-row > b { font-size: 14px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.ms-row > b:last-of-type { text-align: right; }
.ms-row > span { font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: center; }
.ms-bar { grid-column: 1 / -1; display: flex; gap: 3px; height: 5px; }
.ms-bar i { display: block; height: 100%; border-radius: 3px; }
.ms-bar .h { background: var(--lime-bar); }
.ms-bar .a { background: var(--purple); }
.shot-mk { stroke: #fff; stroke-width: 0.3; }
.shot-mk.home { fill: var(--lime-bar); }
.shot-mk.away { fill: #a978ff; }
.shot-mk.off { fill-opacity: 0; stroke-width: 0.45; }
.shot-mk.off.home { stroke: var(--lime-bar); }
.shot-mk.off.away { stroke: #a978ff; }
.shot-mk.goal { stroke: #fff; stroke-width: 0.5; }

/* ---------------------------------------------------------------- coder timelines (js/timeline.js) */

/* ---------------------------------------------------------------- clips, and coding with no video */

.clips-panel .head-tools { flex-wrap: wrap; justify-content: flex-end; }
.clips-panel .head-tools .pill { background: var(--card); }
.clips-panel .head-tools .pill.danger { color: var(--red); }
.clips-panel .searchbox { background: var(--card); }
.clip-list { display: grid; gap: 4px; max-height: 300px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.clip-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto auto; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: var(--tile); }
.clip-list li.on { background: rgba(184, 238, 60, 0.3); box-shadow: inset 0 0 0 2px var(--lime); }
.clip-list li > b { font-size: 12px; font-style: italic; color: var(--ink-2); text-align: right; }
.clip-name { display: grid; min-width: 0; font-size: 12px; font-weight: 700; }
.clip-name small { overflow: hidden; font-size: 11px; font-weight: 500; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.clip-list .tbtn { height: 28px; min-width: 32px; background: var(--card); }
.coder.no-video .blind-clock { font-size: 64px; }

/* Player coding: what the next click tags on top of the pitch with the goal strip under it, the keys beside it */
.pc-armed-bar { flex: none; display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 10px 6px 7px; border-radius: 10px; background: var(--head); color: var(--ink); font-size: 13px; font-weight: 700; }
.pc-armed-bar .pc-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font-size: 14px; font-style: normal; }
.pc-armed-bar .pc-num.empty { background: var(--card); color: var(--ink-3); }
.pc-armed-bar .pc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-chip { padding: 2px 7px; border-radius: 5px; background: var(--card); font-size: 10.5px; font-style: normal; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.pc-go { margin-left: auto; color: var(--live); font-size: 11.5px; white-space: nowrap; }
/* the list of events under the video (FC Python's in Player coding, the presses in Live coding, the tags in Quick
   tags): newest first, × deletes on the spot */
.pc-events, .ev-panel { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ev-head { display: flex; flex: none; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--line); background: var(--tile); font-size: 12px; }
.ev-count { color: var(--ink-3); font-size: 11.5px; }
.ev-head .pill { padding: 4px 10px; font-size: 11px; box-shadow: inset 0 0 0 1px var(--chip-line); }
.ev-scroll { flex: 1 1 auto; min-height: 70px; overflow: auto; }
.ev-scroll .empty { padding: 14px; }
.ev-table { width: 100%; border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ev-table th { position: sticky; top: 0; z-index: 1; padding: 3px 6px; background: var(--card); color: var(--ink-3); font-size: 10.5px; font-weight: 600; text-align: left; }
.ev-table td { padding: 3px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.ev-table tr { cursor: pointer; }
.ev-table tbody tr:hover td, .ev-table tr.on td { background: color-mix(in srgb, var(--lime) 22%, var(--card)); }
.ev-t { color: var(--ink-2); }
.ev-e { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ev-e small { color: var(--ink-3); }
.ev-x { width: 1%; text-align: right; }
.sd { padding: 1px 5px; border-radius: 4px; font-size: 9.5px; font-weight: 800; }
.sd.home { background: var(--lime); color: var(--on-lime); }
.sd.away { background: color-mix(in srgb, var(--purple) 30%, var(--card)); }
.ev-del { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; color: var(--red); font-size: 13px; font-weight: 800; box-shadow: inset 0 0 0 1px var(--chip-line); }
.ev-table tr:hover .ev-del { background: #c0392b; color: #fff; box-shadow: none; }
.pc-hl circle { fill: var(--lime); stroke: #0b0b0c; stroke-width: 0.45; }
.pc-hl text { font: 800 2px var(--font); fill: #0b0b0c; text-anchor: middle; dominant-baseline: central; }
.pc-hl-line { stroke: var(--lime); stroke-width: 0.6; stroke-linecap: round; }
.pc-hl-end { fill: #fff; stroke: #0b0b0c; stroke-width: 0.35; }
#pc-hover { pointer-events: none; }
.ev-filter .menu-body { display: grid; gap: 8px; width: 300px; }
.ev-filter .menu-body label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ev-filter .menu-body .searchbox { width: 100%; background: var(--tile); }
.ev-filter-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-filter-tools .pill[disabled] { opacity: 0.5; }
.pc-at { display: inline-flex; gap: 4px; }
.pc-at .pc-time { width: 64px; font-variant-numeric: tabular-nums; }
.pc-clipset { display: flex; align-items: center; gap: 5px; font-weight: 500; }
.pc-clipset .searchbox { width: 58px !important; }
.sub-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px; gap: 10px; }
.sub-row label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sub-row .searchbox { width: 100%; background: var(--card); }
@media (max-width: 760px) { .sub-row { grid-template-columns: minmax(0, 1fr); } }
.pc-pitch-panel { grid-area: pitch; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px; }
.pc-pitch-panel .pc-note.warn { background: rgba(255, 200, 80, 0.22); }
.pc-pitch-panel .pc-note { margin: 0; padding: 7px 10px; }
.pc-pitch-wrap { position: relative; display: flex; flex: 0 1 auto; min-height: 120px; aspect-ratio: 111 / 74; }
.pc-pitch-wrap .pitch { width: 100%; height: 100%; aspect-ratio: auto; cursor: crosshair; }
.coder.lv-player .pc-goal { flex: none; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin: 0; padding: 5px 8px; }
.coder.lv-player .goalmouth { width: auto; height: 50px; }
.pc-foot { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 6px; }
.pc-foot .pc-onpitch { flex: 1 1 auto; min-width: 0; }
.pc-foot .pill { padding: 5px 11px; background: var(--tile); }
.coder.lv-player .pc-goal-side p { margin: 0 0 4px; font-size: 11px; line-height: 1.3; }
.coder.lv-player .pc-goal-btns { flex-wrap: nowrap; gap: 4px; }
.coder.lv-player .pc-goal-btns .pill { padding: 3px 9px; font-size: 11px; }
/* on a short screen the numbers to click give way to the pitch (typing the number is the quick way) */
@media (min-width: 1081px) and (max-height: 760px) { .coder.lv-player .pc-onpitch { display: none; } .pc-foot { justify-content: flex-end; } }
.pc-goal-side p { margin-bottom: 4px; font-size: 11.5px; }
.pc-nums { display: flex; flex-wrap: wrap; gap: 4px; }
.pnum { min-width: 30px; height: 26px; padding: 0 6px; border-radius: 7px; background: var(--tile); font-size: 12px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.pnum:hover { background: var(--tile-hover); }
.pnum.on { background: var(--ink); color: var(--ink-accent); }
.coder.lv-player .pc-onpitch { margin: 0; }
.pc-rail { grid-area: rail; min-width: 0; padding: 8px; container-type: inline-size; }
.pc-extras { display: grid; gap: 4px; margin: 0; }
.pc-group h4 { margin: 0 0 3px; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.pc-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 3px; }
.pc-group.set .pc-keys { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
/* with room (a phone, a wide screen), each group is one row with its name on the left */
@container (min-width: 340px) {
  .pc-group { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .pc-group:last-child { border-bottom: 0; }
  .pc-group h4 { margin: 8px 0 0; }
  .pc-keys { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
}
.pk { --kbg: var(--tile); display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 24px; padding: 2px 4px 2px 2px; border-radius: 7px; background: var(--kbg); color: var(--ink); font-size: 10.5px; font-weight: 700; text-align: left; transition: background 0.12s ease, color 0.12s ease; }
.pk span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk kbd { display: inline-grid; place-items: center; flex: none; min-width: 19px; height: 19px; padding: 0 3px; border-radius: 5px; background: var(--card); color: var(--ink); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); font-size: 10.5px; font-weight: 800; }
.pk.b { --kbg: color-mix(in srgb, var(--lime) 22%, var(--card)); }
.pk.d { --kbg: color-mix(in srgb, #5b8def 17%, var(--card)); }
.pk.s { --kbg: color-mix(in srgb, #2fb385 18%, var(--card)); }
.pk.x { --kbg: color-mix(in srgb, #ff6a5a 18%, var(--card)); }
.pk.m { --kbg: var(--card); box-shadow: inset 0 0 0 1.5px var(--chip-line); }
.pk:hover { filter: brightness(0.96); }
.pk[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; filter: none; }
.pk[aria-pressed="true"] kbd { background: var(--lime); color: var(--on-lime); }
@container (max-width: 150px) {
  .pc-keys, .pc-group.set .pc-keys { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); }
  .pk { justify-content: center; padding: 3px; }
  .pk span { display: none; }
}

/* the corner grips: drag to resize the video or the pitch, double-click for the balanced size */
.video-box { position: relative; }
.grip { position: absolute; right: 3px; bottom: 3px; z-index: 3; width: 18px; height: 18px; border-radius: 0 0 6px 0; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(200, 240, 78, 0.95) 50% 58%, transparent 58% 68%, rgba(200, 240, 78, 0.95) 68% 76%, transparent 76% 86%, rgba(200, 240, 78, 0.95) 86%); opacity: 0.75; }
.grip:hover { opacity: 1; }
.resizing { outline: 2px dashed var(--lime); outline-offset: 3px; }
.resize-cover { position: fixed; inset: 0; z-index: 90; cursor: nwse-resize; }
.popout { margin-left: auto; padding: 5px 10px; background: var(--tile); }
.coder.lv-map .layout-menu, .coder.lv-map .grip { display: none; }
.layout-menu .menu-body { display: grid; gap: 6px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; background: var(--tile); color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.tag-chip b { color: var(--live); font-style: italic; font-weight: 800; }
.tag-chip.away b { color: var(--purple-ink); }
.tag-chip small { color: var(--ink-3); }
.lb-short { display: none; }
@media (max-width: 1080px) {
  .screen-seg .lb-full, .tag-chip .lb-full { display: none; }
  .screen-seg .lb-short { display: inline; }
}
.live-inspect { display: grid; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--line); }
.li-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.li-head b { font-size: 13px; font-weight: 800; font-style: italic; }
.li-head label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); }
.live-inspect .searchbox { width: auto; max-width: 200px; padding: 5px 8px; font-size: 12px; background: var(--card); }
.li-time { width: 70px !important; font-variant-numeric: tabular-nums; }
.li-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.li-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 11px; font-weight: 700; }
.li-chip button { width: 18px; height: 18px; border-radius: 50%; color: var(--on-ink); font-size: 13px; line-height: 1; }
.li-chip button:hover { background: color-mix(in srgb, var(--on-ink) 20%, transparent); }
.li-chip.pressed { padding-right: 9px; background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--chip-line); }
.li-note { width: 100% !important; max-width: none !important; }
.li-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.li-actions .pill { background: var(--card); }
.li-actions .pill.danger { color: var(--red); }
.li-actions .muted { margin: 0; }
.mx-cell { min-width: 26px; padding: 2px 6px; border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-cell:hover { background: rgba(184, 238, 60, 0.4); }

/* a short laptop screen: the match header compact */
@media screen and (min-width: 761px) and (max-height: 640px) {
  .match-hero { padding: 10px 18px 12px; }
  .match-hero .back { margin-bottom: 2px; }
  .mp-grid { gap: 14px; }
  .mp-club { gap: 12px; font-size: 17px; }
  .mp-club .crest.xl { width: 52px; height: 52px; }
  .mp-score { font-size: 38px; }
  .mp-mid { gap: 3px; }
  .mp-goals { margin-top: 8px; padding-top: 8px; }
  .match-hero { position: relative; }
  .mp-links { position: absolute; top: 8px; right: 14px; margin: 0; }
  .mp-links a { padding: 3px 9px; font-size: 11px; }
}

/* ---------------------------------------------------------------- match rows: one look for every list of matches */

/* layout "a" (js/app.js MATCH_LAYOUTS): day bars, then a row per match: the time (or FT) | both teams stacked | each
   team's score, the winner's green and bold, the loser's red and grey | the group and venue | ›. The row opens the
   match page; the team names stay links to their team pages */
.mlines { display: grid; gap: 1px; overflow: hidden; border-radius: 10px; background: var(--line); container-type: inline-size; }
.mline { position: relative; color: var(--ink); display: grid; grid-template-columns: 66px minmax(0, 1fr) auto auto 12px; align-items: center; column-gap: 10px; min-height: 60px; padding: 7px 10px 7px 0; background: var(--card); transition: background 0.15s ease; }
.mline:hover { background: #fafafa; }
.mline:active { background: #f1f1f1; }
.mline-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.mline-link:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.mr-time { display: grid; align-self: stretch; place-content: center; justify-items: center; gap: 1px; border-right: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.mline.ft .mr-time { color: var(--ink-3); }
.mr-time small { color: var(--ink-3); font-size: 10.5px; font-weight: 600; }
.mr-live { color: var(--red); }
.mr-tbp { padding: 0 4px; color: var(--ink-3); font-size: 10px; font-weight: 600; line-height: 1.15; }
.mr-teams { display: grid; gap: 5px; min-width: 0; }
.mr-team { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; justify-self: start; max-width: 100%; min-width: 0; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.mr-team span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.mr-team.win { font-weight: 800; }
.mr-team.loss { color: var(--ink-3); font-weight: 500; }
.mr-note { color: var(--ink-2); font-size: 11px; font-weight: 600; }
.mr-score { display: grid; gap: 5px; justify-items: end; min-width: 12px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mr-score b { line-height: 22px; }
.mr-score .win { color: var(--win); }
.mr-score .loss { color: var(--loss); }
.mr-meta { display: grid; justify-items: end; gap: 3px; text-align: right; }
.mr-group { padding: 1px 7px; border-radius: 5px; background: var(--tile); color: var(--ink); font-size: 11px; font-weight: 700; white-space: nowrap; }
.mr-venue { max-width: 92px; color: var(--ink-3); font-size: 11px; font-weight: 600; line-height: 1.2; }
.mr-go { color: var(--ink-3); font-size: 18px; line-height: 1; }
.mline:hover .mr-go { color: var(--ink); }
/* a phone: the time column narrower, the venue on two lines, so the team names keep their room */
@container (max-width: 420px) {
  .mline { grid-template-columns: 54px minmax(0, 1fr) auto auto 8px; column-gap: 8px; padding-right: 8px; }
  .mr-venue { max-width: 58px; font-size: 10.5px; }
  .mr-team { gap: 6px; }
}
@container (max-width: 300px) {
  .mline { grid-template-columns: 56px minmax(0, 1fr) auto auto 8px; column-gap: 8px; }
  .mr-venue { display: none; }
  .mr-team { font-size: 13.5px; }
}
.matches-page { max-width: 900px; }
.mchips { display: flex; gap: 8px; margin: 0 -2px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.mchips::-webkit-scrollbar { display: none; }
.mchip { flex: none; padding: 8px 14px; border-radius: 9px; background: var(--card); box-shadow: inset 0 0 0 1px #dcdcdc; color: var(--ink); font-size: 13px; font-weight: 700; transition: background 0.15s ease; }
.mchip:hover { background: #fafafa; }
.mchip[aria-pressed="true"] { background: var(--ink); box-shadow: none; color: #fff; }

/* ---------------------------------------------------------------- the coder as one screen (as Sportscode is) */

/* coding a match, the coder is the whole window: the site's bar, rail and footer step aside (its back arrow returns) */
html.coding { scrollbar-gutter: auto; }
html.coding .topbar, html.coding .rail, html.coding .provenance { display: none; }
html.coding .app { display: block; max-width: none; padding: 8px; }

/* on a small screen the panels stack, the page scrolls */
.coder { grid-template-areas: "head" "video" "side" "dock"; }
.coder.lv-live { grid-template-areas: "head" "video" "pad" "stats" "dock"; }
.coder.lv-player { grid-template-areas: "head" "video" "pitch" "rail" "dock"; }
.coder.lv-map { grid-template-areas: "head" "video" "mid" "right"; }
.coder.lv-map .dock { display: none; }
.live-panel { grid-area: pad; }
.live-stats-panel { grid-area: stats; }
.q-mid { grid-area: mid; }
.q-right { grid-area: right; }
.dock { grid-area: dock; }

/* under the video: its clock on it, the controls, then the half markers */
.vclock { position: absolute; left: 6px; top: 5px; z-index: 2; padding: 1px 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); color: var(--lime); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; pointer-events: none; }
.vclock:empty, .coder.no-video .vclock { display: none; }
.transport { display: flex; flex-wrap: nowrap; align-items: center; gap: 3px; margin: 0; }
.transport .tbtn { height: 22px; min-width: 0; padding: 0 7px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.transport .tbtn.play { min-width: 30px; }
.transport .tbtn svg { width: 12px; height: 12px; }
.transport .tbtn[disabled] { opacity: 0.45; cursor: default; }
.transport .vtime { min-width: 0; margin: 0 2px; font-size: 11px; font-weight: 700; font-style: normal; color: var(--ink-2); }
.transport .popout { margin-left: auto; padding: 0 7px; }
.period-bar { display: flex; gap: 3px; margin: 0; padding: 0; border: 0; }
.phase { display: grid; flex: 1 1 0; place-items: center; min-width: 0; height: 22px; padding: 0 2px; overflow: hidden; border-radius: 4px; background: var(--tile); color: var(--ink-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.phase.on { background: var(--ink); color: var(--ink-accent); }
span.phase:not(.on) { color: var(--ink-3); }
.phase.next { background: var(--lime); color: var(--on-lime); cursor: pointer; }
.phase.next:hover { filter: brightness(0.95); }
.phase.undo { flex: 0 0 24px; background: var(--tile); color: var(--ink-2); cursor: pointer; }
.phase.undo:hover { background: var(--tile-hover); }

/* the events under the video (Live coding's presses, Quick tags' tags) */
.ev-hint { overflow: hidden; color: var(--ink-3); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.ev-team { color: var(--ink-2); font-size: 10.5px; }
.ev-panel .menu-body { width: 220px; }

/* the MD pad: boxy cells on thin grey lines, at a set size (the layout scales Sportscode's 124 x 36 px a button evenly to fit the
   height, never wider), the keys in red under the names; a running bar shows soft stripes and a dark edge at its foot */
.code-window { display: grid; grid-template-columns: repeat(var(--cols), var(--pad-cw, minmax(0, 1fr))); grid-auto-rows: var(--pad-ch, minmax(36px, auto)); gap: 1px; padding: 1px; background: #9c9c9c; }
.code-btn, .code-head { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 0 2px; overflow: hidden; border-radius: 0; background: var(--c); color: #0b0b0c; font-size: var(--pad-fs, 11px); font-weight: 800; line-height: 1.05; text-align: center; text-transform: uppercase; }
.code-btn .cb-face { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.code-btn kbd { padding: 0; border-radius: 0; background: none; box-shadow: none; color: #c0392b; font: inherit; font-size: calc(var(--pad-fs, 11px) - 1px); line-height: 1.05; }
.code-btn .cb-show { font-size: calc(var(--pad-fs, 11px) - 1px); font-weight: 700; line-height: 1.05; text-transform: none; color: #3a3a3e; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code-btn.dark, .code-head.dark { color: #fff; }
.code-btn.dark kbd, .code-btn.dark .cb-show { color: #fff; }
.code-btn.half, .code-head.half { padding: 0 1px; font-size: calc(var(--pad-fs, 11px) - 1px); }
.code-btn:hover { filter: brightness(0.95); }
.code-btn:active { filter: brightness(0.86); }
.code-btn.hit { animation: hit 0.35s ease-out; }
.code-btn.running { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0 4px, transparent 4px 8px); box-shadow: inset 0 -3px 0 #111; }
.code-btn.latched { box-shadow: inset 0 -3px 0 #111; filter: brightness(0.94); }
.code-window.report .code-btn { cursor: pointer; }
.cb-n { font-size: calc(var(--pad-fs, 11px) - 1px); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }

/* the press log: one line a press, a little under a button's height and text, the newest on the right ringed inside */
.press-log { display: flex; gap: 2px; width: 0; min-width: 100%; height: calc(var(--pad-ch, 30px) * 0.8 + 2px); padding: 1px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.press-log::-webkit-scrollbar { display: none; }
.pl-item { display: flex; flex: none; align-items: center; gap: 4px; height: 100%; padding: 0 4px; border-radius: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); color: #0b0b0c; font-size: calc(var(--pad-fs, 11px) - 1px); font-weight: 800; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.pl-item small { font-size: calc(var(--pad-fs, 11px) - 2px); font-weight: 600; opacity: 0.6; }
.pl-item.dark { color: #fff; }
.pl-item.stop { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--c), inset 0 0 0 2px rgba(0, 0, 0, 0.12); }
.pl-item:last-child { box-shadow: inset 0 0 0 2px var(--ink); }
.press-empty { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.press-empty .pill { padding: 1px 8px; font-size: 10.5px; background: var(--lime); color: var(--on-lime); }

/* the live stats, dense as in the MD window: possession, by third, every 5 minutes, then the table home | stat | away */
.live-stats-panel { display: flex; flex-direction: column; }
.ls-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.ls { display: grid; gap: 4px; font-size: 11px; }
.ls-poss { display: flex; align-items: center; gap: 6px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: help; }
.ls-bar { flex: 1; height: 10px; overflow: hidden; border-radius: 5px; background: #ef4a55; }
.ls-bar i { display: block; height: 100%; background: #8fee6a; }
.ls-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: start; }
.ls h4 { margin: 2px 0 1px; overflow: hidden; color: var(--ink-3); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.ls-thirds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; cursor: help; }
.ls-thirds span { padding: 2px 0; border-radius: 3px; background: color-mix(in srgb, #8fee6a 24%, var(--card)); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.ls-thirds.away span { background: color-mix(in srgb, #ef4a55 18%, var(--card)); }
.ls-five { display: grid; grid-template-columns: repeat(var(--bins), minmax(0, 1fr)); gap: 2px; height: 28px; }
.ls-five span { display: flex; flex-direction: column; overflow: hidden; border-radius: 2px; background: var(--tile); cursor: help; }
.ls-five i { flex: none; background: #ef4a55; }
.ls-five u { flex: 1; background: #8fee6a; }
.ls-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.ls-table th { padding: 1px 3px; color: var(--ink-3); font-size: 9px; font-weight: 700; text-align: center; }
.ls-table td { padding: 1.5px 4px; border-top: 1px solid var(--line); white-space: nowrap; }
.ls-table td.n { width: 40px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.ls-table td.h { background: color-mix(in srgb, #8fee6a 12%, var(--card)); }
.ls-table td.a { background: color-mix(in srgb, #ef4a55 9%, var(--card)); }
.ls-table tr { cursor: help; }

/* the window menu in the coder's bar */
.win-menu .menu-body { left: 0; right: auto; width: 270px; }
.win-list { display: grid; gap: 4px; }
.win-list .pill[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* the dock: its tabs (and the open tab's tools, on the right) on one line, the open list under them */
.dock { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; overflow: hidden; border-radius: 6px; background: var(--card); }
.dock.closed { grid-template-rows: auto; }
.dock.closed .dock-pane { display: none; }
.dock-tabs { display: flex; align-items: center; gap: 2px; min-height: 22px; padding: 2px 4px; border-bottom: 1px solid var(--line); }
.dock.closed .dock-tabs { border-bottom: 0; }
.dock-tabs [data-dock] { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 4px; color: var(--ink-3); font-size: 11px; font-weight: 600; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease; }
.dock-tabs [data-dock]:hover { background: var(--tile); color: var(--ink); }
.dock-tabs [data-dock][aria-selected="true"] { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.dock.closed .dock-tabs [data-dock][aria-selected="true"] { background: var(--tile); color: var(--ink); }
.dock-tabs .chip { padding: 0 5px; font-size: 9px; letter-spacing: 0; }
.dock-tabs [aria-selected="true"] .chip { background: color-mix(in srgb, var(--on-ink) 18%, transparent); color: var(--on-ink); }
.dock.closed .dock-tabs [aria-selected="true"] .chip { background: var(--soft); color: var(--ink-2); }
.dock-fold { width: 22px; height: 18px; margin-left: auto; border-radius: 4px; color: var(--ink-2); font-size: 11px; }
.dock-fold:hover { background: var(--tile); }
.dock-panes { display: contents; }
.dock-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dock-pane[hidden] { display: none; }
.pane-tools { position: absolute; top: 2px; right: 30px; display: flex; align-items: center; gap: 6px; height: 18px; }
.pane-tools .pill, .pane-tools summary.pill { padding: 1px 8px; background: var(--tile); font-size: 10.5px; }
.pane-tools .pill.danger { color: var(--red); }
.pane-tools .seg button { padding: 0 7px; font-size: 10.5px; }
.pane-tools .searchbox { height: 18px; padding: 0 6px; font-size: 10.5px; }
.pane-tools .menu-body { top: calc(100% + 4px); }
.tl-hint { color: var(--ink-3); font-size: 10px; white-space: nowrap; }
.pane-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 6px; }
.live-tl-body, #pc-tl { position: relative; padding: 0; }
.live-tl-body > #live-timeline { height: 100%; }
.li-float { position: absolute; top: 20px; right: 6px; z-index: 6; width: min(560px, 72%); max-height: calc(100% - 24px); overflow: auto; }
.li-float .li-head { flex-wrap: wrap; }
.li-close { width: 20px; height: 20px; margin-left: auto; border-radius: 5px; color: var(--ink-2); font-size: 14px; }
.li-close:hover { background: var(--tile); }
.dock .empty { padding: 10px; }
.clips-panel .clip-list { max-height: none; }

/* the Report tab: the main figures by half */
.lr-table { border-collapse: collapse; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.lr-table th, .lr-table td { padding: 1px 6px; text-align: center; white-space: nowrap; }
.lr-table thead th { position: sticky; top: 0; background: var(--card); color: var(--ink-3); font-size: 9px; font-weight: 700; }
.lr-table tbody th { font-weight: 600; text-align: left; }
.lr-table tbody tr.home td { background: color-mix(in srgb, #8fee6a 12%, var(--card)); }
.lr-table tbody tr.away td { background: color-mix(in srgb, #ef4a55 9%, var(--card)); }
.lr-table tr.total th, .lr-table tr.total td { border-bottom: 1px solid var(--line); font-weight: 800; }

/* the timelines, drawn as a Sportscode timeline: a dark track, the timecode ruler with the playhead's time on its
   left, numbered rows coloured as their buttons, numbered boxes and bars carrying their labels, a red playhead */
.stl { --pps: 1px; --lw: 110px; --rh: 20px; height: 100%; min-width: 0; }
.stl-scroll { position: relative; height: 100%; overflow: auto; background: #2a2a2a; cursor: grab; }
.stl-scroll.panning { cursor: grabbing; }
.stl-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.stl-scroll::-webkit-scrollbar-thumb { border-radius: 3px; background: #5a5a5a; }
.stl-scroll::-webkit-scrollbar-track, .stl-scroll::-webkit-scrollbar-corner { background: #1b1b1b; }
.stl-inner { position: relative; min-width: 100%; min-height: 100%; }
.stl-ruler { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); height: 17px; background: #1b1b1b; color: #ddd; }
.stl-tc { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; justify-content: center; border-right: 1px solid #444; background: #1b1b1b; color: #fff; font: 600 9.5px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.stl-ticks { position: relative; overflow: hidden; background-image: linear-gradient(90deg, #9a9a9a 1px, transparent 1px), linear-gradient(90deg, #5c5c5c 1px, transparent 1px); background-repeat: repeat-x; background-position: 0 100%, 0 100%; background-size: var(--major, 80px) 7px, var(--minor, 16px) 4px; }
.stl-times b { position: absolute; bottom: 7px; color: #c8c8c8; font: 400 8px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: nowrap; transform: translateX(-50%); }
.stl-ph { position: absolute; top: 0; bottom: 0; z-index: 3; width: 6px; margin-left: -3px; border-radius: 0 0 2px 2px; background: #e33; }
.stl-row { display: grid; grid-template-columns: 16px calc(var(--lw) - 16px) minmax(0, 1fr); height: var(--rh); border-bottom: 1px solid #1b1b1b; }
.stl-no { position: sticky; left: 0; z-index: 2; display: grid; place-items: center; background: #1b1b1b; color: #aaa; font-size: 8.5px; }
.stl-label { position: sticky; left: 16px; z-index: 2; display: flex; align-items: center; gap: 4px; min-width: 0; padding: 0 4px; overflow: hidden; border-right: 1px solid #444; background: var(--c); color: #0b0b0c; font-size: 9px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; cursor: default; }
.stl-row.dark .stl-label { color: #fff; }
.stl-label small { font-weight: 600; opacity: 0.7; }
.stl-track { position: relative; background: color-mix(in srgb, var(--c) 38%, #fff); }
.stl-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0 4px, transparent 4px 8px); }
.stl-item { position: absolute; top: 2px; bottom: 2px; display: flex; align-items: center; overflow: hidden; border: 1px solid #333; border-radius: 0; color: #222; font-size: 8px; line-height: 1; white-space: nowrap; }
.stl-item.bar { padding: 0 3px; background: var(--c); font-weight: 600; }
.stl-item.bar span { overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.stl-item.bar.dark { color: #fff; }
.stl-item.box { justify-content: center; min-width: 13px; padding: 0 2px; background: #fff; font-weight: 700; transform: translateX(-1px); }
.stl-item:hover { filter: brightness(0.92); }
.stl-item.sel { z-index: 3; overflow: visible; outline: 2px solid #e33; }
.stl-h { position: absolute; top: -3px; bottom: -3px; width: 7px; background: #e33; cursor: ew-resize; }
.stl-h.l { left: -5px; }
.stl-h.r { right: -5px; }
.stl-now { position: absolute; top: 0; bottom: 0; z-index: 3; width: 1px; background: #e33; pointer-events: none; }
.stl-half { position: absolute; top: 17px; bottom: 0; z-index: 1; width: 0; border-left: 1px dashed rgba(255, 255, 255, 0.55); pointer-events: none; }
.tl-zoom .menu-body { width: 190px; }

/* Quick tags: the events and the pitch, the players beside them */
/* Quick tags, FC Python's screen in one: boxy lists on 1 px lines */
.q-mid, .q-right { gap: 5px; }
.q-mid h4, .q-totals h4 { margin: 0; color: var(--ink-3); font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.q-team { display: grid; grid-template-columns: 1fr 1fr; flex: none; border: 1px solid var(--chip-line); }
.q-team button { padding: 3px 0; font-size: 10.5px; font-weight: 800; }
.q-team button[aria-pressed="true"] { background: var(--ink); color: var(--ink-accent); }
.q-players, .q-events { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; border: 1px solid var(--chip-line); background: var(--chip-line); }
.q-players { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.q-events { flex: none; }
.q-pl, .q-ev { display: flex; align-items: center; gap: 4px; min-width: 0; height: var(--q-ph, 24px); padding: 0 4px; overflow: hidden; background: var(--card); font-size: var(--q-pf, 11.5px); font-weight: 600; text-align: left; white-space: nowrap; }
.q-pl b { display: inline-grid; flex: none; place-items: center; min-width: 16px; height: 14px; background: var(--lime); color: var(--on-lime); font-size: 9px; font-weight: 800; }
.q-pl span, .q-ev span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.q-pl small { margin-left: auto; color: var(--ink-3); font-size: 8px; font-weight: 700; }
.q-pl:hover { background: var(--hover); }
.q-ev:hover { background: var(--tile-hover); }
.q-pl[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.q-ev { gap: 5px; background: var(--tile); font-weight: 700; }
.q-ev kbd { flex: none; min-width: 14px; padding: 1px 3px; border: 1px solid var(--chip-line); border-radius: 0; background: var(--card); color: var(--ink); font: 800 9px/1 var(--font); text-align: center; }
.q-ev[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.q-ev[aria-pressed="true"] kbd { border-color: var(--lime); background: var(--lime); color: var(--on-lime); }
.q-tagtools { display: flex; flex: none; gap: 4px; }
.q-tagtools .pill, .q-tools .pill, .q-tools summary.pill { padding: 1px 7px; border: 1px solid var(--chip-line); border-radius: 4px; background: var(--card); font-size: 10px; }
.q-right .pc-armed-bar { flex: none; }
.tag-pitch { min-height: 0; }
.q-old line { stroke: #fff; stroke-width: 0.4; }
.q-old { opacity: 0.45; }
.q-old circle { fill: #fff; }
.q-lit line { stroke: #c8f04e; stroke-width: 0.6; }
.q-lit circle { fill: #c8f04e; stroke: #111; stroke-width: 0.3; }
.q-lit rect { fill: #111; }
.q-lit text { fill: #c8f04e; font: 700 2.2px var(--font); text-anchor: middle; }
.q-dir { fill: #fff; fill-opacity: 0.85; font: 800 2.5px var(--font); }
.q-dir.end { text-anchor: end; }
.q-totals { flex: none; }
.q-totals .ls-table th:first-child, .q-totals .ls-table th:last-child { width: 60px; }
.q-tools { display: flex; flex: none; align-items: center; gap: 4px; color: var(--ink-3); font-size: 9.5px; }
.q-note { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.q-pitch-menu .menu-body { top: auto; bottom: calc(100% + 6px); width: 240px; }
.q-tag-list { display: grid; gap: 6px; margin: 0; padding-left: 22px; }
.q-tag-list li { display: flex; gap: 6px; align-items: center; }
.q-tag-list .searchbox { flex: 1; background: var(--card); }
.q-log th.n, .q-log td.n { text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink-2); }
.q-log .ev-p { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
/* the scrubber under the video: where it is, a tick per event, a click goes there (Quick tags) */
.scrub { position: relative; flex: none; height: 6px; border-radius: 3px; background: var(--box-line); cursor: pointer; }
.scrub > i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 3px; background: var(--ink); }
.scrub u { position: absolute; top: -2px; width: 2px; height: 10px; background: var(--lime-bar); pointer-events: none; }
.coder:not(.lv-map) .scrub, .coder.no-video .scrub, .coder.cam .scrub { display: none; }
.tclock { margin-left: auto; color: var(--ink); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coder.lv-map .vclock { display: none; }
.coder.lv-map:not(.no-video):not(.cam) .period-bar { display: none; }

/* a laptop or bigger: one screen, no page scroll; only panels scroll, inside themselves */
@media screen and (min-width: 1081px) {
  html.coding { overflow: hidden; }
  html.coding .app { padding: 0; }
  .coder { height: 100vh; height: 100dvh; padding: 5px; gap: 5px; grid-template-rows: auto minmax(0, 1fr) auto; align-items: stretch; }
  .coder.lv-live { grid-template-columns: var(--video-w, 330px) max-content minmax(0, 1fr); grid-template-areas: "head head head" "video pad stats" "dock dock dock"; }
  .coder.lv-player { grid-template-columns: var(--video-w, minmax(0, 42fr)) minmax(var(--pitch-w, 0px), 1fr) var(--rail-w, 230px); grid-template-areas: "head head head" "video pitch rail" "dock dock dock"; }
  .coder.lv-map { grid-template-columns: var(--video-w, 330px) var(--q-mid, 250px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "head head head" "video mid right"; }
  .dock { height: var(--dock-h, 236px); }
  .dock.closed { height: auto; }

  /* the slim bar */
  .coder-head { flex-wrap: nowrap; gap: 8px; min-height: 34px; padding: 0 8px; border-radius: 6px; background: var(--band); font-size: 11px; }
  .coder-head .back { flex: none; }
  .coder-title { flex: none; font-size: 13px; }
  .src-chip { padding: 4px 8px; border-radius: 6px; font-size: 11px; }
  .src-chip svg { width: 13px; height: 13px; }
  .screen-seg { flex: none; border-radius: 7px; background: var(--tile); }
  .screen-seg button { padding: 3px 9px; border-radius: 5px; color: var(--ink-2); font-size: 11px; }
  .screen-seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
  .coder-head summary.pill, .coder-head .win-chip { padding: 4px 8px; border-radius: 6px; background: var(--tile); color: var(--ink-2); font-size: 11px; font-weight: 600; }
  .coder-head summary.pill:hover { background: var(--tile-hover); color: var(--ink); }
  .coder-actions { flex-wrap: nowrap; gap: 6px; min-width: 0; }
  .tagger-menu summary, .coder-head .saved { color: var(--ink-3); font-size: 11px; }
  .coder-head .tag-chip { padding: 3px 8px; border-radius: 6px; background: var(--tile); font-size: 11px; }

  /* panels: small padding, no shadows; each holds its own scroll */
  .coder > .panel, .level-side > .panel { min-height: 0; padding: 5px; overflow: hidden; border-radius: 6px; background: var(--card); box-shadow: none; }
  .coder > .panel > .panel-body, .level-side > .panel > .panel-body { padding: 0; border-radius: 0; }
  .coder-video { display: flex; flex-direction: column; gap: 4px; }
  .coder-video > .panel-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-height: 0; }
  .coder-video > .src-row, .coder-video .video-box, .coder-video .transport, .coder-video .period-bar { flex: none; }
  .coder-video .src-row { min-height: 0; padding: 0; }
  .coder-video .src-row .video-form { gap: 4px; }
  .coder-video .src-row .searchbox { padding: 3px 8px; font-size: 11px; }
  .coder-video .src-row .pill { padding: 3px 10px; background: var(--lime); color: var(--on-lime); font-size: 11px; }
  .coder-video .src-row .searchbox { background: var(--tile); }
  .coder-video .keys { display: none; }
  .video-frame { border-radius: 4px; }
  .coder.vcap .video-frame { height: var(--video-h); aspect-ratio: auto; }
  .transport .vtime { white-space: nowrap; }
  .video-empty { gap: 8px; padding: 10px; font-size: 11px; }
  .video-empty .pill { padding: 5px 10px; font-size: 11px; }
  .level-under { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
  .pc-events, .ev-panel { border-radius: 4px; }
  .ev-head { flex-wrap: nowrap; padding: 2px 5px; overflow: hidden; font-size: 11px; white-space: nowrap; }
  .ev-head .ev-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ev-head .pill, .ev-head summary.pill { padding: 1px 8px; font-size: 10.5px; }
  .ev-scroll { min-height: 0; }
  .ev-table { font-size: 10.5px; }
  .ev-table td { padding: 1.5px 5px; }
  .ev-del { width: 16px; height: 16px; font-size: 11px; }

  /* Live coding: the press log and the pad at its set size in the middle (any spare width is the video's and the
     stats'), the stats on the right */
  .live-panel { display: flex; flex-direction: column; gap: 4px; }
  .live-panel #live-window { align-self: flex-start; }

  /* Player coding: the pitch panel and the keys at a set size */
  .pc-pitch-panel { gap: 4px; }
  .pc-armed-bar { min-height: 28px; padding: 3px 8px 3px 5px; border-radius: 4px; font-size: 12px; }
  .pc-armed-bar .pc-num { min-width: 22px; height: 22px; font-size: 12px; }
  .pc-pitch-panel .pc-note { padding: 4px 8px; font-size: 11px; }
  .pc-foot { flex-wrap: nowrap; }
  .pc-pitch-wrap { width: 100%; max-width: var(--pitch-max, none); align-self: center; }
  .pc-foot .pc-onpitch { overflow-x: auto; scrollbar-width: none; }
  .pc-foot .pc-nums { flex-wrap: nowrap; }
  .pc-rail { padding: 6px; overflow: hidden; }
  .pc-rail .pc-extras { gap: 3px; }
  .pc-rail .pc-group { display: block; padding: 0; border: 0; }
  .pc-rail .pc-group h4 { margin: 1px 0 2px; font-size: calc(9px * var(--key-s, 1)); }
  .pc-rail .pc-keys, .pc-rail .pc-group.set .pc-keys { grid-template-columns: repeat(3, calc(76px * var(--key-s, 1))); gap: 3px; }
  .pc-rail .pk { justify-content: flex-start; min-height: calc(24px * var(--key-s, 1)); padding: 1px 3px 1px 2px; border-radius: 4px; font-size: calc(10.5px * var(--key-s, 1)); }
  .pc-rail .pk span { display: inline; }
  .pc-rail .pk kbd { min-width: calc(19px * var(--key-s, 1)); height: calc(19px * var(--key-s, 1)); border-radius: 3px; font-size: calc(10.5px * var(--key-s, 1)); }

  /* Quick tags: the pitch takes the height left */
  .tag-pitch { display: grid; flex: 1 1 auto; }
  .tag-pitch .pitch { width: 100%; height: 100%; max-height: 100%; }
  /* the match's totals fill a big screen's spare height; a laptop keeps it for the pitch */
  @media (max-height: 700px) { .q-totals { display: none; } }
}

/* the pad and the timeline in windows of their own (js/coder.js, coder-pane.html): Pop out where that works (a
   laptop or bigger, with a mouse: .can-detach), and a slim note with Bring back in the place of what is out. The
   video in a window of its own (Pop out, picture-in-picture) leaves its column to the tagging */
.win-btn { display: inline-flex; flex: none; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--tile); color: var(--ink-2); font-size: 10.5px; font-weight: 700; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease; }
.win-btn:hover { background: var(--tile-hover); color: var(--ink); }
.win-btn svg { flex: none; width: 12px; height: 12px; }
.win-btn.lime { background: var(--lime); color: var(--on-lime); }
.win-btn[hidden], .pane-open { display: none; }
.coder.can-detach .pane-open { display: inline-flex; }
.pad-bar { display: contents; }
.coder.can-detach .pad-bar { display: flex; align-items: center; gap: 4px; width: 0; min-width: 100%; }
.coder.can-detach .pad-bar .press-log { flex: 1 1 auto; width: auto; min-width: 0; }
.pad-bar .pane-open { height: calc(var(--pad-ch, 30px) * 0.8 + 2px); border-radius: 4px; }
.pane-tools .win-btn { height: 18px; }
.pc-rail { position: relative; }
.pc-rail > .pane-open { position: absolute; top: 5px; right: 5px; z-index: 1; height: 18px; }
.win-away { display: none; align-items: center; gap: 8px; min-width: 0; min-height: 26px; padding: 3px 4px 3px 8px; overflow: hidden; border-radius: 5px; background: var(--tile); color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.coder.pad-out .win-away[data-away="pad"], .dock-tabs .win-away { display: flex; }
.win-away > svg { flex: none; color: var(--ink-3); }
.win-away > span:not(.dot):not(.grow) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.win-away .muted { color: var(--ink-3); font-weight: 500; }
.win-away .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--win); box-shadow: 0 0 0 2px color-mix(in srgb, var(--win) 25%, transparent); }
.win-away .win-btn { padding: 2px 9px; background: var(--card); }
.dock-tabs .win-away { flex: 0 1 auto; min-height: 20px; margin-right: 6px; padding: 1px 3px 1px 8px; }
.dock-tabs .win-away .win-btn { padding: 1px 8px; }
.coder.pad-out .live-panel, .coder.pad-out .pc-rail, .coder.tl-out .dock-pane[data-pane="timeline"] { display: none; }
.coder.pad-out .pc-pitch-panel > .win-away, .coder.pad-out .live-stats-panel > .win-away { flex: none; }
.coder.pad-out .live-stats-panel { gap: 5px; }

@media screen and (min-width: 1081px) {
  /* the pad out: the video and the stats share the width; the keys out: the video and the pitch */
  .coder.lv-live.pad-out { grid-template-columns: var(--video-w, minmax(0, 1.25fr)) minmax(0, 1fr); grid-template-areas: "head head" "video stats" "dock dock"; }
  .coder.lv-player.pad-out { grid-template-columns: var(--video-w, minmax(0, 42fr)) minmax(var(--pitch-w, 0px), 1fr); grid-template-areas: "head head" "video pitch" "dock dock"; }
  /* the video out (its own window or picture-in-picture): its column shrinks to a card with the controls, the halves
     and the events; Live coding's pad fills the room, its buttons stretched both ways; with the pad out too, the
     stats take it */
  .coder.lv-live.video-out { grid-template-columns: var(--video-w, 232px) minmax(0, 1.2fr) minmax(0, 1fr); }
  .coder.lv-live.video-out.pad-out { grid-template-columns: var(--video-w, 232px) minmax(0, 1fr); }
  .coder.video-out .video-box { height: auto !important; }
  .coder.video-out .video-frame { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
  .coder.video-out .video-away { display: grid; }
  .coder.video-out .vclock:not(:empty) { position: static; display: inline-block; align-self: flex-start; margin: 0 0 4px; padding: 2px 7px; background: var(--ink); color: var(--ink-accent); font-size: 13px; }
  .coder.video-out .video-box { display: flex; flex-direction: column; }
  .coder.video-out .grip, .coder.video-out .scrub, .coder.video-out .transport .popout, .coder.video-out .transport .float { display: none; }
  .coder.video-out .phase .lb-full { display: none; }
  .coder.video-out .phase .lb-short { display: inline; }
  .coder.lv-live.video-out .live-panel #live-window { align-self: stretch; flex: 1 1 auto; min-height: 0; }
  .coder.lv-live.video-out #live-window .code-window { height: 100%; box-sizing: border-box; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
}
.video-away { display: none; justify-items: start; gap: 6px; padding: 8px 9px 9px; border-radius: 4px; background: var(--tile); color: var(--ink-2); text-align: left; }
.video-away p { margin: 0; font-size: 11px; line-height: 1.35; }
.video-away .row { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 11.5px; font-weight: 700; }
.video-away .row svg { width: 13px; height: 13px; color: var(--ink-3); }
.video-away .pill { padding: 5px 10px; font-size: 11px; }

/* a laptop's short screen: thinner timeline rows, which scroll inside the dock */
@media screen and (min-width: 1081px) and (max-height: 599px) { .stl { --rh: 14px; } }

/* the dock on a small screen: its tools above the list */
@media screen and (max-width: 1080px) {
  .pane-tools { position: static; flex-wrap: wrap; height: auto; padding: 6px 8px 0; }
  .pane-body { max-height: 70vh; }
  .stl, .stl-scroll { height: auto; }
  .stl-scroll { max-height: 60vh; }
  .li-float { position: static; width: auto; max-height: none; margin: 6px; }
  .tl-hint { display: none; }
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: #1c1c1e;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
  z-index: 10;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--lime); }

/* ---------------------------------------------------------------- responsive */

@media screen and (max-width: 1240px) {
  .dash .players { grid-column: span 5; }
  .dash .momentum { grid-column: span 7; }
  .dash .stats, .dash .news { grid-column: span 6; }
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .event-chip { display: none; }
}

@media screen and (max-width: 1080px) {
  .dash .players, .dash .momentum, .dash .stats, .dash .news { grid-column: 1 / -1; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-cols { grid-template-columns: minmax(0, 1fr); }
  .fixture { grid-template-columns: 56px minmax(0, 1fr) 56px minmax(0, 1fr) 34px; }
  .fixture-venue { display: none; }
  .team-page { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "next" "fixtures" "goals" "squad" "group" "news"; }
  .team-hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .player-page { grid-template-columns: minmax(0, 1fr); }
  .pp-main, .pp-side { display: contents; }
  .pp-next { order: 1; }
  .pp-goals { order: 2; }
  .pp-extra { order: 3; }
  .pp-mates { order: 4; }
  .pp-group { order: 5; }
  .grip, .layout-menu, .popout { display: none; }
  .pc-pitch-wrap .pitch { height: auto; aspect-ratio: 111 / 74; }
  .coder-steps { grid-template-columns: minmax(0, 1fr); }
  .coder.no-video .blind-clock { font-size: 40px; }
  .f-label, .f-role, .f-adds { flex-basis: 100%; }
  .f-num { flex: 1 1 64px; }
  .editor .dialog-actions { flex-wrap: wrap; }
  .editor-top .searchbox { width: 160px; }
  .f-team { flex: 1 1 150px; }
  .mp-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lineups" "stats" "shots" "momentum"; }
  .lu-cols { grid-template-columns: minmax(0, 1fr); }
}

@media screen and (max-width: 900px) {
  .report { justify-content: stretch; }
  .sheet { width: 100%; min-height: 0; padding: 16px 14px 12px; }
  .rb, .fin, .fms, .mg, .bus, .sp2 { grid-template-columns: minmax(0, 1fr); }
  .fm.main { grid-row: auto; }
  .rb-r, .fin-r { padding-top: 0; }
  .rt-wrap { overflow-x: auto; }
  .mg-pitch { max-width: 260px; justify-self: center; width: 100%; }
  .gloss { columns: 1; }
  .cv-band { min-height: 0; padding: 20px 16px; }
  .cv-id { margin-top: 24px; }
  .cv-body { padding: 16px 16px 0; }
  .cover .sh-foot { margin: 10px 16px 12px; }
}

@media screen and (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .topbar { flex-wrap: wrap; height: auto; gap: 8px 16px; padding: 14px 0 12px; }
  .brand { font-size: 22px; min-width: 0; }
  .actions { gap: 8px; }
  .mainnav { order: 3; width: 100%; gap: 24px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav:not(.at-end) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
  .rail { display: none; }
  .content { grid-column: 1; }
  .momentum-body { grid-template-columns: minmax(0, 1fr); }
  .mm-side { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; }
  .mm-side .crest.lg { width: 44px; height: 44px; }
  .mm-mid { padding-top: 8px; }
  .label-lg { display: none; }
  .label-sm { display: inline; }
  .bars { min-height: 150px; column-gap: 2px; }
  .news-grid, .news-page { grid-template-columns: minmax(0, 1fr); }
  .table { font-size: 12px; }
  .table .hide-sm { display: none; }
  .fixture { grid-template-columns: 50px minmax(0, 1fr) 44px minmax(0, 1fr); gap: 8px; }
  .fixture-time { font-size: 11px; }
  .fixture-group { display: none; }
  .fixture-team .crest { display: none; }
  .searchbox { width: 100%; }
  .team-title { font-size: 26px; }
  .crest.xl { width: 64px; height: 64px; border-radius: 14px; }
  .team-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ttile { padding: 8px 9px; min-height: 56px; }
  .ttile-value { font-size: 18px; }
  .tfix { grid-template-columns: 44px 22px minmax(0, 1fr) auto; gap: 8px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tcard { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .tcard .crest { grid-row: auto; }
  .coder-video .panel-head { flex-wrap: wrap; }
  .video-form { width: 100%; }
  .video-form .searchbox { width: 100%; }
  .squads, .slot-cols { grid-template-columns: minmax(0, 1fr); }
  .transport .seg { margin-left: 0; }
  .keys { display: none; }
  .head-tools { flex-wrap: wrap; justify-content: flex-end; }
  .pc-goal { grid-template-columns: minmax(0, 1fr); }
  .match-hero { padding: 14px 14px 16px; }
  .mp-grid { gap: 10px; }
  .mp-club, .mp-club.home { flex-direction: column; justify-content: center; text-align: center; font-size: 13px; gap: 8px; }
  .mp-club.home { flex-direction: column-reverse; }
  .mp-club .crest.xl { width: 52px; height: 52px; border-radius: 12px; }
  .mp-score { font-size: 34px; }
  .lineup-cols { grid-template-columns: minmax(0, 1fr); }
  .pc-onpitch .squad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-tl .tl-row { grid-template-columns: 96px minmax(0, 1fr); }
  .pc-tl .tl-ruler { margin-left: 102px; }
  .lu-slots { grid-template-columns: minmax(0, 1fr); }
  .lu-sub { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------------------------------------------------------------- print: the report's sheets only, one A4 page each */

@media print {
  @page { size: A4; margin: 0; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .rail, .provenance, .no-print, .toast, dialog { display: none !important; }
  .app { display: block; max-width: none; margin: 0; padding: 0; }
  .content, main, .report-page, .report { display: block; margin: 0; padding: 0; }
  .sheet { width: 210mm; height: 297mm; min-height: 0; margin: 0; border-radius: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}
