:root {
  --ink: #17201c;
  --muted: #65736c;
  --line: #d8e1da;
  --soft: #eef3ef;
  --white: #ffffff;
  --court: #1f684d;
  --court-dark: #143f32;
  --accent: #c9ef4b;
  --warning: #d96d3f;
  --blue: #2367a6;
  --shadow: 0 18px 44px rgba(23, 32, 28, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f7f8f4;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

button,
input,
select {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 46px);
  border-bottom: 1px solid rgba(216, 225, 218, 0.78);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand,
.main-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 380px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.main-nav {
  gap: clamp(14px, 3vw, 30px);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

main {
  padding: clamp(20px, 4vw, 46px);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 430px);
  gap: clamp(22px, 5vw, 64px);
  align-items: center;
  min-height: 155px;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(20, 63, 50, 0.94), rgba(31, 104, 77, 0.88)),
    url("assets/club-hero.png") center / cover;
  color: var(--white);
}

.toolbar-link {
  width: fit-content;
}

.season-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.season-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #ead77b;
  border-radius: 999px;
  background: #fff7c7;
  color: #594a0b;
  font-weight: 800;
  cursor: pointer;
}

.season-button:hover,
.season-button:focus-visible {
  background: #f7e99b;
}

.season-button.is-active {
  border-color: #e2c94f;
  background: #f5df72;
  color: #403500;
}

.captain-toolbar {
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
}

#seasonTitle {
  max-width: none;
  font-size: clamp(1.1rem, 2vw, 2rem);
  white-space: nowrap;
}

.hero-logo-wrap {
  position: relative;
  display: block;
  width: clamp(150px, 18vw, 210px);
  aspect-ratio: 1 / 1;
  justify-self: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 1) 0 36%, rgba(239, 246, 242, 0.96) 62%, rgba(196, 215, 205, 0.98) 100%);
  box-shadow:
    0 26px 38px rgba(0, 0, 0, 0.28),
    0 10px 14px rgba(0, 0, 0, 0.2),
    inset 0 6px 10px rgba(255, 255, 255, 0.92),
    inset 0 -10px 16px rgba(20, 63, 50, 0.18);
  overflow: hidden;
  transform: perspective(650px) rotateX(6deg) rotateY(-8deg);
  transform-style: preserve-3d;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-logo-wrap:hover,
.hero-logo-wrap:focus-visible {
  box-shadow:
    0 30px 42px rgba(0, 0, 0, 0.32),
    0 12px 16px rgba(0, 0, 0, 0.22),
    inset 0 6px 10px rgba(255, 255, 255, 0.92),
    inset 0 -10px 16px rgba(20, 63, 50, 0.18);
  transform: perspective(650px) rotateX(4deg) rotateY(-5deg) translateY(-2px);
}

.hero-logo-wrap:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.hero-logo-wrap::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 42%, rgba(20, 63, 50, 0.12) 100%);
  pointer-events: none;
}

.hero-logo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset -12px -16px 22px rgba(20, 63, 50, 0.18);
  pointer-events: none;
}

.hero-logo {
  display: block;
  position: absolute;
  inset: 20px;
  z-index: 2;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.22));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(1.1rem, 2.25vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
}

.upload-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.file-drop {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.file-drop span {
  font-weight: 800;
}

.file-drop input {
  width: 100%;
  color: rgba(255, 255, 255, 0.82);
}

.secondary-drop {
  background: rgba(0, 0, 0, 0.1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--court);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.button.ghost {
  background: var(--accent);
  color: var(--ink);
}

.button.full {
  width: 100%;
}

.button.small {
  min-height: 36px;
  padding: 8px 12px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.toolbar-help {
  width: fit-content;
  min-height: 34px;
  margin: 0 0 12px;
  padding: 8px 14px;
  border: 1px solid #cfe7d5;
  background: #f1fbf3;
  color: #1c523b;
  box-shadow: none;
}

.modal-open {
  overflow: hidden;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(23, 32, 28, 0.62);
}

.help-modal.is-open {
  display: flex;
}

.help-dialog {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
}

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.help-head h2 {
  font-size: 1.35rem;
}

.help-close {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.help-body {
  display: grid;
  gap: 14px;
  padding: 20px 22px 24px;
  color: var(--ink);
}

.help-body p {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.upload-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.92rem;
}

.feature-line {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.92rem;
}

.feature-line.is-empty {
  min-height: 45px;
}

.didja-wrap {
  position: relative;
  width: fit-content;
  margin: 16px 0;
}

.didja-know {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dff3e5;
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cellipse cx='9' cy='8' rx='5' ry='6.5' fill='none' stroke='%2317201c' stroke-width='1.8' transform='rotate(-32 9 8)'/%3E%3Cpath d='M5.5 7.2l7 1.4M5.8 10.2l6.7 1.4M7.5 3.1l3.2 11M10.9 2.8l3 10.4' stroke='%23c9ef4b' stroke-width='1' stroke-linecap='round'/%3E%3Cpath d='M12.4 12.8l6.6 6.6' stroke='%2317201c' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M17.2 17.6l2.6 2.6' stroke='%23c9ef4b' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, pointer;
  font-size: 0.92rem;
  font-weight: 800;
}

.didja-know:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.didja-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 30;
  display: none;
  width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(23, 32, 28, 0.16);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.didja-wrap:hover .didja-tooltip,
.didja-know:focus + .didja-tooltip,
.didja-know.is-open + .didja-tooltip {
  display: block;
}

.feature-label {
  font-weight: 800;
}

#latestInfoLine[hidden] {
  display: none;
}

#latestInfoLine:not([hidden]):not(.is-empty) {
  animation: news-attention 1.2s ease-in-out 3;
}

@keyframes news-attention {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  #latestInfoLine:not([hidden]):not(.is-empty) {
    animation: none;
  }
}

#portalFeatures,
#latestInfo {
  text-align: left;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--muted);
  white-space: pre-line;
}

