@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Bebas Neue";
  src: url("/fonts/BebasNeue-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Soccer Club Web Product design system: dark (default) and light themes. theme.js sets data-theme. */
  --font-display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --chrome: #101317;
  --chrome-2: #1A1E24;
  --chrome-3: #22272E;
  --chrome-line: #262B33;
  --chrome-ink: #F3F4F6;
  --chrome-mute: #9097A1;
  --canvas: #14171C;
  --surface: #1B1F25;
  --surface-2: #21262D;
  --line: #2C313A;
  --line-strong: #4A505A;
  --ink: #F3F4F6;
  --ink-2: #C9CDD4;
  --ink-3: #8E949E;
  --claret: #EE2616;
  --claret-bright: #FF3B30;
  --claret-tint: #3A1714;
  --green-tint: #11291C;
  --deep-red: #B71C12;
  --accent-text: #FF5447;
  --gold: #AC996A;
  --gold-bright: #E5C36A;
  --secondary-text: #F3F4F6;
  --nav-heading: #E5C36A;
  --pitch: #18241E;
  --pitch-line: rgba(243, 244, 246, 0.6);
  --green: #22A05A;
  --amber: #E5C36A;
  --ref: #E5C36A;
  --neutral: #5F6672;
  --ramp-0: #251B1A;
  --ramp-1: #3F1C19;
  --ramp-2: #611E18;
  --ramp-3: #8A1F16;
  --ramp-4: #B71C12;
  --ramp-5: #EE2616;
  --ramp-6: #FF3B30;
  --on-ramp: var(--ink);
  --on-ramp-top: #fff;
  --chart-bar: #EE2616;
  --chart-2: #E5C36A;
  --chart-3: #8E949E;
  --chart-4: #22A05A;
  --band-1: #3B4048;
  --band-2: #5F6672;
  --band-3: #AC996A;
  --band-4: #E5C36A;
  --band-5: #B71C12;
  --band-6: #EE2616;
  --shadow-card: 0 0 0 1px #2C313A;
  color-scheme: dark;
  --r-card: 8px;
  --r-ctl: 6px;
  --r-chip: 999px;
  --slider-width: 440px;
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--canvas);
}

:root[data-theme="light"] {
  --chrome: #FFFFFF;
  --chrome-2: #F4F2EE;
  --chrome-3: #ECE9E3;
  --chrome-line: #E6E2DA;
  --chrome-ink: #1C1F26;
  --chrome-mute: #5F6672;
  --canvas: #F3F1EC;
  --surface: #FFFFFF;
  --surface-2: #F8F7F4;
  --line: #E4E0D8;
  --line-strong: #B5B0A6;
  --ink: #1C1F26;
  --ink-2: #3D424C;
  --ink-3: #5F6672;
  --claret: #EE2616;
  --claret-bright: #FF3B30;
  --claret-tint: #FDE7E4;
  --green-tint: #E3F3E9;
  --deep-red: #B71C12;
  --accent-text: #B71C12;
  --gold: #8C7A48;
  --gold-bright: #C8963A;
  --secondary-text: #76663A;
  --nav-heading: #6F6036;
  --pitch: #1F3327;
  --pitch-line: rgba(255, 255, 255, 0.7);
  --green: #22A05A;
  --amber: #C8963A;
  --ref: #C8963A;
  --neutral: #5F6672;
  --ramp-0: #FDF0EE;
  --ramp-1: #FAD3CD;
  --ramp-2: #F4A79C;
  --ramp-3: #EC7464;
  --ramp-4: #E04431;
  --ramp-5: #B71C12;
  --ramp-6: #8F150D;
  --on-ramp: var(--ink);
  --on-ramp-top: #fff;
  --chart-bar: #EE2616;
  --chart-2: #C8963A;
  --chart-3: #5F6672;
  --chart-4: #22A05A;
  --band-1: #E3E0DA;
  --band-2: #B9BDC4;
  --band-3: #C8B98E;
  --band-4: #C8963A;
  --band-5: #B71C12;
  --band-6: #EE2616;
  --shadow-card: 0 1px 0 #0000000a, 0 10px 28px -18px #2a2018;
  color-scheme: light;
}

@media print {
  :root, :root[data-theme] {
    --chrome: #FFFFFF;
    --chrome-2: #F4F2EE;
    --chrome-3: #ECE9E3;
    --chrome-line: #E6E2DA;
    --chrome-ink: #1C1F26;
    --chrome-mute: #5F6672;
    --canvas: #F3F1EC;
    --surface: #FFFFFF;
    --surface-2: #F8F7F4;
    --line: #E4E0D8;
    --line-strong: #B5B0A6;
    --ink: #1C1F26;
    --ink-2: #3D424C;
    --ink-3: #5F6672;
    --claret: #EE2616;
    --claret-bright: #FF3B30;
    --claret-tint: #FDE7E4;
    --green-tint: #E3F3E9;
    --deep-red: #B71C12;
    --accent-text: #B71C12;
    --gold: #8C7A48;
    --gold-bright: #C8963A;
    --secondary-text: #76663A;
  --nav-heading: #6F6036;
    --green: #22A05A;
    --amber: #C8963A;
    --ref: #C8963A;
    --neutral: #5F6672;
    --ramp-0: #FDF0EE;
    --ramp-1: #FAD3CD;
    --ramp-2: #F4A79C;
    --ramp-3: #EC7464;
    --ramp-4: #E04431;
    --ramp-5: #B71C12;
    --ramp-6: #8F150D;
    --on-ramp: var(--ink);
    --on-ramp-top: #fff;
    --chart-bar: #EE2616;
    --chart-2: #C8963A;
    --chart-3: #5F6672;
    --chart-4: #22A05A;
    --band-1: #E3E0DA;
    --band-2: #B9BDC4;
    --band-3: #C8B98E;
    --band-4: #C8963A;
    --band-5: #B71C12;
    --band-6: #EE2616;
    --shadow-card: 0 1px 0 #0000000a, 0 10px 28px -18px #2a2018;
    color-scheme: light;
  }
}

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

[hidden] { display: none !important; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
summary {
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

a {
  color: var(--accent-text);
}

::selection {
  background: var(--claret-tint);
  color: var(--ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--claret-bright);
  outline-offset: 2px;
}

input,
select {
  caret-color: var(--accent-text);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 244px;
  z-index: 30;
  transform: translateY(-160%);
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: var(--r-ctl);
  box-shadow: var(--shadow-card);
}

.skip-link:focus {
  transform: none;
}

/* Chrome ------------------------------------------------------------------ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 8;
  width: 232px;
  padding: 26px 16px 18px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  color: var(--chrome-mute);
  background: var(--chrome);
  border-right: 1px solid var(--chrome-line);
}

.brand {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0 8px;
  color: var(--chrome-ink);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 176px;
  height: auto;
}

.brand-club {
  display: block;
  margin-top: 14px;
  font-size: 10.5px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--chrome-mute);
}

/* The logo's R as a faint watermark in the bottom-left of the menu; decorative, behind nav and status. */
.sidebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 340px;
  background: url("/brand/logo-mark.png") no-repeat left -46px bottom -34px / auto 330px;
  opacity: 0.05;
  pointer-events: none;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar nav {
  margin-top: 30px;
}

.nav-group {
  margin: 22px 8px 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chrome-mute);
}

.nav {
  position: relative;
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--chrome-mute);
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  transition: background 120ms ease-out, color 120ms ease-out;
}

.nav:hover {
  background: var(--chrome-2);
  color: var(--chrome-ink);
}

.nav.active {
  margin-left: -16px;
  width: calc(100% + 16px);
  padding-left: 26px;
  border-radius: 0 6px 6px 0;
  background: var(--claret);
  color: #fff;
  font-weight: 650;
}

.nav.active:hover {
  background: var(--deep-red);
  color: #fff;
}

.build-info {
  margin: 6px 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: pre-line;
  color: var(--chrome-mute);
  opacity: 0.8;
}

.connection-note {
  margin-top: auto;
  padding: 18px 8px 0;
  border-top: 1px solid var(--chrome-line);
  font-size: 11px;
  line-height: 1.5;
  color: var(--chrome-mute);
}

.connection-note p {
  margin: 4px 0 0 12px;
  color: var(--chrome-mute);
}

.connection-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #4fae6b;
  box-shadow: 0 0 0 3px #4fae6b1f;
}

.mobile-nav {
  display: none !important;
}

main {
  min-width: 0;
  margin-left: 232px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 7;
  min-height: 56px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-line);
  color: var(--chrome-ink);
}

.session-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.session-heading > label {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chrome-mute);
}

