/* Final product polish: quiet surfaces, readable hierarchy and consistent controls. */
:root {
  --bg: #f6f8fc;
  --surface: #fff;
  --line: #e3e9f2;
  --text: #203b59;
  --muted: #677b93;
  --blue: #2464df;
}
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { letter-spacing: 0; }
button, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.button, .product-tools > summary, input:not([type=range]):not([type=checkbox]), select, textarea {
  border-radius: 9px;
}
.button { min-height: 44px; font-size: 16px; font-weight: 500; box-shadow: none; }
.button.primary { background: #2464df; border-color: #2464df; box-shadow: 0 2px 5px #244fba0c; }
.button.primary:hover:not(:disabled) { background: #1e57c9; border-color: #1e57c9; }
.button.secondary { border-color: #dae4f0; background: #fff; color: #405d7d; }
.button.secondary:hover:not(:disabled) { border-color: #a2bcea; background: #f8faff; }
.button.danger { background: #fff3f4; border-color: #f1d8dc; color: #b34253; }
.button:disabled { opacity: 1; background: #f5f7fb; border-color: #e4eaf3; color: #7e90a7; }
.icon-button { display: inline-grid; place-items: center; border-radius: 9px; color: #617891; }
.icon-button:hover:not(:disabled) { background: #f0f5ff; color: #2464df; }
.link-button { text-underline-offset: 4px; }
.link-button:hover:not(:disabled) { color: #205bcf; }
input:not([type=range]):not([type=checkbox]), select, textarea {
  border-color: #dce5f0;
  color: #294867;
  min-height: 44px;
  box-shadow: 0 1px 2px #243b5a03;
}
input::placeholder, textarea::placeholder { color: #7a8da6; }
input:not([type=range]):focus, select:focus, textarea:focus {
  border-color: #7da5eb;
  outline: 3px solid #e6eeff;
  outline-offset: 0;
}
.badge { line-height: 1.45; border-radius: 6px; padding: 5px 9px; font-size: 15px; }
.badge.quiet { background: #f7f9fc; color: #647d97; border-color: #e1e8f1; }
.badge.good { background: #eef8f2; color: #297e57; }
.badge.warning { background: #fff6e7; color: #947023; }
.badge.bad { background: #fdf0f2; color: #b14554; }
.sidebar { border-right-color: #e5ebf4; box-shadow: none; }
.brand { padding-left: 7px; }
.brand-mark { box-shadow: none; font-weight: 700; background: #2464df; }
.sidebar nav { margin-top: 30px; gap: 5px; }
.nav-item { min-height: 46px; font-weight: 500; color: #60758e; line-height: 1.45; border-radius: 9px; }
.nav-item.active, .nav-item[aria-current=page] { background: #edf3ff; color: #235fcd; font-weight: 600; }
.nav-item svg { stroke-width: 1.7; }
.nav-item b { background: #dfeaff; color: #2464df; font-weight: 500; line-height: 1.35; }
.library-heading { border-top-color: #ecf0f6; margin-top: 24px; padding-top: 17px; }
.library-launcher { color: #4d6888; background: #fff; font-weight: 500; font-size: 16px; gap: 10px; }
.library-launcher:hover { background: #f3f7fe; color: #2464df; }
.library-launcher svg { color: #6d85a0; width: 21px; height: 21px; }
.library-launcher b { background: #f3f6fb; border-radius: 6px; padding: 2px 6px; font-size: 15px; }
.sidebar-bottom { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); width: 100%; min-width: 0; gap: 7px 4px; padding-top: 20px; margin-top: auto; }
.sidebar-bottom .engine-line { grid-column: 1 / -1; padding-left: 7px; margin: 0 0 3px; font-size: 15px; color: #6e819a; }
.sidebar-bottom .link-button { min-width: 0; max-width: 100%; text-align: left; min-height: 36px; padding: 5px 7px; font-size: 15px; float: none; white-space: normal; overflow-wrap: anywhere; }
.sidebar-bottom .library-dataset-link { text-align: right; }
#languageSwitcher, .language-switcher { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; width: auto; min-width: 0; max-width: 100%; box-sizing: border-box; margin: 8px 0 0; position: relative; padding: 5px 8px; border: 1px solid #e0e7f0; border-radius: 10px; background: #fff; color: #647b94; }
#languageSwitcher label, .language-switcher label { display: flex; gap: 9px; align-items: center; color: #647b94; margin: 0; font-size: 15px; }
#languageSwitcher svg, .language-switcher svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#languageSelect { flex: 1 1 auto; min-width: 0; min-height: 36px; margin: 0; padding: 5px 8px; border: 0; border-radius: 7px; background: #fff; color: #405c7b; font-size: 16px; box-shadow: none; cursor: pointer; }
#languageSwitcher.is-modal-language { display: flex; align-items: center; gap: 8px; position: fixed; left: 16px; bottom: 16px; z-index: 100; width: 184px; min-width: 0; max-width: calc(100vw - 32px); box-sizing: border-box; margin: 0; padding: 6px 9px; border: 1px solid #dce6f2; border-radius: 10px; background: #fff; color: #647b94; box-shadow: 0 5px 20px #19395b16; }
.topbar { gap: 24px; margin-bottom: 24px; }
.topbar h1 { font-size: 26px; line-height: 1.4; font-weight: 600; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb { font-size: 15px; color: #7688a0; font-weight: 500; }
.breadcrumb > span:first-child { color: #b0bdce; }
.topbar-actions { gap: 9px; max-width: 100%; }
.product-tools > summary { border-color: #dae4f0; min-height: 44px; color: #496581; font-size: 16px; padding: 9px 13px; }
.product-tools > summary::after { color: #7c8fa8; }
.product-tools-popover { padding: 9px; border-radius: 12px; border-color: #dfe7f2; box-shadow: 0 12px 36px #17345814; }
.product-tools-popover > .button { min-height: 44px; padding: 10px 13px; border-radius: 7px; }
.product-match-info { padding: 15px 13px 7px; border-top-color: #ebf0f6; margin-top: 8px; }
.product-match-info h3 { margin-bottom: 8px; font-size: 16px; color: #3d5d80; font-weight: 600; }
.product-match-info #videoMeta, .product-match-info .provenance-banner span { color: #6b809a; font-size: 15px; }
.workspace-heading { margin-bottom: 18px; }
.workspace-heading h2 { font-size: 23px; font-weight: 600; color: #26476a; }
.workspace-heading > .button { border-color: #e1e8f3; }
.workspace-options { border-color: #dde6f2; background: #fff; }
.workspace-options > summary { font-size: 15px; font-weight: 500; color: #56708e; }
.workspace-options[open] { padding: 12px 14px; box-shadow: 0 7px 20px #243d6210; }
.job-banner .job-actions > .button { border-color: #dde6f2; color: #56708e; }
.job-banner .job-actions > .button.primary { color: #fff; border-color: #2464df; }
.card { border-color: #e2e9f2; border-radius: 13px; box-shadow: 0 2px 6px #17395e02; }
#workspace .analysis-grid { grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); align-items: start; }
.card-heading { gap: 20px; padding: 22px 24px; }
.card-heading h2 { color: #244366; font-weight: 600; }
.card-heading p { color: #6c819b; }
#workspace[data-workspace-section=overview] .stat-grid { border-color: #e2e9f2; border-radius: 13px; margin-bottom: 24px; }
.stat-card { padding-top: 18px; padding-bottom: 18px; border-right-color: #e9eef5; }
.stat-top { color: #697f99; font-size: 15px; }
.stat-value { color: #254975; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-value small { color: #7087a0; font-size: 15px; }
.workspace-stat-action { background: #f2f6ff; color: #557dba; }
.workspace-stat-action:hover { background: #e6efff; color: #2464df; }
.video-card .card-heading, .pitch-card .card-heading { padding: 18px 20px; gap: 12px; }
.video-stage { border-radius: 9px; background: #172637; }
.video-tag { font-size: 15px; font-weight: 500; background: #142538bc; padding: 5px 9px; border-radius: 5px; }
.timeline { color: #59758f; font-size: 15px; padding-top: 12px; padding-bottom: 16px; gap: 10px; }
.timeline .icon-button { background: #eff4fd; border-radius: 8px; }
.segmented { border-color: #e5ebf3; background: #f5f7fb; padding: 3px; gap: 3px; }
.segmented button { color: #6a809a; font-weight: 500; min-height: 37px; font-size: 16px; padding: 8px 13px; }
.segmented button.active { color: #235fcd; box-shadow: 0 1px 3px #2845690e; }
.players-card .card-heading { align-items: flex-start; row-gap: 18px; }
.players-card .table-tools { padding-top: 1px; max-width: 100%; }
.players-card .table-tools input { background: #fafbfd; }
.players-card th { background: #f8fafd; color: #657e99; font-size: 15px; font-weight: 500; padding: 15px 20px; vertical-align: middle; }
.players-card td { vertical-align: middle; padding: 17px 20px; color: #3e5b7a; font-variant-numeric: tabular-nums; }
.players-card td:last-child .link-button { font-size: 16px; font-weight: 500; min-height: 38px; padding: 6px 0; white-space: nowrap; }
.player-cell { gap: 12px; }
.player-cell strong { color: #28496c; font-weight: 600; }
.player-cell small { font-size: 15px; color: #6c819b; }
.shirt { width: 36px; min-width: 36px; height: 36px; line-height: 36px; clip-path: none; border-radius: 8px; font-size: 16px; font-variant-numeric: tabular-nums; }
.player-pagination { color: #6b829c; font-size: 15px; border-top-color: #eaf0f6; padding-top: 17px; padding-bottom: 17px; }
.player-pagination .button { font-size: 15px; border-color: #e0e7f2; }
.team-summary { border-color: #e2e9f2; border-radius: 11px; }
.team-summary-title strong { font-weight: 600; color: #2b4d72; }
.team-summary-values strong { font-variant-numeric: tabular-nums; color: #305681; }
.team-summary-note { border-top-color: #edf1f7; }
.tactics-sidebar { background: #f8fafd; border-radius: 10px; }
.tactics-fact { border-bottom-color: #e6edf5; font-size: 16px; color: #637b96; }
.tactics-fact strong { color: #284b70; font-weight: 600; }
.workspace-timeline { background: #fbfcfe; border-color: #e9eef5; }
.product-secondary-panel { border-color: #e2e9f2; border-radius: 13px; }
.product-secondary-panel > summary { color: #315578; font-weight: 600; font-size: 20px; }
.product-secondary-panel > summary::after { color: #7893b5; }
.event-filters { max-width: calc(100% - 48px); width: fit-content; }
.event-item { border-top-color: #e9eef6; padding-top: 19px; padding-bottom: 19px; }
.event-time { border: 0; background: #f1f6fe; color: #3369b6; border-radius: 7px; font-size: 16px; }
.event-info strong { color: #31516f; font-weight: 600; }
.event-info small { color: #6d819b; font-size: 15px; }
.event-actions { gap: 8px; }
.quality-row { color: #627b94; border-top-color: #e9eef6; }
.quality-row strong { color: #2c5177; font-variant-numeric: tabular-nums; }
.quality-more-warnings, .quality-note { border-radius: 9px; }
.quality-more-warnings { background: #f9fbfe; border-color: #e3ebf4; }
.quality-warning { background: #fff8ec; border-left-color: #dcab54; color: #876725; }
.workspace-evidence { background: #fff; border-color: #e2e9f2; }
.workspace-evidence > summary { font-size: 18px; font-weight: 500; color: #486785; }
.main-footer { font-size: 15px; color: #788fa8; border-top-color: #e4eaf3; }
.main-footer > span:first-child { color: #70859e; }
dialog { border-color: #e0e7f1; border-radius: 15px; box-shadow: 0 24px 75px #142f5129; }
dialog::backdrop { background: #172f5160; }
.dialog-heading { gap: 18px; }
.dialog-heading h2 { color: #25496f; font-weight: 600; }
.dialog-heading .icon-button { background: #f5f7fb; color: #6d8098; }
.dialog-heading .icon-button:hover { color: #285dc3; background: #eef3fd; }
.dialog-footer { border-top-color: #e8eef6; }
.form-error { color: #b54f5e; font-size: 16px; }
.file-drop { background: #f8faff; border-color: #bed0eb; border-radius: 10px; }
.export-links a { background: #f8faff; border-color: #e0e9f4; color: #436b9c; border-radius: 9px; }
.toast { border: 1px solid #cfe3d9; background: #f5fcf8; color: #326750; border-radius: 10px; box-shadow: 0 9px 28px #19395216; font-size: 16px; }
.toast.error { border-color: #efcfd4; background: #fff7f8; color: #a24956; }
.match-library-dialog { width: min(800px, calc(100vw - 40px)); max-height: 88dvh; overflow: auto; }
.match-library-dialog[open] { display: flex; flex-direction: column; height: min(760px,88dvh); }
.match-library-dialog > .dialog-heading, .match-library-dialog > .match-library-search, .match-library-dialog > .match-library-summary, .match-library-dialog > .library-current-selection { flex-shrink: 0; }
.match-library-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 90px; overflow: hidden; }
.match-library-dialog .dialog-heading { padding: 25px 28px 18px; }
.library-current-selection { margin: 0 28px 20px; padding: 16px 18px; background: #f4f7fd; border-radius: 10px; }
.library-current-selection h3 { font-size: 15px; color: #607997; font-weight: 500; margin: 0 0 7px; line-height: 1.5; }
.library-current-selection .sidebar-current-match { display: block; margin: 0; }
.library-current-selection .sidebar-current-match button { display: block; width: 100%; min-height: 0; padding: 0; text-align: left; background: transparent; border: 0; border-radius: 0; color: #2c5178; }
.library-current-selection .sidebar-current-match button:hover { color: #205bcc; background: transparent; }
.library-current-selection .sidebar-current-match strong { display: block; font-size: 18px; font-weight: 600; line-height: 1.55; overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.library-current-selection .sidebar-current-match small { display: block; font-size: 15px; line-height: 1.5; margin-top: 5px; color: #6b83a1; }
.match-library-search { padding-bottom: 16px; }
.match-library-search input { min-height: 47px; background: #fff; border-color: #dce6f2; font-size: 16px; }
.match-library-summary { font-size: 15px; color: #6f86a0; padding-bottom: 13px; }
.match-library-summary .link-button { color: #2b65c7; font-size: 16px; padding: 5px 0; }
.match-library-dialog .match-list { display: block; flex: 1 1 auto; max-height: none; min-height: 0; padding: 0 14px 14px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cdd9e9 transparent; }
.match-library-dialog .match-item { padding: 16px 15px; border-bottom-color: #edf2f8; transition: background .12s; }
.match-library-dialog .match-item strong { color: #365673; font-size: 17px; font-weight: 500; }
.match-library-dialog .match-item small { color: #6e849d; font-size: 15px; }
.match-library-dialog .match-item.active { background: #edf3ff; position: relative; }
.match-library-dialog .match-item.active strong { color: #235ece; font-weight: 600; }
.match-library-dialog .match-item.active::before { content: ''; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: #3e79de; }
.match-library-empty { font-size: 16px; color: #6d839e; padding: 24px; }
#profileContent .profile-header { border-bottom-color: #e5ebf3; }
#profileContent .profile-title h2 { font-weight: 600; color: #25496f; }
#profileContent .profile-avatar { background: #edf3ff; color: #2866c8; font-weight: 600; }
#profileContent .profile-stat strong { color: #315e99; font-weight: 600; font-variant-numeric: tabular-nums; }
#profileContent .profile-tabs { gap: 30px; border-bottom-color: #e4ebf4; }
#profileContent .profile-tab { color: #647c95; font-size: 17px; }
#profileContent .profile-tab[aria-selected=true] { color: #2864cc; font-weight: 600; }
#profileContent .profile-panel h3 { color: #2b5075; font-weight: 600; }
.club-view-tabs { border-bottom-color: #e4ebf4; }
.club-view-tabs > button { color: #647c95; font-weight: 500; }
.club-view-tabs > button[aria-selected=true] { color: #2864cc; font-weight: 600; }
.club-insight-top h3 { font-weight: 600; color: #2c5075; }
.club-timeline-controls button { border-color: #dce5f0; border-radius: 9px; min-height: 44px; }
html:lang(en) .sidebar .nav-item { font-size: 16px; gap: 10px; }
html:lang(en) .sidebar .library-launcher { font-size: 16px; }
html:lang(en) .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
html:lang(en) .players-card .table-tools { flex-wrap: wrap; }
html:lang(en) .players-card th { white-space: normal; min-width: 110px; }
html:lang(en) .players-card th:first-child { min-width: 180px; }
@media (max-width: 1150px) {
  #workspace .analysis-grid { grid-template-columns: minmax(0,1fr); }
  .topbar { flex-wrap: wrap; gap: 15px; }
  .topbar > div:first-child { flex-basis: 100%; }
  .topbar-actions { justify-content: flex-start; flex-wrap: wrap; }
  html:lang(en) .topbar-actions { justify-content: flex-start; }
  .topbar h1 { font-size: 25px; }
  .sidebar-bottom .link-button { padding-left: 4px; padding-right: 4px; }
}
@media (max-width: 760px) {
  body { padding-bottom: 72px; }
  .sidebar { overflow: visible; grid-template-columns: minmax(0,1fr) auto; }
  .sidebar nav { gap: 5px; margin-top: 0; flex-wrap: nowrap; }
  .sidebar .library-heading { margin: 0; padding: 0; }
  .library-launcher { font-size: 0; padding: 9px 12px; background: #f5f8fd; }
  .library-launcher svg { width: 21px; height: 21px; }
  .sidebar .sidebar-bottom { display: block; grid-column: 1 / -1; height: 0; padding: 0; margin: 0; }
  .sidebar .sidebar-bottom > .engine-line, .sidebar .sidebar-bottom > .link-button { display: none; }
  .sidebar #languageSwitcher, .sidebar .language-switcher { display: flex; align-items: center; gap: 8px; position: fixed; bottom: 14px; left: 14px; z-index: 45; width: 184px; max-width: calc(100vw - 28px); margin: 0; background: #fff; border: 1px solid #dce6f2; border-radius: 10px; padding: 6px 9px; box-shadow: 0 5px 20px #19395b16; }
  .sidebar #languageSelect { display: block; min-height: 36px; min-width: 106px; border: 0; background: #fff; margin: 0; padding: 5px 8px; font-size: 16px; }
  .sidebar #languageSwitcher label, .sidebar .language-switcher label { margin: 0; gap: 8px; }
  .sidebar #languageSwitcher svg, .sidebar .language-switcher svg { width: 18px; height: 18px; }
  .library-current-selection { margin: 0 20px 17px; padding: 15px 16px; }
  .library-current-selection .sidebar-current-match strong { font-size: 17px; }
  .match-library-dialog { width: calc(100vw - 24px); max-height: 88dvh; }
  .match-library-dialog .match-list { max-height: none; padding-left: 9px; padding-right: 9px; }
  .match-library-summary { gap: 14px; }
  .match-library-summary .link-button { white-space: nowrap; }
  .topbar { gap: 14px; }
  .topbar h1 { font-size: 24px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-start; }
  .players-card .table-tools { padding-top: 0; }
  .players-card td { padding: 13px 16px; }
  .event-filters { max-width: calc(100% - 36px); }
  .event-actions { gap: 9px; }
  html:lang(en) .library-launcher { font-size: 0; }
  html:lang(en) .sidebar .nav-item { font-size: 16px; gap: 7px; }
  html:lang(en) .players-card th { min-width: 0; }
}
@media (max-width: 480px) {
  .topbar-actions .button, .product-tools > summary { font-size: 15px; min-height: 43px; }
  .match-library-dialog .dialog-heading { padding: 20px 20px 15px; }
  .match-library-dialog .dialog-heading h2 { font-size: 23px; }
  .library-current-selection { margin-bottom: 15px; padding: 13px 15px; }
  .library-current-selection h3 { margin-bottom: 5px; }
  .library-current-selection .sidebar-current-match small { margin-top: 3px; }
  .match-library-search { padding-bottom: 14px; }
  .match-library-summary { font-size: 15px; padding-bottom: 11px; }
  .match-library-dialog .match-list { max-height: none; }
  .match-library-dialog .match-item { padding-top: 15px; padding-bottom: 15px; }
  .match-library-dialog .match-item strong { font-size: 16px; }
  .match-library-summary .link-button { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .match-library-dialog .match-item { transition: none; }
}


/* Use the viewport for evidence; preserve readable type and natural scrolling. */
@media (min-width: 761px) {
  body > main { padding: 20px 28px 18px; }
}
.topbar { margin-bottom: 16px; }
.workspace-heading { margin-bottom: 12px; }
#workspace > [data-panel], #workspace .lower-grid > [data-panel] { margin-bottom: 16px; }
#workspace .analysis-grid { gap: 18px; margin-bottom: 16px; }
.overview-media-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#workspace[data-workspace-section=overview] .overview-media-column .stat-grid {
  grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0;
}
.overview-media-column .stat-card { padding: 13px 18px; }
.overview-media-column .stat-card:nth-child(2n) { border-right: 0; }
.overview-media-column .stat-card:nth-child(-n+2) { border-bottom: 1px solid #e9eef5; }
.overview-media-column .stat-top { font-size: 15px; }
.overview-media-column .stat-value { font-size: 28px; margin-top: 5px; }
.overview-media-column .workspace-stat-action { right: 10px; bottom: 12px; }
.video-card .card-heading, .pitch-card .card-heading { min-height: 62px; padding: 14px 18px; }
.pitch-card .pitch-legend { margin-top: 8px; margin-bottom: 8px; padding-top: 0; }
.pitch-card .viz-pitch-controls { padding-top: 4px; padding-bottom: 14px; }
.card-heading { padding: 17px 22px; }
.card-heading p { margin-top: 4px; }
.players-card .card-heading { row-gap: 12px; }
.players-card th { padding: 12px 18px; }
.players-card td { padding: 12px 18px; }
.player-pagination { padding: 12px 20px; }
.event-item { padding: 15px 22px; }
.event-navigation { margin-bottom: 14px; }
.quality-row { padding: 13px 0; }
.product-secondary-panel { margin: 16px 0; }
.product-secondary-panel > summary { padding: 16px 22px; }
.main-footer { margin-top: 18px; padding-top: 14px; }

/* Compare the spatial snapshot and its time series on one surface. */
#workspace .tactics-card > .card-heading { padding: 16px 22px; }
#workspace .tactics-card .workspace-timeline { padding: 10px 22px; gap: 12px; }
#workspace .tactics-layout {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: start; padding: 16px 22px 20px; gap: 22px;
}
#tacticsCanvas { width: 100%; max-width: 620px; height: auto; aspect-ratio: 105 / 68; margin-inline: auto; }
.tactics-pitch-pane { min-width: 0; }
.tactics-pitch-pane .viz-legend { margin: 10px 0; gap: 8px 16px; font-size: 15px; }
.tactics-pitch-pane .card-footnote { padding: 0; margin: 10px 0 0; font-size: 15px; line-height: 1.6; }
#workspace .tactics-sidebar { background: transparent; border-radius: 0; padding: 0 0 0 22px; border-left: 1px solid #e5ebf4; }
#tacticsFacts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
#tacticsFacts .tactics-fact { display: grid; gap: 4px; padding: 7px 0; font-size: 15px; line-height: 1.45; min-width: 0; }
#tacticsFacts .tactics-fact strong { font-size: 18px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
#workspace .tactics-sidebar .quality-note { margin-top: 10px; font-size: 15px; line-height: 1.6; }
#workspace .tactics-sidebar .viz-shape-panel { margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid #e5ebf4; }
#workspace .tactics-sidebar .viz-shape-panel h3 { margin: 0 0 10px; font-size: 20px; }
#workspace .tactics-sidebar .viz-shape-controls { margin: 0 0 10px; max-width: none; gap: 12px; }
#workspace .tactics-sidebar .viz-shape-controls label { flex-direction: row; align-items: center; gap: 8px; font-size: 15px; margin: 0; }
#workspace .tactics-sidebar .viz-shape-controls select { flex: 1; min-height: 40px; padding: 6px 8px; font-size: 15px; margin: 0; }
#workspace .tactics-sidebar #shapeChart { height: 200px; }
#workspace .tactics-sidebar #shapeChartLegend { margin: 8px 0 0; font-size: 15px; gap: 8px 16px; }
#workspace[data-workspace-section=tactics] .teams-panel { margin: 16px 0; gap: 16px; }
.team-summary { padding: 14px 20px; }
.team-summary-title { margin-bottom: 10px; }
.team-summary-values strong { font-size: 23px; }
.team-summary-note { margin-top: 10px; padding-top: 8px; }

/* Player and coach reports keep more of the analysis above the fold. */
#profileContent .profile-header { padding: 18px 26px; }
#profileContent .profile-content { padding: 18px 26px 24px; }
#profileContent .profile-meta { margin-bottom: 14px; }
#profileContent .profile-stats { margin-bottom: 16px; }
#profileContent .profile-stat { padding: 15px 18px; }
#profileContent .profile-tabs { margin-bottom: 18px; }
#profileContent .profile-tab { padding-top: 9px; padding-bottom: 10px; }
#profileContent .profile-grid { gap: 22px; margin-bottom: 20px; }
#profileContent .profile-grid > .profile-panel + .profile-panel { padding-left: 22px; }
#profileContent .profile-panel > p { margin-bottom: 12px; }
.club-card { margin-top: 0; }
.club-report-actions { margin-bottom: 16px; }
.club-summary { margin: 16px 0 18px; }
.club-summary > div { padding: 15px 20px; }
.club-view-tabs { margin-bottom: 18px; }
.club-insight { padding: 18px 0; }
.club-insight p { margin: 9px 0; }

@media (max-width: 999px) {
  #workspace .tactics-layout { grid-template-columns: minmax(0,1fr); }
  #workspace .tactics-sidebar { padding: 16px 0 0; border-left: 0; border-top: 1px solid #e5ebf4; }
}
@media (max-width: 900px) {
  #profileContent .profile-grid > .profile-panel + .profile-panel { padding-left: 0; padding-top: 18px; }
}
@media (max-width: 760px) {
  .overview-media-column { gap: 14px; }
  .overview-media-column .stat-card { padding: 13px 15px; }
  #workspace .tactics-layout { padding: 14px 16px 18px; gap: 16px; }
  #workspace .tactics-card > .card-heading { padding: 16px; }
  #workspace .tactics-card .workspace-timeline { padding: 10px 16px; }
  #workspace .tactics-sidebar .viz-shape-controls label { flex-direction: column; align-items: stretch; }
  #profileContent .profile-header { padding: 16px 18px; }
  #profileContent .profile-content { padding: 16px 18px 22px; }
}

#workspace:has([data-tactics-mode=shape].active) #tacticsFacts:has(> .tactics-fact:nth-child(6):last-child) { grid-auto-flow: column; grid-template-rows: repeat(3,auto); }

/* The chart uses CSS pixels at its final flex size. Keep the legend on its title row. */
body[data-module=profile] #workspace .tactics-sidebar .viz-shape-heading {
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
  gap:6px 12px;margin:0 0 6px;flex:none;
}
body[data-module=profile] #workspace .tactics-sidebar .viz-shape-heading h3 {
  margin:0;font-size:18px;line-height:24px;flex:none;
}
body[data-module=profile] #workspace .tactics-sidebar .viz-shape-heading #shapeChartLegend {
  margin:0;font-size:15px;line-height:24px;gap:6px 14px;
}
/* Match the shared 1000px split; short windows may scroll instead of clipping the chart. */
@media (min-width:1000px) and (max-height:719px) {
  html body[data-module=profile]:has(#workspace[data-workspace-section=tactics][data-tactical-view=spatial])>main {
    height:auto;min-height:calc(100dvh - 48px);
  }
  html body[data-module=profile] #workspace[data-workspace-section=tactics][data-tactical-view=spatial],
  html body[data-module=profile] #workspace[data-tactical-view=spatial]>.tactics-card,
  html body[data-module=profile] #workspace[data-tactical-view=spatial] .tactics-layout {flex:none;}
  body[data-module=profile] #workspace[data-tactical-view=spatial] .tactics-pitch-pane #tacticsCanvas {
    height:auto;min-height:220px;flex:none;
  }
  body[data-module=profile] #workspace[data-tactical-view=spatial] .tactics-sidebar #shapeChart {
    height:200px;min-height:140px;flex:none;
  }
}