.overview-grid,
.report-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr) minmax(360px, 1.35fr);
  gap: 14px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.overview-card,
.filters,
.data-area,
.report-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.overview-card {
  min-width: 0;
  min-height: 188px;
  padding: 18px 20px;
}

.overview-card {
  display: grid;
  align-content: center;
}

.metric-list {
  display: grid;
  gap: 12px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 42px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(216, 225, 218, 0.72);
}

.metric-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.metric-row .kpi-range {
  grid-column: 1;
  justify-self: start;
  margin-top: -8px;
}

.metric-row-has-range {
  align-items: start;
}

.metric-row-has-range strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  padding-top: 0;
}

.overview-card .kpi-label {
  display: flex;
  align-items: center;
  color: var(--muted);
  min-height: 2.2em;
  font-size: 0.76rem !important;
  line-height: 1.15 !important;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-card .kpi-label-with-note {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.overview-card .kpi-note {
  font-size: 0.68rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
  text-transform: none;
}

.kpi-label-two-line {
  line-height: 1.08 !important;
  min-height: 3.05em !important;
}

.overview-card .kpi-title {
  text-transform: none;
}

#totalMatchesLabel {
  font-size: 0.84rem !important;
  line-height: 1.15 !important;
  text-transform: uppercase !important;
}

.overview-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-teams {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.summary-ranking-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.summary-ranking-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 0.8fr 0.95fr;
  gap: 12px;
  align-items: baseline;
}

.summary-ranking-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 0.8fr 0.95fr;
  gap: 12px;
  align-items: end;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.summary-ranking-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  text-align: right;
}

.summary-ranking-head span:first-child,
.summary-ranking-team {
  text-align: left;
}

.summary-ranking-team,
.summary-ranking-points,
.summary-ranking-percent {
  font-size: 0.92rem;
  line-height: 1.15;
  font-weight: 700;
}

.summary-ranking-team {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-ranking-points {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary-ranking-percent {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.92rem;
  line-height: 1.15;
  font-weight: 700;
}

.summary-ranking-empty {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.kpi-range {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

#fixtures,
#reports {
  scroll-margin-top: 72px;
}

.filters {
  align-self: start;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
}

.filters-title {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.15rem;
}

.filter-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.filter-block label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-block input,
.filter-block select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
  min-width: 0;
}

.filter-chip {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f5f8;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--court);
  border-color: var(--court);
  color: var(--white);
}

.derby-filter-button {
  position: relative;
}

.derby-filter-button::after {
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 7px);
  left: 0;
  width: min(280px, 80vw);
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(3px);
  visibility: hidden;
}