.session-heading select {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  min-height: 40px;
  padding: 7px 34px 7px 12px;
  border: 1px solid var(--chrome-line);
  border-radius: var(--r-ctl);
  background-color: var(--chrome-2);
  color: var(--chrome-ink);
  font-size: 14px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-actions .secondary {
  background: transparent;
  border-color: var(--chrome-line);
  color: var(--chrome-ink);
}

.header-actions .secondary:hover {
  background: var(--chrome-2);
}

.header-actions .primary {
  background: var(--claret);
  color: #fff;
}

.header-actions .primary:hover {
  background: var(--deep-red);
}

/* Buttons and fields ------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  white-space: normal;
  transition: background 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

.button:active {
  transform: translateY(1px);
}

.primary {
  background: var(--claret);
  color: #fff;
}

.primary:hover {
  background: var(--deep-red);
}

.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.secondary:hover {
  background: var(--surface-2);
}

.tertiary {
  background: transparent;
  color: var(--accent-text);
}

.tertiary:hover {
  background: var(--claret-tint);
}

select,
input[type="search"],
input[type="date"],
input[type="number"],
input[type="text"] {
  min-height: 40px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

select {
  padding-right: 28px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--accent-text);
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

label select,
label input {
  display: block;
  margin-top: 5px;
}

/* Workspace --------------------------------------------------------------- */

.workspace-shell {
  max-width: 1920px;
  margin: auto;
  padding: 24px 28px 30px;
}

.title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.012em;
}

h3 {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 650;
}

p {
  margin: 0 0 12px;
}

.title-row p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}

.filter-bar,
.history-controls {
  position: sticky;
  top: var(--header-h, 56px);
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.filter-bar > label,
.history-controls > label {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: none;
  padding: 5px 12px 6px;
  border: 1px solid transparent;
  border-radius: var(--r-chip);
  background: var(--canvas);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.filter-bar > label:focus-within,
.history-controls > label:focus-within {
  border-color: var(--accent-text);
}

.filter-bar:has(+ .history-controls:not(.hidden)) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.history-controls:not(.hidden) {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.filter-bar select,
.history-controls select,
.history-controls input {
  width: auto;
  min-width: 0;
  min-height: 22px;
  margin: 0;
  padding: 0 18px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.filter-bar select {
  max-width: 230px;
}

.history-controls {
  top: 110px;
  border-top: 0;
  border-radius: 0 0 var(--r-card) var(--r-card);
  background: var(--surface-2);
  box-shadow: none;
}

.history-controls .filter-label {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-controls input {
  padding-right: 0;
}

.quick-ranges {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.quick-ranges .button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--r-chip);
  font-size: 12px;
}

.player-picker {
  position: relative;
  align-self: stretch;
  min-width: 0;
}

.player-picker > summary {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-height: 0;
  height: 100%;
  padding: 5px 12px 6px;
  border: 1px solid transparent;
  border-radius: var(--r-chip);
  background: var(--canvas);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.player-picker > summary::-webkit-details-marker {
  display: none;
}

.player-picker > summary span {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.player-picker[open] > summary {
  border-color: var(--accent-text);
}

.player-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  width: 330px;
  max-width: calc(100vw - 40px);
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 14px 34px #1b1e2530;
}

.player-options > input {
  width: 100%;
  margin: 6px 0 8px;
}

.player-options > div {
  max-height: 330px;
  overflow: auto;
}

.player-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 5px 2px;
  font-size: 13px;
  font-weight: 400;
}

.player-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-option small {
  margin-left: 4px;
  color: var(--ink-3);
}

.scope-summary {
  margin: 10px 2px 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.status {
  min-height: 20px;
  margin: 3px 2px 10px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.6;
}

.status.error {
  color: var(--accent-text);
}

.workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 24px;
  color: var(--ink-3);
  font-size: 11.5px;
}

/* Cards and metrics ------------------------------------------------------- */

.report-section,
.report-panel,
.chart-panel,
.chart-card,
.info-card {
  min-width: 0;
  margin-bottom: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.report-section > .report-section,
.report-panel > .report-panel {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.section-heading,
.view-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.section-heading p,
.view-heading p {
  max-width: 90ch;
  margin: 5px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.analysis-grid,
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px;
  align-items: start;
}

.analysis-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.metric-cell,
.metric-summary {
  min-width: 0;
  padding: 18px 20px;
}

.metric-cell:not(:nth-child(4n)) {
  border-right: 1px solid var(--line);
}

.metric-cell:nth-child(n + 5) {
  border-top: 1px solid var(--line);
}

.metric-label {
  display: block;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-cell strong,
.metric-summary strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 34px;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero-kpis .metric-cell strong {
  font-size: 56px;
}

.secondary-kpis .metric-cell strong {
  font-size: 30px;
}

.metric-cell strong small,
.metric-summary strong small {
  font-size: 14px;
  font-family: Inter, sans-serif;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
}

.metric-context {
  display: block;
  color: var(--ink-3);
  font-size: 11.5px;
}

.metric-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 12px 0;
  background: var(--surface-2);
}

.metric-summary > div {
  min-width: 125px;
}

.distribution-strip {
  display: block;
  width: 100%;
  height: 18px;
  margin-top: 10px;
}

/* Rankings ---------------------------------------------------------------- */

.ranking-list,
.ranking-bars {
  display: grid;
  gap: 2px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 24px minmax(118px, 1.1fr) minmax(0, 1.9fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 5px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

button.ranking-row:hover {
  background: var(--canvas);
}

.rank-index {
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ranking-label {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ranking-label small {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

.rank-track {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ranking-bar {
  flex: 1;
  min-width: 0;
  height: 10px;
}

.ranking-bar svg {
  display: block;
  width: 100%;
  height: 10px;
}

.ranking-row svg {
  width: 100%;
  max-height: 18px;
}

.ranking-value,
.rank-end-value {
  min-width: 48px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.rank-axis {
  display: flex;
  justify-content: space-between;
  padding: 6px 0 0 34px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.rank-reference,
.reference-line {
  stroke: var(--ref);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}

.reference-key,
.reference-label {
  color: var(--ref);
  font-size: 10.5px;
}

.telemetry-rank-row {
  cursor: pointer;
}

/* Charts ------------------------------------------------------------------ */

.chart-wrap {
  min-width: 0;
  overflow: auto;
}

.plot-frame {
  min-width: 0;
  padding: 10px 0;
}

.scatter-plot,
.scatter-chart,
.trend-chart,
.analysis-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
}

svg text {
  fill: var(--ink-3);
  font-family: inherit;
  font-size: 11px;
}

svg [role="button"] {
  cursor: pointer;
}

svg [role="button"]:focus {
  outline: none;
  stroke: var(--claret-bright);
  stroke-width: 3;
}

.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0;
  color: var(--ink-3);
  font-size: 11.5px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--claret);
}

.chart-mark {
  transition: opacity 120ms ease-out;
}

.chart-mark.is-dim {
  opacity: 0.24;
}

.chart-mark.is-active {
  opacity: 1;
}

.chart-tooltip {
  position: fixed;
  z-index: 40;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--chrome);
  color: var(--chrome-ink);
  box-shadow: 0 10px 28px #00000038;
  font-size: 11.5px;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 100ms ease-out, transform 100ms ease-out;
}

.chart-tooltip.visible {
  opacity: 1;
  transform: none;
}

.chart-scale-note,
.chart-method,
.axis-range-note,
.axis-title,
.method-note,
.coverage-label,
.inline-note,
.inline-status,
.muted,
.help-text,
.value-coverage {
  margin: 9px 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.7;
}

.inline-note {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 6px;
}

.inline-status {
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--green);
  border-radius: 6px;
}

.series-1 {
  stroke: var(--claret);
  fill: var(--claret);
}

.series-2 {
  stroke: var(--ref);
  fill: var(--ref);
}

.series-3 {
  stroke: var(--ink);
  fill: var(--ink);
}

.series-4 {
  stroke: #63488a;
  fill: #63488a;
}

.point-label {
  fill: var(--ink-2);
  font-size: 10.5px;
}

.band-graphic {
  min-width: 190px;
}

.band-graphic svg {
  display: block;
  width: 100%;
  height: 22px;
}

.band-1 {
  fill: var(--ramp-1);
}

.band-2 {
  fill: var(--ramp-2);
}

.band-3 {
  fill: var(--ramp-3);
}

.band-4 {
  fill: var(--ramp-4);
}

.band-5 {
  fill: var(--ramp-5);
}

.band-6 {
  fill: var(--ramp-6);
}

/* Tables ------------------------------------------------------------------ */

.table-scroll {
  max-width: 100%;
  max-height: 620px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-color: var(--line-strong) var(--surface-2);
}

.data-table,
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td,
table th,
table td {
  padding: 10px 12px;
  line-height: 1.45;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th,
table th {
  font-weight: 600;
}

.data-table thead th,
table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.data-table tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
  background: var(--surface-2);
}

.data-table tbody tr:hover,
table tbody tr:hover {
  background: var(--claret-tint);
}

.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 165px;
  background: var(--surface);
}

.data-table thead th:first-child {
  z-index: 3;
  background: var(--surface-2);
}

.data-table td.numeric,
.data-table th.numeric,
.numeric {
  text-align: right;
}

.data-table th small,
table th small {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.data-table th > button,
table th > button {
  min-height: 28px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-align: inherit;
}

/* Shared table sorting (web/table-sort.js): the arrow follows aria-sort; unsorted headers hint on hover/focus. */
table th > .sort-button {
  width: 100%;
  cursor: pointer;
}

table th > .sort-button:hover {
  color: var(--ink);
}

table th[aria-sort] {
  color: var(--ink);
}

.sort-icon {
  display: inline-block;
  min-width: 1.1em;
  padding-left: 3px;
  color: var(--accent-text);
  font-size: 9px;
  letter-spacing: 0;
}

th[aria-sort="ascending"] .sort-icon::after { content: "▲"; }
th[aria-sort="descending"] .sort-icon::after { content: "▼"; }
th:not([aria-sort]) .sort-button:is(:hover, :focus-visible) .sort-icon::after { content: "▼"; color: var(--ink-3); }

.player-link,
.table-link {
  min-height: 28px;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.player-link:hover,
.table-link:hover {
  border-bottom-color: var(--accent-text);
  color: var(--accent-text);
}

.data-table td .player-link {
  max-width: 230px;
  white-space: normal;
}

.empty-state {
  padding: 28px 20px;
  background: var(--surface-2);
  border-radius: 8px;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  max-width: 70ch;
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.loading-state {
  padding: 40px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--ink-3);
}

/* Controls ---------------------------------------------------------------- */

.control-row,
.local-controls,
.catalog-toolbar,
.metric-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 15px;
}

.control-row label,
.local-controls label,
.metric-controls label {
  min-width: 120px;
  font-size: 11px;
  color: var(--ink-3);
}

.control-row select,
.local-controls select,
.metric-controls select {
  max-width: 280px;
}

.control-row input[type="search"],
.catalog-toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
}

.control,
.control label {
  display: block;
}

.control > span {
  font-size: 11px;
  color: var(--ink-3);
}

.local-controls .control select,
.local-controls .control input {
  display: block;
  margin-top: 5px;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-chip);
  background: var(--canvas);
}

.segmented-control button {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: var(--r-chip);
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
}

.segmented-control button:hover {
  color: var(--ink);
}

.segmented-control .selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px #16181d1a;
}

.column-picker-content {
  min-width: 290px;
  margin: 10px 0;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 8px;
}

.column-picker-content input[type="search"] {
  width: 100%;
}

.column-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 7px 15px;
  max-height: 240px;
  margin-top: 10px;
  overflow: auto;
}

.column-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.tag,
.chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-chip);
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.7;
}

.tag.good,
.chip.good {
  background: var(--surface-2);
  color: var(--green);
}

.tag.pending,
.chip.pending {
  background: var(--claret-tint);
  color: var(--accent-text);
}

.compare-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  max-height: 200px;
  padding: 10px 0;
  overflow: auto;
}

.player-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 400;
}

.metric-definition {
  margin: 12px 0;
  padding: 13px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.metric-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.metric-selection button {
  min-height: 34px;
}

.catalog-table td {
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.catalog-table code,
code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.catalog-table small {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
}

.metric-formula {
  max-width: 70ch;
  overflow-wrap: anywhere;
}

/* Secondary values inside table cells (coverage, units, dates) sit on their own line. */

.data-table td small,
table td small {
  display: block;
  margin: 2px 0 0;
  padding: 0;
  background: none;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 450;
  line-height: 1.4;
}

.inline-note:empty {
  display: none;
}

/* Rafa's report pages (coach.js) ------------------------------------------ */

.coach-kpis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--line);
  box-shadow: var(--shadow-card);
}

.coach-kpi {
  padding: 14px 14px 12px;
  background: var(--surface);
}

.coach-kpi span {
  display: block;
  min-height: 2.6em;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.coach-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
}

.coach-table td.numeric {
  font-variant-numeric: tabular-nums;
}

.coach-table td.scale-0 { background: var(--ramp-0); }
.coach-table td.scale-1 { background: var(--ramp-1); }
.coach-table td.scale-2 { background: var(--ramp-2); }
.coach-table td.scale-3 { background: var(--ramp-3); }
.coach-table td.scale-4 { background: var(--ramp-4); }
.coach-table td.scale-5 { background: var(--ramp-5); color: #fff; }

.ranking-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.ranking-panel h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-align: center;
}

.ranking-panel svg {
  display: block;
  width: 100%;
  height: auto;
}

.ranking-panel .chart-mark {
  cursor: pointer;
}

.coach-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.coach-grid > .report-section {
  margin-bottom: 0;
}

.coach-grid + .report-section,
.coach-grid + .muted {
  margin-top: 18px;
}

.coach-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
}