.derby-filter-button:hover::after,
.derby-filter-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.data-area,
.report-panel {
  min-width: 0;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.section-head.compact {
  align-items: center;
}

.section-head .eyebrow {
  color: var(--court);
}

.fixtures-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fixture-toggle {
  padding: 5px 9px;
  border: 1px solid #287347;
  border-radius: 6px;
  background: #35834f;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.fixture-toggle:hover,
.fixture-toggle:focus-visible {
  border-color: var(--court);
  outline: none;
}

#visibleCount {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 0.94rem;
}

.empty-state,
.empty-copy {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--court-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.changed,
.badge.removed {
  background: #fee8de;
  color: #97431f;
}

.badge.new {
  background: #e2f0ff;
  color: #124f86;
}

.badge.not-booked {
  background: #fff0d6;
  color: #79551d;
}

.badge.played {
  background: #dff2df;
  color: #1f6b2a;
}

.report-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 16px;
}

.report-grid.single-report {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
}

.change-list,
.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.change-item,
.summary-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.change-item strong,
.summary-item strong {
  display: block;
  margin-bottom: 6px;
}

.summary-item-wide {
  grid-column: 1 / -1;
}

.team-progress-chart {
  padding: 18px;
}

.team-progress-head,
.team-progress-legend,
.team-progress-row {
  display: flex;
  align-items: center;
}

.team-progress-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.team-progress-head strong {
  margin: 0;
}

.team-progress-legend {
  gap: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.legend-swatch.played,
.team-progress-bar.played {
  background: var(--court);
}

.legend-swatch.remaining,
.team-progress-bar.remaining {
  background: #b9c5d2;
}

.team-progress-rows {
  display: grid;
  gap: 8px;
}

.team-progress-row {
  display: grid;
  grid-template-columns: minmax(110px, 170px) minmax(160px, 1fr) 28px;
  gap: 10px;
  min-height: 24px;
}

.team-progress-name {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-progress-track {
  display: flex;
  height: 22px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1f4;
}

.team-progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.team-progress-total {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.summary-item-wide .results-table-wrap {
  width: 100%;
  margin: 0;
}

.change-item p,
.summary-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-item .fixtures-rescheduled {
  margin-top: 4.5em;
  font-weight: 700;
}

.results-table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  vertical-align: top;
}

.next-fixtures {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.next-fixtures li {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.next-fixtures li:first-child {
  border-top: 0;
  padding-top: 0;
}

.next-fixtures span {
  font-weight: 700;
}

.next-fixtures em {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: normal;
}

.monthly-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px 72px;
  gap: 16px;
  align-items: end;
  margin-bottom: 6px;
  font-family: inherit;
}

.monthly-summary-head strong,
.monthly-summary-head span {
  margin: 0;
  font-family: inherit;
}

.monthly-summary-head strong {
  display: block;
}

.monthly-summary-head span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.monthly-planned {
  display: grid;
  gap: 0;
}

.monthly-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px 72px;
  gap: 16px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.monthly-month {
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.monthly-original-count,
.monthly-planned-count,
.monthly-played-count {
  color: var(--text);
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.team-month-summary > strong {
  display: block;
  margin-bottom: 10px;
}

.team-month-table-wrap {
  overflow-x: auto;
}

.team-month-table {
  width: 59%;
  min-width: 0;
  margin: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.team-month-table th,
.team-month-table td {
  padding: 4px 3px;
  border-top: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.team-month-table th:first-child,
.team-month-table td:first-child {
  width: 18%;
}

.team-month-table td.count-two {
  background: #fff4bf;
}

.team-month-table td.count-three {
  background: #f8d2d2;
}

.team-month-table th:first-child {
  text-align: center;
}

.team-month-table thead th,
.team-month-table tbody tr:last-child th,
.team-month-table tbody tr:last-child td {
  color: var(--text);
  font-weight: 800;
}

.winter-report {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  padding: 14px;
}

.winter-report > .summary-item {
  min-width: 0;
  padding: 10px;
}

.winter-report .monthly-summary-head,
.winter-report .monthly-row {
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)) minmax(0, 0.65fr);
  gap: 6px;
}

.winter-report .monthly-summary-head span {
  font-size: 0.8rem;
}

.winter-report .monthly-row {
  padding: 7px 0;
  font-size: 0.88rem;
}

.winter-report .team-month-table {
  width: 100%;
  font-size: 0.82rem;
}

.winter-report .next-fixtures {
  gap: 6px;
  font-size: 0.88rem;
}

.winter-report .next-fixtures li {
  padding: 7px 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(20px, 4vw, 46px) 38px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .toolbar,
  .workspace,
  .report-grid {
    grid-template-columns: 1fr;
  }

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

  .net-points-card {
    grid-column: 1 / -1;
  }

  .summary-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  #seasonTitle {
    white-space: normal;
  }

  .app-header,
  .status-line,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
  }

  main {
    padding: 14px;
  }

  .toolbar {
    min-height: 150px;
    padding: 18px;
  }

  h1 {
    font-size: 1.2rem;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .net-points-card {
    grid-column: auto;
  }

  .team-progress-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .team-progress-row {
    grid-template-columns: 92px minmax(120px, 1fr) 24px;
    gap: 7px;
  }

  .team-month-table {
    width: 100%;
  }

  .team-month-table th,
  .team-month-table td {
    padding: 4px 2px;
    font-size: 0.78rem;
  }
}

@media print {
  .app-header,
  .toolbar,
  .filters,
  footer,
  .button {
    display: none;
  }

  main {
    padding: 0;
  }

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

  .data-area,
  .report-panel,
  .overview-card {
    box-shadow: none;
  }
}