.coach-chart .chart-mark[data-session] {
  cursor: pointer;
}

/* Value labels sit on the bars: a tap on the number reaches the bar under it. */
svg.coach-chart text, svg.coach-chart rect.line-pill { pointer-events: none; }
svg.coach-chart text.bar-label { fill: #fff; }
svg.coach-chart text.line-label { fill: var(--ref); }
svg.coach-chart rect.line-pill { fill: var(--surface); fill-opacity: 0.92; stroke: var(--ref); stroke-width: 0.8; }
svg.coach-chart text.bar-label-out { fill: var(--ink-2); }
svg.coach-chart text.axis-label { fill: var(--ink-3); }
.ranking-panel svg text.rank-name { fill: var(--ink-2); }
.ranking-panel svg text.rank-value { fill: var(--ink); }

.coach-stack > .report-section {
  margin-bottom: 18px;
}

.coach-table th,
.coach-table td {
  padding: 9px 10px;
}

.chart-legend i.legend-bar {
  width: 10px;
  height: 10px;
  background: var(--chart-bar);
}

.chart-legend i.legend-bar.match {
  background: var(--chart-3);
}

.chart-legend i.legend-line {
  width: 14px;
  height: 2px;
  background: var(--ref);
}

.coach-pending {
  border: 1px solid var(--line);
}

.coach-pending p {
  max-width: 90ch;
}

.nav-pending {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: var(--r-chip);
  background: var(--chrome-2);
  color: var(--chrome-mute);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.nav-more > summary {
  cursor: pointer;
  list-style: none;
}

.nav-more > summary::-webkit-details-marker {
  display: none;
}

.nav-more > summary::after {
  content: " +";
}

.nav-more[open] > summary::after {
  content: " −";
}

@media (max-width: 1200px) {
  .coach-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ranking-board, .coach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .coach-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ranking-board, .coach-grid { grid-template-columns: 1fr; }
}

/* M3 bands page */

.bands-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 20px;
  align-items: start;
}

.bands-chart {
  display: block;
  width: 100%;
  height: auto;
}

.bands-chart rect.band-1 { fill: var(--band-1); }
.bands-chart rect.band-2 { fill: var(--band-2); }
.bands-chart rect.band-3 { fill: var(--band-3); }
.bands-chart rect.band-4 { fill: var(--band-4); }
.bands-chart rect.band-5 { fill: var(--band-5); }
.bands-chart rect.band-6 { fill: var(--band-6); }
svg.bands-chart text.band-name { fill: var(--ink-2); }
svg.bands-chart text.band-label { fill: var(--ink); }
svg.bands-chart text.band-label.on-dark { fill: #fff; }
:root:not([data-theme="light"]) svg.bands-chart text.band-label { fill: #fff; }

.chart-legend i.band-swatch { width: 10px; height: 10px; }
.chart-legend i.band-1 { background: var(--band-1); box-shadow: inset 0 0 0 1px var(--line); }
.chart-legend i.band-2 { background: var(--band-2); }
.chart-legend i.band-3 { background: var(--band-3); }
.chart-legend i.band-4 { background: var(--band-4); }
.chart-legend i.band-5 { background: var(--band-5); }
.chart-legend i.band-6 { background: var(--band-6); }

.band-averages div {
  margin-bottom: 14px;
  text-align: center;
}

.band-averages span {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
}

.band-averages strong {
  display: block;
  font-size: 38px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.band-text-6 { color: var(--band-6); }
.band-text-5 { color: var(--band-5); }
.band-text-4 { color: var(--band-4); }
.band-text-3 { color: var(--band-4); }
.band-text-2 { color: var(--ink-2); }
.band-text-1 { color: var(--ink-3); }

@media (max-width: 900px) {
  .bands-layout { grid-template-columns: 1fr; }
  .band-averages { display: grid; grid-template-columns: repeat(3, 1fr); }
}

/* Nav items: label + source tag (Rafa's PDF page) */

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

.nav-label {
  flex: 1;
  min-width: 0;
}

.nav-tag {
  flex-shrink: 0;
  color: var(--chrome-mute);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.nav.active .nav-tag {
  color: #fff;
}

.nav .nav-pending {
  margin-left: 0;
}

/* More analysis (our extras under Rafa's page) */

.more-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.more-link {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.more-link:hover {
  border-color: var(--accent-text);
}

.more-link strong {
  display: block;
  font-size: 13px;
}

.more-link span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 11.5px;
}

/* Heat and exposure ------------------------------------------------------- */
/* Cells sit on a 2px gutter, fill on the ramp (50–110% profile Vmax), and mark threshold exposure with a claret corner. */

.heatmap {
  max-height: 650px;
}

.heatmap td {
  padding: 1px !important;
}

.heat-cell,
.heat-missing {
  position: relative;
  display: block;
  width: 100%;
  min-width: 46px;
  min-height: 30px;
  padding: 6px 6px;
  border: 0;
  border-radius: 3px;
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  font-weight: 550;
  text-align: center;
}

.heat-cell:hover,
.heat-cell:focus-visible {
  outline: 2px solid var(--claret-bright);
  outline-offset: 0;
}

.heat-0 { background: var(--ramp-0); }
.heat-1 { background: var(--ramp-1); }
.heat-2 { background: var(--ramp-2); }
.heat-3 { background: var(--ramp-3); }
.heat-4 { background: var(--ramp-4); }
.heat-5 { background: var(--ramp-5); color: #fff; }

.heat-cell.meets::after,
.heat-legend i.meets::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 9px 9px 0;
  border-color: transparent var(--claret) transparent transparent;
}

.heat-missing {
  color: var(--ink-3);
  background: repeating-linear-gradient(135deg, var(--ramp-0) 0 4px, var(--surface) 4px 8px);
}

.heat-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: -6px 0 18px;
  color: var(--ink-3);
  font-size: 11px;
}

.heat-legend > span:first-child {
  margin-right: 8px;
}

.heat-legend > i {
  min-width: 40px;
  padding: 3px 6px;
  border-radius: 3px;
  font-style: normal;
  text-align: center;
}

.heat-legend > span:not(:first-child) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
}

.heat-legend span i {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 14px;
  border-radius: 2px;
  background: var(--ramp-2);
}

.heat-legend span i.heat-missing {
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: repeating-linear-gradient(135deg, var(--ramp-0) 0 3px, var(--surface) 3px 6px);
  box-shadow: inset 0 0 0 1px var(--line);
}

.missing-value {
  color: var(--ink-3);
}

/* Trend legend markers */

.legend-match,
.legend-training,
.legend-selected,
.legend-series {
  display: inline-block;
  width: 10px;
  height: 10px;
}

.chart-legend i.legend-match {
  background: var(--claret);
  transform: rotate(45deg) scale(.85);
}

.chart-legend i.legend-training {
  background: var(--surface);
  border: 1.75px solid var(--ink);
  border-radius: 50%;
}

.chart-legend i.legend-selected {
  width: 2px;
  height: 12px;
  background: var(--claret);
}

.chart-legend i.series-bg-1 { background: var(--claret); border-radius: 50%; }
.chart-legend i.series-bg-2 { background: var(--ref); border-radius: 50%; }
.chart-legend i.series-bg-3 { background: var(--ink); border-radius: 50%; }
.chart-legend i.series-bg-4 { background: var(--chart-4); border-radius: 50%; }

.trend-point {
  cursor: pointer;
}

/* Export and inspector ---------------------------------------------------- */

.export-menu {
  position: relative;
}

.export-menu > summary {
  cursor: pointer;
  list-style: none;
}

.export-menu > summary::-webkit-details-marker {
  display: none;
}

.export-options {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 14;
  width: 300px;
  max-width: calc(100vw - 30px);
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 14px 34px #1b1e2530;
}

.export-options button {
  width: 100%;
  margin-bottom: 8px;
  justify-content: flex-start;
}

.export-options p {
  margin: 4px 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.6;
}

.player-inspector {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 16;
  width: var(--slider-width);
  max-width: calc(100vw - 30px);
  padding: 22px 22px 30px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: -8px 0 32px #1b1e2518;
}

.inspector-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.inspector-top h2 {
  font-size: 28px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.inspector-top p {
  margin: 5px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.inspector-top .button {
  flex-shrink: 0;
}

.inspector-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
  margin: 0 0 22px;
}

.inspector-metrics dt {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inspector-metrics dd {
  margin: 4px 0 0;
  font-size: 24px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.inspector-metrics small {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

.player-inspector h3 {
  margin-top: 22px;
}

.player-inspector .table-scroll {
  max-height: 330px;
  margin: 12px 0;
}

.player-inspector .data-table {
  font-size: 12px;
}

.inspector-resize {
  position: fixed;
  top: 0;
  right: calc(var(--slider-width) - 4px);
  bottom: 0;
  z-index: 17;
  width: 8px;
  cursor: ew-resize;
  touch-action: none;
}

.inspector-resize:hover,
.inspector-resize:focus-visible {
  background: #b2838c50;
}

/* Responsive -------------------------------------------------------------- */

@media (min-width: 1700px) {
  .metric-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .workspace-shell {
    padding: 20px 20px 26px;
  }

  .app-header {
    padding: 8px 18px;
  }

  .analysis-grid,
  .report-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .filter-bar > label {
    flex: 1 1 auto;
  }

  .player-picker {
    flex: 1 1 auto;
  }

  .player-picker > summary {
    width: 100%;
  }

  .player-inspector {
    width: min(var(--slider-width), calc(100vw - 30px));
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 200px;
    padding: 22px 12px 16px;
  }

  .brand-word {
    font-size: 30px;
  }

  main {
    margin-left: 200px;
  }

  /* The label carries meaning ("Session" / "Up to" / "Open a session"), so it stays: stacked above the select. */
  .session-heading { flex-direction: column; align-items: stretch; gap: 2px; }
  .session-heading > label { font-size: 9.5px; }

  .analysis-grid,
  .report-grid,
  .analysis-grid.three {
    grid-template-columns: 1fr;
  }

  .column-options {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .hero-kpis .metric-cell strong {
    font-size: 46px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 14px 15px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--chrome-line);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
  }

  .sidebar::after {
    display: none;
  }

  .brand-logo {
    width: 140px;
  }

  .brand-club {
    margin-top: 0;
    font-size: 9.5px;
  }

  .mobile-nav {
    display: inline-flex !important;
    min-height: 38px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .sidebar nav {
    display: none;
    grid-column: 1 / -1;
    max-height: 62dvh;
    margin: 10px 0 0;
    overflow: auto;
  }

  .sidebar nav.mobile-open {
    display: block;
  }

  .nav {
    min-height: 42px;
    font-size: 13px;
  }

  .connection-note {
    display: none;
  }

  main {
    margin-left: 0;
  }

  .app-header {
    position: static;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }

  .session-heading {
    flex-basis: 100%;
  }

  .session-heading select {
    font-size: 13px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .workspace-shell {
    padding: 18px 14px 24px;
  }

  h1 {
    font-size: 26px;
  }

  .title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .title-row > .button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .filter-bar,
  .history-controls {
    position: static;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-bar::-webkit-scrollbar,
  .history-controls::-webkit-scrollbar {
    display: none;
  }

  .filter-bar > label,
  .history-controls > label {
    flex: 0 0 auto;
  }

  .player-picker {
    flex: 0 0 auto;
  }

  .quick-ranges {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-cell {
    padding: 14px;
  }

  .metric-cell:not(:nth-child(4n)) {
    border-right: 0;
  }

  .metric-cell:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .metric-cell:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .hero-kpis .metric-cell strong {
    font-size: 42px;
  }

  .secondary-kpis .metric-cell strong {
    font-size: 27px;
  }

  .report-section,
  .report-panel,
  .chart-panel,
  .chart-card,
  .info-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .data-table td,
  .data-table th {
    padding: 9px 10px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    min-width: 145px;
  }

  .player-link,
  .table-link {
    min-height: 36px;
  }

  .column-options {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    grid-template-columns: 22px minmax(100px, 1.2fr) minmax(0, 1.6fr);
    gap: 7px;
    min-height: 38px;
  }

  .player-inspector {
    width: 100%;
    max-width: 100%;
    padding: 18px 16px;
  }

  .inspector-resize {
    display: none;
  }

  .table-scroll {
    max-height: 520px;
  }

  .heat-cell button {
    min-height: 40px;
  }

  .export-options {
    right: 0;
  }
}

@media (max-width: 420px) {
  .workspace-shell {
    padding: 14px 10px 20px;
  }

  h1 {
    font-size: 23px;
  }

  .hero-kpis .metric-cell strong {
    font-size: 36px;
  }

  .metric-cell,
  .metric-summary {
    padding: 12px;
  }

  .filter-bar > label,
  .history-controls > label {
    padding: 5px 10px 6px;
  }

  .filter-bar select {
    max-width: 175px;
  }

  .ranking-row {
    grid-template-columns: 20px minmax(88px, 1.2fr) minmax(0, 1.4fr);
  }

  .ranking-value {
    min-width: 42px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Print ------------------------------------------------------------------- */

@media print {
  @page {
    size: A3 landscape;
    margin: 10mm;
  }

  :root {
    background: #fff;
    font-size: 11px;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .app-header,
  .filter-bar,
  .history-controls,
  .status,
  .player-inspector,
  .control-row,
  .local-controls,
  .export-menu,
  .player-picker,
  .quick-ranges,
  .skip-link,
  .button,
  .column-picker-content,
  .compare-picker {
    display: none !important;
  }

  main {
    margin: 0 !important;
  }

  .workspace-shell {
    max-width: none;
    padding: 0;
  }

  .title-row {
    margin-bottom: 8px;
  }

  h1 {
    font-size: 22px;
  }

  .scope-summary {
    margin: 5px 0 12px;
    font-size: 10px;
  }

  .workspace-footer {
    font-size: 9px;
  }

  .report-section,
  .report-panel,
  .chart-panel,
  .chart-card {
    break-inside: avoid;
    margin-bottom: 12px;
    padding: 8px 0;
    border: 0;
    box-shadow: none;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
    border: 0;
  }

  .data-table,
  .data-table th,
  .data-table td {
    padding: 5px 7px;
    font-size: 9px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: static;
    min-width: 110px;
  }

  .data-table thead th {
    position: static;
  }

  .data-table th > button {
    min-height: 0;
    font-size: 9px;
  }

  .sort-icon {
    display: none;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
  }

  .metric-strip {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    break-inside: avoid;
    box-shadow: none;
  }

  .metric-cell {
    padding: 8px;
    border-top: 0 !important;
  }

  .hero-kpis .metric-cell strong,
  .secondary-kpis .metric-cell strong {
    font-size: 20px;
  }

  .metric-label,
  .metric-context {
    font-size: 9px;
  }

  .analysis-grid,
  .report-grid {
    grid-template-columns: 1fr 1fr;
  }

  .player-link {
    min-height: 0;
    border: 0;
    color: var(--ink);
    font-size: 9px;
    text-decoration: none;
  }

  .chart-wrap {
    overflow: visible;
  }

  .analysis-chart,
  .scatter-plot,
  .scatter-chart,
  .trend-chart {
    max-height: 245px;
  }

  .heat-cell button {
    min-height: 0;
    padding: 3px;
    font-size: 9px;
  }

  .export-options {
    display: none !important;
  }
}


/* Theme remap for SVG colours written as presentation attributes by the chart modules.
   CSS outranks presentation attributes, so each fixed hex maps onto the active theme's token. */
svg [fill="#4a4f59"] { fill: var(--chart-bar); }
svg [stroke="#4a4f59"] { stroke: var(--ink-2); }
svg [fill="#8e1b2e"], svg [fill="#7b1925"], svg [fill="#790e19"] { fill: var(--claret); }
svg [stroke="#8e1b2e"], svg [stroke="#7b1925"], svg [stroke="#790e19"] { stroke: var(--claret); }
svg [fill="#2f6e8c"], svg [fill="#876b38"] { fill: var(--ref); }
svg [stroke="#2f6e8c"], svg [stroke="#876b38"] { stroke: var(--ref); }
svg [fill="#9e5568"], svg [fill="#58739a"] { fill: var(--chart-4); }
svg [stroke="#9e5568"], svg [stroke="#58739a"] { stroke: var(--chart-4); }
svg [fill="#4a7168"] { fill: var(--chart-3); }
svg [stroke="#4a7168"] { stroke: var(--chart-3); }
svg [fill="#16181d"] { fill: var(--ink); }
svg [stroke="#16181d"] { stroke: var(--ink); }
svg [fill="#666b74"], svg [fill="#6e737c"], svg [fill="#4f5662"], svg [fill="#202530"] { fill: var(--ink-3); }
svg [stroke="#e3ded3"], svg [stroke="#d8d6d3"], svg [stroke="#b5b8bd"], svg [stroke="#aaa"] { stroke: var(--line); }
svg [stroke="#9c9486"], svg [stroke="#cfc8ba"] { stroke: var(--line-strong); }
svg [fill="#efe9de"], svg [fill="#e7e7e7"] { fill: var(--ramp-0); }
svg [fill="#e3cfc0"] { fill: var(--band-2); }
svg [fill="#d3a595"] { fill: var(--band-3); }
svg [fill="#bc6e68"] { fill: var(--band-4); }
svg [fill="#9a3443"] { fill: var(--band-5); }
svg [fill="#5e0f1d"] { fill: var(--band-6); }
svg [fill="#fff"] { fill: var(--surface); }
svg [stroke="#fff"] { stroke: var(--surface); }
svg.coach-chart text.bar-label { fill: #fff; }
/* Match bars use --chart-3, a light grey in the dark theme: white labels would be 3:1, so they turn dark there. */
:root:not([data-theme="light"]) svg.coach-chart text.bar-label.on-match { fill: var(--canvas); }

/* Theme-aware logo and watermark */
.brand-logo.on-light { display: none; }
:root[data-theme="light"] .brand-logo.on-dark { display: none; }
:root[data-theme="light"] .brand-logo.on-light { display: block; }
:root[data-theme="light"] .sidebar::after { background-image: url("/brand/logo-mark-dark.png"); opacity: 0.06; }


/* Design system components (Soccer Club Web Product) ------------------------ */

.secondary,
.header-actions .secondary {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--secondary-text);
}

.secondary:hover,
.header-actions .secondary:hover {
  background: color-mix(in srgb, var(--gold) 14%, transparent);
}

.primary,
.header-actions .primary {
  background: var(--claret);
  border-color: var(--claret);
  color: #fff;
}

.primary:hover,
.header-actions .primary:hover {
  background: var(--deep-red);
}

/* Tabs: underline style */
.segmented-control {
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.segmented-control button {
  border-radius: 0;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-weight: 500;
}

.segmented-control button:hover {
  color: var(--ink);
}

.segmented-control .selected {
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--claret);
}

/* Badges: pill with a leading dot */
.chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-chip);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
}

.chip::before,
.tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neutral);
}

.chip.good::before, .tag.good::before { background: var(--green); }
.chip.pending, .tag.pending { background: var(--claret-tint); color: var(--accent-text); }
.chip.pending::before, .tag.pending::before { background: var(--claret); }

.nav-pending {
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  color: var(--nav-heading);
}

/* Inputs */
select,
input[type="search"],
input[type="text"],
input[type="number"],
input[type="date"] {
  background-color: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
  border-radius: var(--r-ctl);
}

/* Compact data tables */
.data-table th,
.data-table td {
  padding: 8px 10px;
}

.data-table thead th {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Section eyebrows keep Inter; numbers and page titles use the display face */
.section-heading h2,
.section-heading h3 {
  font-family: Inter, sans-serif;
}

.nav-session {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: var(--r-chip);
  background: var(--chrome-2);
  color: var(--chrome-ink);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

/* Menu hierarchy: group headings read as labels (gold, caps, divider), items as indented links. */
.sidebar nav .nav-group {
  margin: 18px 8px 6px;
  padding-top: 14px;
  border-top: 1px solid var(--chrome-line);
  color: var(--nav-heading);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  cursor: default;
}

.sidebar nav .nav-group:first-child {
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
}

.sidebar nav .nav {
  padding-left: 18px;
  color: color-mix(in srgb, var(--chrome-ink) 82%, var(--chrome));
}

.sidebar nav .nav:hover {
  color: var(--chrome-ink);
}

.sidebar nav .nav.active {
  padding-left: 34px;
  color: #fff;
}

.sidebar nav .nav-session {
  display: block;
  width: fit-content;
  margin: 6px 0 0;
  white-space: nowrap;
  letter-spacing: 0.08em;
}

/* Standard slider header close button */
.slider-close {
  min-width: 40px;
  padding-inline: 10px;
  font-size: 20px;
  line-height: 1;
}

.inspector-resize { cursor: col-resize; }

/* Heat map (R01) */
.heat-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.heat-add {
  min-height: 32px;
  padding: 4px 30px 4px 10px;
  font-size: 12.5px;
}

.heat-players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 260px;
}

.heat-chip {
  border: 1px solid var(--line);
  cursor: pointer;
}

.heat-chip small {
  color: var(--ink-3);
}

.ghost-link {
  min-height: 0;
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-size: 12px;
}

.heat-maps {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
  gap: 16px;
}

.heat-maps.split {
  grid-template-columns: repeat(2, minmax(0, 520px));
}

.heat-panel canvas {
  display: block;
  max-width: 100%;
  border-radius: var(--r-card);
}

@media (max-width: 900px) {
  .heat-maps.split { grid-template-columns: 1fr; }
}

/* Report pack: one landscape A4 page per Rafa report page, modern styling, every stat kept */
.pack-pages-scroll { overflow-x: auto; }

.pack-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.pack-page {
  width: 1047px;
  height: 718px;
  margin: 0 auto 24px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.pack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 10px;
  background: var(--chrome);
  border-bottom: 3px solid var(--claret);
}

.pack-head h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--chrome-ink);
}

.pack-head p {
  margin: 0;
  color: var(--chrome-mute);
  font-size: 11.5px;
}

.pack-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--r-chip);
  background: var(--claret);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pack-logo .brand-logo { width: 150px; height: auto; }

.pack-body {
  flex: 1;
  padding: 10px 14px 0;
  transform-origin: top left;
}

.pack-foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 7px 20px 8px;
  background: var(--chrome);
  border-top: 2px solid var(--claret);
  color: var(--chrome-mute);
  font-size: 9.5px;
  line-height: 1.35;
}

.pack-foot-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pack-foot-brand .brand-logo { width: auto; height: 22px; }
.pack-foot-brand .brand-logo + .brand-logo + .brand-logo,
.pack-foot-brand .brand-logo:nth-child(3),
.pack-foot-brand .brand-logo:nth-child(4) { height: 16px; }

.pack-foot-system {
  display: flex;
  flex-direction: column;
  padding-left: 18px;
  border-left: 1px solid var(--chrome-line);
}

.pack-foot-system strong,
.pack-foot-meta strong {
  color: var(--chrome-ink);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.pack-foot-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

/* Inside the pack: report content only, no controls, extras or pending notes */
.pack-body .segmented-control,
.pack-body .heat-controls,
.pack-body .more-analysis,
.pack-body .coach-pending,
.pack-body .control-row,
.pack-body .local-controls,
.pack-body .threshold-presets,
.pack-body .method-note,
.pack-body .button,
.pack-body [data-heat-note],
.pack-body caption {
  display: none !important;
}

.pack-body .report-section {
  margin-bottom: 10px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

/* Background colour only where it groups content: summary boxes, not the page or every section. */
.pack-page { background: var(--surface); }
.pack-body .coach-kpis { background: var(--line); box-shadow: none; }
.pack-body .coach-kpi { background: var(--surface-2); }
.pack-body .metric-summary { background: var(--surface-2); border-radius: var(--r-ctl); }
.pack-body .band-averages { background: var(--surface-2); border-radius: var(--r-ctl); padding: 10px 6px 2px; }
.pack-body .data-table tbody tr:nth-child(even) { background: transparent; }

.pack-body .coach-stack,
.pack-body .coach-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pack-body .table-scroll {
  max-height: none;
  overflow: visible;
}

.pack-body .data-table th,
.pack-body .data-table td {
  padding: 3px 8px;
  line-height: 1.25;
  font-size: 11.5px;
}

.pack-body .data-table thead th { font-size: 10px; }
.pack-body .player-link { min-height: 0; padding: 0; font-size: 11.5px; }
.pack-body .coach-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); margin-bottom: 8px; }
.pack-body .coach-kpi { padding: 8px 10px; }
.pack-body .coach-kpi span { min-height: 2.4em; font-size: 9.5px; }
.pack-body .coach-kpi strong { font-size: 30px; }
.pack-body .heat-cell,
.pack-body .heat-missing { min-height: 0; min-width: 36px; padding: 2px 4px; font-size: 10.5px; }
.pack-body .metric-summary { margin: 6px 0; padding: 8px 12px; }
.pack-body .metric-summary strong { font-size: 24px; }

.pack-body .heat-maps.split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Fixed page layouts: the printed page is narrower than the screen, so responsive breakpoints must not fire here. */
.pack-body .ranking-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pack-body .bands-layout { grid-template-columns: minmax(0, 1fr) 150px; }
.pack-body .band-averages { display: block; }
.pack-body .coach-stack.season-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pack-body .season-stack .report-section { padding: 8px 12px; margin-bottom: 0; }
.pack-foot { margin-top: auto; }
.pack-body { min-height: 0; overflow: hidden; }
.pack-inner { transform-origin: top left; }

@page pack { size: A4 landscape; margin: 10mm; }

@media print {
  .pack-toolbar { display: none !important; }
  .brand-logo.on-dark { display: none !important; }
  .brand-logo.on-light { display: block !important; }
  svg.bands-chart text.band-label { fill: var(--ink) !important; }
  svg.bands-chart text.band-label.on-dark { fill: #fff !important; }
  .pack-page {
    page: pack;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pack-page:last-child { break-after: auto; }
  body:has(.pack-page) .title-row,
  body:has(.pack-page) .scope-summary,
  body:has(.pack-page) .workspace-footer,
  body:has(.pack-page) #status { display: none !important; }
  body:has(.pack-page) .workspace-shell { padding: 0; }
}

.coach-kpi strong small {
  margin-left: 4px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
}

/* Connected reports */
.nav-back {
  display: inline-block;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.nav-back:hover { text-decoration: underline; }

.related-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -6px 0 14px;
}

.related-links:empty { display: none; }

.related-links > span {
  margin-right: 4px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.related-chip {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.related-chip:hover { border-color: var(--claret); color: var(--ink); }
.related-chip.current { background: var(--claret); border-color: var(--claret); color: #fff; }

button.coach-kpi {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 120ms ease-out;
}

button.coach-kpi:hover { background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--claret); }

.row-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.row-link:hover { color: var(--accent-text); text-decoration: underline; }
.row-actions { text-align: right; white-space: nowrap; }

.inspector-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.pack-body .row-actions,
.pack-body .row-actions + th { display: none; }

@media print {
  .related-links, .nav-back { display: none !important; }
}

.chart-scroll { overflow-x: auto; }
.chart-scroll svg.coach-chart { width: auto; max-width: none; max-height: none; }


/* ==== Filter bar (one standard for every page) ===========================================
   One row of compact pills. A page shows only the filters it uses (PAGE_FILTERS in app.js);
   a changed filter is tinted; "Clear filters (n)" counts them. Native controls stay inside. */
#filter-bar.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

#filter-bar .filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: none;
  height: 34px;
  margin: 0;
  padding: 0 4px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  flex: 0 0 auto;
}

#filter-bar .filter,
#filter-bar label.filter { flex-direction: row; text-align: left; line-height: 1; }
#filter-bar .filter select,
#filter-bar .filter input { display: inline-block; margin-top: 0 !important; vertical-align: middle; text-align: left; }
#filter-bar .player-picker { align-self: center; min-width: 0; }
#filter-bar .player-picker > summary { flex-direction: row; }
#filter-bar .filter:hover { border-color: var(--line-strong); }
#filter-bar .filter:focus-within { border-color: var(--claret); box-shadow: 0 0 0 3px var(--claret-tint); }
#filter-bar .filter.is-set { border-color: var(--claret); background: var(--claret-tint); }

#filter-bar .filter > span:first-child {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

#filter-bar .filter select,
#filter-bar .filter input[type="date"] {
  width: auto;
  min-width: 0;
  min-height: 0;
  height: 30px;
  margin: 0;
  padding: 0 24px 0 2px;
  border: 0;
  background-color: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

#filter-bar .filter input[type="date"] { padding-right: 2px; width: 128px; }
#filter-bar .filter select:focus,
#filter-bar .filter input:focus { outline: none; }
#filter-bar .filter-dash { color: var(--ink-3); }

#filter-bar .player-picker > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  min-height: 0;
  padding: 0 12px 0 0;
  border: 0;
  background: none;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
}

#filter-bar .player-picker > summary::-webkit-details-marker { display: none; }
#filter-bar .player-picker > summary span { margin: 0; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
#filter-bar .player-picker > summary b { font-weight: 600; }
#filter-bar .player-picker > summary::after,
#filter-bar .filter-more > summary::after { content: "▾"; margin-left: 6px; color: var(--ink-3); font-size: 10px; }
#filter-bar .player-options { top: calc(100% + 6px); left: 0; right: auto; }

#filter-bar .filter-more { padding: 0 12px; }
#filter-bar .filter-more > summary { list-style: none; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; }
#filter-bar .filter-more > summary::-webkit-details-marker { display: none; }
#filter-bar .filter-more-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 9;
  min-width: 240px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: 0 12px 28px -12px #0006;
}

#filter-bar .filter-more-panel label { display: flex; flex-direction: column; gap: 6px; color: var(--ink-3); font-size: 11px; font-weight: 600; }
#filter-bar .filter-more-panel select { height: 34px; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 10px; font-size: 13px; }

#filter-bar .filter-divider { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }

#filter-bar .quick-ranges { display: inline-flex; gap: 2px; margin: 0; }
#filter-bar .quick-ranges button {
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--r-chip);
  background: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#filter-bar .quick-ranges button:hover { background: var(--surface-2); color: var(--ink); }
#filter-bar .quick-ranges button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--claret); }

#filter-bar .filter-clear {
  margin-left: auto;
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#filter-bar .filter-clear.is-active { color: var(--accent-text); }
#filter-bar .filter-clear:hover { text-decoration: underline; }
#filter-bar .hidden, #filter-bar.hidden { display: none !important; }

/* Status shows only on errors. */
#status:not(.error) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#status.error { margin: 0 0 12px; }

@media (max-height: 500px) {
  .filter-bar, .history-controls { position: static; }
}

@media (max-width: 760px) {
  #filter-bar.filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  #filter-bar .filter-clear { margin-left: 0; }
}

/* Shared "pick players" pattern (Compare players, Heat map) */
.pick-players {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 14px;
}

/* Searchable dropdown (web/select-search.js): any <select> with more than 10 options opens this list. */
.select-search {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: min(520px, calc(100vw - 16px));
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  box-shadow: 0 16px 36px -14px #000a;
}
.select-search:not(:popover-open) { display: none; }
.select-search-input {
  flex: none;
  height: 38px;
  margin: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: 13px;
}
.select-search-input:focus-visible { outline: 2px solid var(--claret); outline-offset: -1px; }
.select-search-list { flex: 1; min-height: 0; margin: 0; padding: 0 4px 4px; overflow-y: auto; list-style: none; }
.select-search-list [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-ctl);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}
.select-search-list [role="option"].is-active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.select-search-list [aria-selected="true"] { color: var(--accent-text); font-weight: 600; }
.select-search-list [aria-disabled="true"] { color: var(--ink-3); cursor: default; }
.select-search-group { padding: 10px 10px 4px; color: var(--nav-heading); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.select-search-empty { padding: 14px 10px; color: var(--ink-3); font-size: 13px; }
.select-search-count { flex: none; margin: 0; padding: 6px 12px 8px; color: var(--ink-3); font-size: 11px; border-top: 1px solid var(--line); }

/* Credits (Rafael 2026-11-01): Rafa is the brand; the system creator is credited in the menu, About,
   once per printed document (first page) and in PDF metadata. */
.about-link {
  display: block;
  margin: 8px 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--chrome-mute);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.about-link:hover, .about-link:focus-visible { color: var(--chrome-ink); text-decoration: underline; text-underline-offset: 3px; }
.about-body { padding: 4px 20px 20px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.about-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 18px 0 0; }
.about-body dt { color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding-top: 2px; }
.about-body dd { margin: 0; color: var(--ink); }
.about-body a { color: var(--accent-text); }
.pack-credit { margin-top: 1px; }
.print-credit { display: none; }
@media print {
  .print-credit { display: block; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: 9px; }
  body:has(.pack-page) .print-credit { display: none; }
  @page { @bottom-right { content: "Poffo · Page " counter(page) " / " counter(pages); font-size: 8px; color: #5F6672; } }
  @page pack { @bottom-right { content: none; } }
}

/* ==== Home (H01): matchday brief ==========================================================
   Panels match .report-section; section titles match .section-heading h2. The match name is the
   one display-face heading. The ladder (index vs own usual) is the page's single motion moment. */
.home { display: grid; gap: 16px; }
/* Window selector: the first thing on Home, so the page always says which matches it covers */
.home-window { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
.home-window .segmented-control button { padding: 8px 16px; font-family: var(--font-display); font-size: 22px; letter-spacing: 0.02em; }
.home-window .home-note { margin: 0 0 8px; }
.home-body { display: grid; gap: 16px; min-width: 0; }
.home-of { font-family: Inter, sans-serif; font-size: 13px; color: var(--ink-3); letter-spacing: 0; vertical-align: middle; }
.home-panel {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.home-panel h2 {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.home-match h2 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
}
.home-note { margin: 6px 0 0; max-width: 90ch; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.home-match-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.home-match-body { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 32px; align-items: center; }
.home-pitch { margin: 0; }
.home-pitch-canvas { width: 100%; }
.home-pitch canvas { display: block; max-width: 100%; border-radius: var(--r-ctl); }
.home-pitch figcaption { margin-top: 8px; color: var(--ink-3); font-size: 12px; }
.home-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.home-link:hover { text-decoration-thickness: 2px; }

/* Team totals against the league average: value, bar with the average marked, delta */
.home-versus { display: grid; gap: 4px; margin: 0; }
.versus-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(7rem, auto) minmax(0, 1fr) 6.5rem;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.versus-row dt { color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.versus-row dd { margin: 0; }
.versus-value { font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.versus-value small { margin-left: 4px; font-family: Inter, sans-serif; font-size: 12px; color: var(--ink-3); }
.versus-bar svg { display: block; width: 100%; height: 14px; overflow: visible; }
.versus-track { fill: var(--surface-2); }
.versus-fill { fill: var(--claret); }
.versus-avg { stroke: var(--ink); stroke-width: 2; }
.versus-delta { text-align: right; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); }
.versus-delta small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11px; font-weight: 500; }
.home-versus .home-note { margin-top: 10px; }

/* Physical highlights (left) and Needs attention (right): same anatomy, fixed groups, tinted headers */
.home-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.home-column { padding: 0 20px 20px; overflow: hidden; }
.column-head { margin: 0 -20px; padding: 18px 20px 16px; }
.is-highlights .column-head { background: var(--green-tint); }
.is-attention .column-head { background: var(--claret-tint); }
.home-panel .column-head h2 {
  font-family: Inter, sans-serif;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}
.column-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 12.5px; }
.home-column .flag-group:first-of-type { border-top: 0; }
.is-highlights .flag-count { background: var(--green); color: #08170E; }
.flag-empty { margin: 10px 0 0; color: var(--ink-3); font-size: 13px; }
.flag-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.flag-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flag-head h3 { flex: 1; margin: 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.flag-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: var(--r-chip);
  background: var(--claret);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.flag-list { margin: 10px 0 0; padding: 0; list-style: none; }
.flag-list li {
  display: grid;
  grid-template-columns: minmax(9rem, max-content) 2.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
}
.flag-list li + li { border-top: 1px dashed var(--line); }
.home-player { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.home-player:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.home-pos { color: var(--ink-3); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.home-detail { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.flag-rule { margin: 8px 0 0; color: var(--ink-3); font-size: 11.5px; }
.flag-more summary { margin-top: 4px; color: var(--accent-text); font-size: 12px; font-weight: 600; cursor: pointer; }
.home-empty { margin: 16px 0 0; color: var(--ink-2); }

/* The ladder: every ranked player on one axis; 100 is his own usual */
.ladder { display: block; width: 100%; height: auto; margin: 4px 0 18px; overflow: visible; }
.ladder-above { fill: var(--gold); opacity: 0.55; }
.ladder-band { fill: var(--surface-2); }
.ladder-band-label { fill: var(--ink-3); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.ladder-below { fill: var(--line-strong); }
.ladder-tick { stroke: var(--line-strong); }
.ladder-axis { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.ladder-usual { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 3 4; }
.ladder-usual-label { fill: var(--ink-2); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.ladder-dot { cursor: pointer; }
.ladder-dot.is-settling { transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1); }
.ladder-dot circle { stroke: var(--surface); stroke-width: 3; }
.ladder-dot.is-above circle { fill: var(--gold-bright); }
.ladder-dot.is-below circle { fill: var(--ink-3); }
.ladder-stem { stroke: var(--line-strong); stroke-width: 1; }
.ladder-label { fill: var(--ink); font-size: 13px; font-weight: 600; }
.ladder-value { fill: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.ladder-dot:hover .ladder-label, .ladder-dot:focus-visible .ladder-label { fill: var(--accent-text); }
.ladder-dot:focus-visible { outline: none; }
.ladder-dot:focus-visible circle { stroke: var(--claret-bright); stroke-width: 3; }
.home-index-table th small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.home-index-table th[scope="row"] { white-space: nowrap; }
.home-index-table th[scope="row"] .home-pos { margin-left: 8px; }
.home-index-value { font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.home-comp { white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.home-comp .comp-svg { width: 90px; min-width: 90px; height: 10px; margin-right: 8px; vertical-align: -1px; }
.home-comp.is-missing { color: var(--ink-3); }
.comp-track { fill: var(--surface-2); }
.comp-axis { stroke: var(--line-strong); }
.comp-bar.is-up { fill: var(--gold-bright); }
.comp-bar.is-down { fill: var(--ink-3); }
.comp-capped { margin-left: 2px; color: var(--ink-3); font-weight: 700; }

/* Last five league matches */
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.trend-chart { margin: 0; }
.trend-chart figcaption { margin-bottom: 8px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.trend-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend-bar { cursor: pointer; }
.trend-bar rect { fill: var(--chart-3); }
.trend-bar.is-last rect { fill: var(--claret); }
.trend-bar:hover rect, .trend-bar:focus-visible rect { fill: var(--deep-red); }
.trend-bar:focus-visible { outline: none; }
.trend-value { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trend-name { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.trend-venue { fill: var(--ink-3); font-size: 10px; }
.trend-season { stroke: var(--gold-bright); stroke-width: 1.5; stroke-dasharray: 5 4; }
.trend-season-label { fill: var(--gold-bright); font-size: 11px; font-weight: 700; }
:root[data-theme="light"] .trend-season { stroke: var(--gold); }
:root[data-theme="light"] .trend-season-label { fill: var(--secondary-text); }

.home-rules { padding: 14px 20px; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.home-rules summary { color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.home-rules dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 14px 0 0; font-size: 12.5px; }
.home-rules dt { color: var(--ink); font-weight: 650; }
.home-rules dd { margin: 0; color: var(--ink-2); }

.home-skeleton { height: 160px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); }
.home-skeleton-hero { height: 420px; }
@media (prefers-reduced-motion: no-preference) {
  .home-skeleton { animation: home-pulse 1.4s ease-in-out infinite alternate; }
  @keyframes home-pulse { from { opacity: 0.55; } to { opacity: 1; } }
}
.nav-home .nav-label { font-weight: 700; }

@media (max-width: 1100px) {
  .home-match-body, .home-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .home-panel { padding: 16px; }
  .home-match h2 { font-size: 34px; }
  .versus-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .versus-bar { grid-column: 1 / -1; order: 3; }
  .versus-delta { grid-column: 2; grid-row: 1 / span 2; }
  .trend-grid { grid-template-columns: minmax(0, 1fr); }
  .flag-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .flag-list .home-detail { grid-column: 1 / -1; }
  .ladder { display: none; }
}
.home-match-body.numbers-first .home-pitch { order: 2; }

/* Phone header and scope line (mobile review C): the session picker keeps the row; theme, refresh and export sit behind "⋯". */
.header-more, .scope-sticky { display: none; }
@media (max-width: 760px) {
  .app-header { position: relative; flex-wrap: nowrap; align-items: flex-end; }
  .session-heading { flex: 1 1 auto; min-width: 0; }
  .header-more { display: inline-flex; flex: none; min-width: 44px; min-height: 44px; justify-content: center; font-size: 20px; line-height: 1; }
  .header-actions { display: none; position: absolute; top: calc(100% + 4px); right: 14px; z-index: 40; width: min(300px, calc(100vw - 28px)); flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; background: var(--chrome); border: 1px solid var(--chrome-line); border-radius: var(--r-card); box-shadow: 0 14px 34px #1b1e2540; }
  .header-actions.is-open { display: flex; }
  .header-actions .button, .header-actions summary.button { width: 100%; min-height: 44px; justify-content: flex-start; }
  .header-actions .export-options { position: static; width: auto; max-width: none; margin-top: 8px; box-shadow: none; }
  /* Home flag groups: the heading keeps its row; the clock tag and the page link go underneath. */
  .flag-head h3 { flex-basis: calc(100% - 48px); }
  /* Height 0 so it takes no room until it shows; the line itself overflows the sticky box. */
  .scope-sticky { display: block; position: sticky; top: 0; z-index: 30; height: 0; margin: 0 -14px; }
  .scope-sticky > div { display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; overflow: hidden; white-space: nowrap; background: var(--chrome); border-bottom: 1px solid var(--chrome-line); color: var(--chrome-ink); font-size: 12.5px; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity 160ms ease, transform 160ms ease; }
  .scope-sticky.is-shown > div { opacity: 1; transform: none; }
  .scope-sticky strong { flex: none; font-weight: 700; }
  .scope-sticky .scope-badge { display: none; }
  .scope-sticky .scope-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; opacity: 0.8; }
}
@media (max-width: 420px) { .scope-sticky { margin: 0 -10px; } .scope-sticky > div { padding: 8px 10px; } }

.select-search-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-chip);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Heat map without GPS for this session: reason + latest matches with GPS */
.heat-empty p { margin: 0 0 10px; max-width: 70ch; color: var(--ink-2); }
.heat-empty .muted { color: var(--ink-3); font-size: 13px; }
.heat-empty-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* Scope badge: under every title, says what the page's numbers cover (web/scope.js). Neutral on purpose:
   red stays for actions; the icon and the word carry the type. The second line (#scope-summary) names the players. */
#session-context { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; color: var(--ink); font-size: 14px; font-weight: 500; }
.scope-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2);
  color: var(--ink-2); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.scope-badge svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scope-badge .scope-fill { fill: currentColor; stroke: none; }
.scope-badge.is-warn { border-color: var(--gold-bright); color: var(--gold-bright); }
.scope-badge.is-warn + .scope-text { color: var(--gold-bright); }
#scope-summary { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
#scope-summary:empty { display: none; }
.pack-head .pack-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; color: var(--chrome-ink); }
.pack-head .scope-badge { padding: 1px 7px 1px 5px; border-color: var(--chrome-mute); background: transparent; color: var(--chrome-ink); font-size: 9.5px; }
.pack-head .scope-badge svg { width: 12px; height: 12px; }
.pack-head .pack-people { color: var(--chrome-mute); }

/* Card tags (scope.js scopeTag): aggregation in neutral; a different time span in gold with a clock. */
.section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.card-scope {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-3); font-family: Inter, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; max-width: 100%;
}
.card-scope.is-time { border-color: var(--gold); color: var(--gold-bright); }
.card-scope svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Account and settings (top right): the avatar says who is signed in; the cog badge says settings live here. */
.account { position: relative; flex: none; }
.account-button { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--chrome-ink); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--chrome-3); color: var(--chrome-ink); font: 17px/1 var(--font-display); letter-spacing: 0.04em; box-shadow: 0 0 0 2px var(--chrome), 0 0 0 3px var(--gold); }
.avatar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.account-button:hover .avatar { box-shadow: 0 0 0 2px var(--chrome), 0 0 0 3px var(--gold-bright); }
.account-button[aria-expanded="true"] .avatar { background: var(--deep-red); color: #fff; }
.account-who .avatar { background: var(--deep-red); color: #fff; }
.account-cog { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--chrome-2); box-shadow: 0 0 0 2px var(--chrome); color: var(--chrome-ink); transition: transform 240ms cubic-bezier(.2, .8, .2, 1); }
.account-cog svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.account-button:hover .account-cog, .account-button[aria-expanded="true"] .account-cog { transform: rotate(60deg); }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 41; width: min(320px, calc(100vw - 28px)); padding: 8px; background: var(--chrome); border: 1px solid var(--chrome-line); border-radius: 12px; box-shadow: 0 18px 40px -12px #0b0d1066; color: var(--chrome-ink); }
.account-who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid var(--chrome-line); }
.avatar-lg { width: 44px; height: 44px; font-size: 21px; }
.account-who b { display: block; font-size: 14px; }
.account-who span:not(.avatar) { display: block; color: var(--chrome-mute); font-size: 12.5px; overflow-wrap: anywhere; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.account-row .segmented-control { flex-wrap: nowrap; }
.account-row.is-later { color: var(--chrome-mute); font-weight: 500; }
.account-value { display: inline-flex; align-items: center; gap: 8px; }
.account-value em { padding: 2px 7px; border: 1px solid var(--chrome-line); border-radius: var(--r-chip); font-size: 10.5px; font-style: normal; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.account-note { margin: 0 10px 8px; color: var(--chrome-mute); font-size: 12px; line-height: 1.45; }
.account-logout { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin-top: 4px; padding: 8px 10px; border: 0; border-top: 1px solid var(--chrome-line); border-radius: 0 0 6px 6px; background: transparent; color: var(--accent-text); font-weight: 600; text-align: left; }
.account-logout:not(:disabled):hover { background: var(--claret-tint); }
.account-logout:disabled { opacity: 1; color: var(--chrome-mute); cursor: not-allowed; }
.account-logout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media print { .account { display: none !important; } }
