:root {
  color-scheme: light dark;
  --paper: #f4f3ed;
  --surface: #fbfaf6;
  --surface-hover: #fffefa;
  --ink: #171a17;
  --muted: #6e746f;
  --line: #d8d8d0;
  --soft-line: #e8e7e0;
  --subtle: #e8e7df;
  --neutral: #e8e8e0;
  --outside: #f0efe9;
  --outside-ink: #9da19d;
  --today-surface: #f1f1ea;
  --heading-ink: #555b56;
  --faint: #969b96;
  --quiet: #626862;
  --separator-ink: #aaada8;
  --accent: #c8ee66;
  --error: #b73b2c;
  --error-soft: #f6ddd8;
  --ready-bg: #e4efc9;
  --ready-ink: #46610f;
  --ready-dot: #6e9718;
  --warning-bg: #f3e9c7;
  --warning-ink: #745c16;
  --warning-dot: #a58119;
  --status-dot-ring: #769b21;
  --warning-dot-ring: #9a7416;
  --error-dot: #ef8c7e;
  --on-ink-muted: #bdc3bd;
  --heading-count: #8d928d;
  --live-ink: #263604;
  --dialog-shadow: rgb(23 26 23 / 22%);
  --popover-shadow: rgb(22 26 22 / 12%);
  --backdrop: rgb(23 26 23 / 38%);
  --checkbox-bg: #dfe3dc;
  --checkbox-border: #717870;
  --checkbox-ink: #2f3530;
  --event-fallback-bg: #e5e6de;
  --event-fallback-border: #aeb2aa;
  --event-fallback-ink: #454a45;
  --event-bg-weight: 100%;
  --event-border-weight: 100%;
  --event-ink-weight: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141713;
    --surface: #1b1f1a;
    --surface-hover: #222720;
    --ink: #eef2eb;
    --muted: #a6aea4;
    --line: #3d443c;
    --soft-line: #2c322b;
    --subtle: #242a23;
    --neutral: #292f28;
    --outside: #171a16;
    --outside-ink: #727a71;
    --today-surface: #20261f;
    --heading-ink: #c7cec4;
    --faint: #858d83;
    --quiet: #b4bcb2;
    --separator-ink: #747c73;
    --accent: #b9df59;
    --error: #ff9b8c;
    --error-soft: #402522;
    --ready-bg: #2b3b21;
    --ready-ink: #c9ec84;
    --ready-dot: #a6d34a;
    --warning-bg: #473b1d;
    --warning-ink: #f1d783;
    --warning-dot: #d9af32;
    --status-dot-ring: #8ab72d;
    --warning-dot-ring: #d1a62c;
    --error-dot: #ff8b7a;
    --on-ink-muted: #535d52;
    --heading-count: #8d958c;
    --live-ink: #263604;
    --dialog-shadow: rgb(0 0 0 / 58%);
    --popover-shadow: rgb(0 0 0 / 42%);
    --backdrop: rgb(0 0 0 / 68%);
    --checkbox-bg: #414940;
    --checkbox-border: #8f998e;
    --checkbox-ink: #f0f3ec;
    --event-fallback-bg: #343a32;
    --event-fallback-border: #6f796e;
    --event-fallback-ink: #eef2eb;
    --event-bg-weight: 32%;
    --event-border-weight: 72%;
    --event-ink-weight: 20%;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 0;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.shell { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }
.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px);
}
.header-inner {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-identity { min-width: 0; display: flex; align-items: center; gap: 18px; }
.header-identity h1 {
  margin: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  font-size: 14px;
  line-height: 1;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -.02em;
}
.brand-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  right: -6px;
  bottom: -2px;
  background: var(--ink);
  transform: rotate(48deg);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.source-badge {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .05em;
  background: transparent;
  cursor: pointer;
}
.source-badge:hover { border-color: var(--ink); color: var(--ink); }
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--status-dot-ring); }
.source-badge.warning .source-dot { background: var(--warning-dot); box-shadow: 0 0 0 1px var(--warning-dot-ring); }
.source-badge.error .source-dot { background: var(--error-dot); box-shadow: 0 0 0 1px var(--error); }
.search-button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}
.search-button:hover { border-color: var(--ink); }
.search-button kbd {
  min-width: 17px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.refresh-button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}
.refresh-button:hover:not(:disabled) { background: transparent; color: var(--ink); }
.refresh-button:disabled { opacity: .5; cursor: wait; }

.source-health-dialog {
  width: min(840px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 22px 70px var(--dialog-shadow);
}
.source-health-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.health-dialog-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.health-dialog-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.dialog-close {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}
.source-health-content { padding: 16px 20px 22px; }
.health-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.health-summary strong { color: var(--ink); }
.health-source-list { display: grid; border-top: 1px solid var(--line); }
.health-source {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--soft-line);
}
.health-source-name { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 760; }
.health-status-dot { flex: none; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--status-dot-ring); }
.health-source.warning .health-status-dot { background: var(--warning-dot); box-shadow: 0 0 0 1px var(--warning-dot-ring); }
.health-source.error .health-status-dot, .health-source.missing .health-status-dot { background: var(--error-dot); box-shadow: 0 0 0 1px var(--error); }
.health-coverage strong { display: block; margin-bottom: 4px; font-size: 12px; }
.health-coverage p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.health-runs { display: grid; justify-items: end; gap: 4px; color: var(--muted); font: 650 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.health-runs .warning { color: var(--warning-ink); }
.health-runs .stale, .health-runs .error { color: var(--error); }
.health-error { padding: 28px 0; color: var(--error); text-align: center; }

.search-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(800px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 22px 70px var(--dialog-shadow);
}
.search-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.search-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.search-dialog-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.search-form {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.search-query input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--surface-hover);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.search-query input:focus { box-shadow: 0 0 0 2px var(--accent); }
.search-form > button {
  min-width: 82px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  font-weight: 740;
  cursor: pointer;
}
.search-form > button:hover { background: transparent; color: var(--ink); }
.search-form > p {
  grid-column: 1 / -1;
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 10px;
}
.search-filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.search-filters label { display: grid; gap: 5px; }
.search-filters label > span {
  color: var(--muted);
  font: 750 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.search-filters input, .search-filters select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
}
.search-results {
  min-height: 210px;
  max-height: min(510px, calc(100vh - 300px));
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
  overflow: auto;
}
.search-prompt {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.search-prompt strong { color: var(--ink); font-size: 14px; }
.search-prompt.error strong { color: var(--error); }
.search-results-summary {
  padding: 13px 0;
  color: var(--muted);
  font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}
.search-group { padding-bottom: 14px; }
.search-group h3 {
  margin: 0;
  padding: 10px 0 7px;
  color: var(--muted);
  font: 800 9px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.search-group h3 span { color: var(--faint); }
.search-result-list { display: grid; gap: 6px; }
.search-result {
  width: 100%;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.search-result:hover, .search-result:focus-visible { border-color: var(--ink); background: var(--surface-hover); outline: none; }
.search-result-main { min-width: 0; display: grid; gap: 4px; }
.search-result-main > span {
  color: var(--muted);
  font: 750 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}
.search-result-main strong { overflow-wrap: anywhere; font-size: 13px; line-height: 1.3; }
.search-result-main small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.search-result-action { color: var(--muted); font: 750 9px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.search-result-limit { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.search-focus { outline: 2px solid var(--ink); outline-offset: -3px; }

.feed-note {
  max-width: 330px;
  width: fit-content;
  margin-left: auto;
  padding: 6px 9px;
  border-radius: 3px;
  background: var(--neutral);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 650 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-note > span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.feed-note.ready { background: var(--ready-bg); color: var(--ready-ink); }
.feed-note.ready > span { background: var(--ready-dot); }
.feed-note.warning { background: var(--warning-bg); color: var(--warning-ink); }
.feed-note.warning > span { background: var(--warning-dot); }
.feed-note.error { background: var(--error-soft); color: var(--error); }
.feed-note.error > span { background: var(--error); }
.feed-note.loading > span { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.match-board {
  height: calc(100dvh - 54px);
  min-height: 0;
  padding: 12px 0 18px;
  display: flex;
  flex-direction: column;
}
.board-controls {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}
.calendar-export-actions {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.calendar-export-actions span {
  margin-right: 4px;
  color: var(--muted);
  font: 650 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.calendar-export-actions a {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  font-weight: 720;
  text-decoration: none;
}
.calendar-export-actions a:hover { border-color: var(--ink); }
.calendar-export-actions a.disabled { opacity: .4; pointer-events: none; }
.timezone-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timezone-control > span {
  color: var(--muted);
  font: 650 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.timezone-control select {
  width: 210px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}
.timezone-control select:hover, .timezone-control select:focus { border-color: var(--ink); }
.view-tabs { display: flex; align-items: center; gap: 5px; }
.view-tabs button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.view-tabs button span { margin-left: 5px; color: var(--faint); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.view-tabs button:hover { border-color: var(--line); color: var(--ink); }
.view-tabs button.active { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.view-tabs button.active span { color: var(--on-ink-muted); }
.calendar-mode-toggle { display: flex; align-items: center; }
.calendar-mode-toggle button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}
.calendar-mode-toggle button:first-child { border-radius: 4px 0 0 4px; }
.calendar-mode-toggle button + button { margin-left: -1px; }
.calendar-mode-toggle button:last-child { border-radius: 0 4px 4px 0; }
.calendar-mode-toggle button.active { position: relative; border-color: var(--ink); background: var(--ink); color: var(--surface); }
.list-heading {
  min-height: 54px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.list-heading strong { font-size: 22px; letter-spacing: -.035em; }
.list-heading span { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.heading-title { display: flex; align-items: center; gap: 9px; }
.period-button, .today-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}
.today-button { width: auto; padding: 0 10px; font-size: 9px; text-transform: uppercase; }
.period-button:hover:not(:disabled), .today-button:hover:not(:disabled) { border-color: var(--ink); }
.period-button:disabled, .today-button:disabled { opacity: .4; cursor: wait; }
.calendar-legend {
  width: 100%;
  min-inline-size: 0;
  margin: 0;
  min-height: 40px;
  padding: 6px 0;
  border: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  position: relative;
  z-index: 8;
}
.filter-presets, .facet-filters, .filter-branches {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-presets > span, .facet-filters > span {
  margin-right: 2px;
  color: var(--quiet);
  font: 800 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.filter-presets button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font: 750 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  cursor: pointer;
}
.filter-presets button:hover, .filter-presets button.active {
  border-color: var(--ink);
  color: var(--ink);
}
.filter-presets button.active { background: var(--subtle); }
.facet-filters {
  min-height: 26px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.facet-filters label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font: 750 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  cursor: pointer;
}
.filter-branch {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  display: inline-flex;
  align-items: stretch;
  position: relative;
}
.filter-parent, .filter-children label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  cursor: pointer;
}
.filter-parent { padding: 0 8px; color: var(--ink); font-weight: 800; }
.filter-branch details { border-left: 1px solid var(--line); }
.filter-branch summary {
  min-width: 54px;
  height: 100%;
  padding: 0 7px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: var(--muted);
  font: 700 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}
.filter-branch summary::-webkit-details-marker { display: none; }
.filter-branch details[open] summary { background: var(--subtle); color: var(--ink); }
.filter-branch details[open] summary span:last-child { transform: rotate(180deg); }
.filter-children {
  width: max-content;
  min-width: 230px;
  max-width: min(340px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 0 10px 24px var(--popover-shadow);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 20;
}
.filter-branch:last-child .filter-children { right: 0; left: auto; }
.filter-children > strong {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font: 800 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.filter-parent input, .filter-children input, .facet-filters input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid var(--event-border);
  border-radius: 2px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.filter-parent input, .facet-filters input { --event-bg: var(--checkbox-bg); --event-border: var(--checkbox-border); --event-ink: var(--checkbox-ink); }
.filter-parent input:checked, .filter-children input:checked, .facet-filters input:checked, .filter-parent input:indeterminate {
  background: var(--event-bg);
}
.filter-parent input:checked::after, .filter-children input:checked::after, .facet-filters input:checked::after {
  width: 6px;
  height: 3px;
  border-left: 2px solid var(--event-ink);
  border-bottom: 2px solid var(--event-ink);
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}
.filter-parent input:indeterminate::after {
  width: 6px;
  height: 2px;
  background: var(--event-ink);
  content: "";
}
.filter-children input:not(:checked) + span { opacity: .5; }
.filter-parent:hover span, .filter-children label:hover span { color: var(--ink); opacity: 1; }

.category-wtt-major { --event-bg: #f2c8c1; --event-border: #a54a3b; --event-ink: #59251c; }
.category-wtt-champions { --event-bg: #f0d3a7; --event-border: #a36c1e; --event-ink: #583708; }
.category-wtt-star { --event-bg: #dccceb; --event-border: #7b579d; --event-ink: #42275c; }
.category-wtt-contender { --event-bg: #cbddef; --event-border: #4777a4; --event-ink: #244867; }
.category-wtt-feeder { --event-bg: #c8e2da; --event-border: #41816f; --event-ink: #214b40; }
.category-global-olympics { --event-bg: #f1c7c0; --event-border: #9f493c; --event-ink: #59261f; }
.category-global-world-championships { --event-bg: #c9d3df; --event-border: #3e5f7d; --event-ink: #203b53; }
.category-global-world-cup { --event-bg: #f0d3a7; --event-border: #a36c1e; --event-ink: #583708; }
.category-continental-asia { --event-bg: #ead2c7; --event-border: #95614d; --event-ink: #543428; }
.category-continental-europe { --event-bg: #cadcf0; --event-border: #4b74a0; --event-ink: #294968; }
.category-continental-americas { --event-bg: #d0dfd2; --event-border: #54765a; --event-ink: #2c4a31; }
.category-continental-africa { --event-bg: #eadcae; --event-border: #917830; --event-ink: #504214; }
.category-continental-oceania { --event-bg: #cce1e7; --event-border: #4f7c88; --event-ink: #294b54; }
.category-national-germany { --event-bg: #ead5cd; --event-border: #986454; --event-ink: #56352b; }
.category-national-china { --event-bg: #efd0cb; --event-border: #a94c43; --event-ink: #5e2721; }
.category-national-japan { --event-bg: #d7d5ea; --event-border: #69639a; --event-ink: #38345d; }
.category-national-france { --event-bg: #e8d3df; --event-border: #965c79; --event-ink: #573147; }
.category-national-usa { --event-bg: #d2e2e7; --event-border: #4f7985; --event-ink: #294a53; }

.match-list { border-top: 1px solid var(--ink); }
.date-group { border-bottom: 1px solid var(--ink); }
.date-heading {
  min-height: 46px;
  margin: 0;
  padding: 0 14px;
  background: var(--subtle);
  display: flex;
  align-items: center;
  color: var(--heading-ink);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.match-row {
  min-height: 140px;
  padding: 22px 14px;
  border-top: 1px solid var(--soft-line);
  background: var(--surface);
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 170px;
  gap: 22px;
}
.date-heading + .match-row { border-top: 0; }
.match-row:hover { background: var(--surface-hover); }
.match-time strong, .match-time span { display: block; }
.match-time strong { font: 760 15px ui-monospace, SFMono-Regular, Menlo, monospace; }
.match-time span { margin-top: 5px; color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.match-context {
  margin-bottom: 15px;
  color: var(--muted);
  font: 650 9px ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.45;
  text-transform: uppercase;
}
.match-context span { margin: 0 6px; color: var(--separator-ink); }
.match-source { color: var(--ink); font-weight: 850; }
.competitors { display: grid; gap: 9px; }
.competitor { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 12px; }
.competitor strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.2; }
.competitor.winner strong { font-weight: 800; }
.score { text-align: right; font: 800 17px ui-monospace, SFMono-Regular, Menlo, monospace; }
.match-side { min-width: 0; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 18px; text-align: right; }
.status-label {
  padding: 5px 7px;
  border-radius: 3px;
  background: var(--neutral);
  color: var(--muted);
  font: 750 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.status-label.live { background: var(--accent); color: var(--live-ink); }
.status-label.finished { background: var(--ink); color: var(--surface); }
.status-label.postponed, .status-label.cancelled { background: var(--error-soft); color: var(--error); }
.match-meta { color: var(--muted); font-size: 10px; line-height: 1.45; }
.official-link { color: var(--ink); font-size: 10px; font-weight: 720; }
.official-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.calendar-list {
  min-height: 0;
  border-top: 1px solid var(--ink);
  background: var(--surface);
  flex: 1;
}
.calendar-scroll { width: 100%; height: 100%; overflow: auto; }
.month-calendar .calendar-scroll, .week-calendar .calendar-scroll {
  max-height: none;
}
.month-grid {
  min-width: 1050px;
  min-height: max(540px, calc(100vh - 210px));
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 36px;
  grid-auto-rows: minmax(52px, auto);
  border-left: 1px solid var(--line);
}
.weekday-heading {
  height: 36px;
  padding: 0 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--ink);
  background: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 4;
}
.month-week {
  grid-column: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 32px repeat(var(--event-rows), minmax(46px, auto)) minmax(8px, 1fr);
  position: relative;
}
.month-week.no-events { grid-template-rows: 32px minmax(20px, 1fr); }
.month-day {
  min-width: 0;
  padding: 7px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  grid-row: 1 / -1;
}
.month-day.outside-month { background: var(--outside); color: var(--outside-ink); }
.month-day.today { position: relative; box-shadow: inset 0 0 0 2px var(--ink); }
.day-number { min-height: 28px; position: relative; z-index: 1; display: flex; align-items: baseline; justify-content: space-between; }
.day-number span { display: none; color: var(--muted); font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.day-number strong { font: 760 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.month-day.today .day-number strong {
  min-width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  display: grid;
  place-items: center;
}
.month-event {
  min-height: 40px;
  min-width: 0;
  margin: 3px 4px;
  padding: 5px 8px;
  border: 1px solid var(--event-border, var(--event-fallback-border));
  border-color: color-mix(in srgb, var(--event-border, var(--event-fallback-border)) var(--event-border-weight), var(--ink));
  border-left-width: 3px;
  border-radius: 3px;
  background: var(--event-bg, var(--event-fallback-bg));
  background: color-mix(in srgb, var(--event-bg, var(--event-fallback-bg)) var(--event-bg-weight), var(--surface));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  color: var(--event-ink, var(--event-fallback-ink));
  color: color-mix(in srgb, var(--event-ink, var(--event-fallback-ink)) var(--event-ink-weight), var(--ink));
  position: relative;
  z-index: 2;
}
.month-event strong {
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: normal;
}
.month-event > span {
  width: 100%;
  color: inherit;
  font: 700 8px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  white-space: normal;
  opacity: .72;
}
.month-event:hover { filter: brightness(.96); }
.month-event.ongoing, .week-event.ongoing { box-shadow: inset 0 0 0 1px var(--ink); }
.month-event.continues-before, .week-event.continues-before { margin-left: 0; border-left-width: 1px; border-radius: 0 3px 3px 0; }
.month-event.continues-after, .week-event.continues-after { margin-right: 0; border-radius: 3px 0 0 3px; }
.month-event.continues-before.continues-after, .week-event.continues-before.continues-after { border-radius: 0; }

.week-grid {
  min-width: 1050px;
  min-height: max(480px, calc(100vh - 210px));
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 68px repeat(var(--event-rows), minmax(58px, auto)) minmax(100px, 1fr);
  border-left: 1px solid var(--line);
}
.week-day-header {
  padding: 10px;
  border-bottom: 1px solid var(--ink);
  border-right: 1px solid var(--line);
  background: var(--subtle);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 4;
}
.week-day-header span { color: var(--muted); font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.week-day-header strong { font: 780 24px ui-monospace, SFMono-Regular, Menlo, monospace; }
.week-day-header.today { background: var(--ink); color: var(--surface); }
.week-day-header.today span { color: var(--on-ink-muted); }
.week-day {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  grid-row: 2 / -1;
}
.week-day.today { background: var(--today-surface); box-shadow: inset 0 0 0 2px var(--ink); }
.week-event {
  min-height: 50px;
  min-width: 0;
  margin: 4px;
  padding: 6px 10px;
  border: 1px solid var(--event-border, var(--event-fallback-border));
  border-color: color-mix(in srgb, var(--event-border, var(--event-fallback-border)) var(--event-border-weight), var(--ink));
  border-left-width: 3px;
  border-radius: 3px;
  background: var(--event-bg, var(--event-fallback-bg));
  background: color-mix(in srgb, var(--event-bg, var(--event-fallback-bg)) var(--event-bg-weight), var(--surface));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  color: var(--event-ink, var(--ink));
  color: color-mix(in srgb, var(--event-ink, var(--event-fallback-ink)) var(--event-ink-weight), var(--ink));
  position: relative;
  z-index: 2;
}
.week-event:hover { filter: brightness(.96); }
.week-event strong { min-width: 0; font-size: 12px; line-height: 1.2; overflow-wrap: anywhere; white-space: normal; }
.week-event > span { width: 100%; color: inherit; font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.2; text-transform: uppercase; white-space: normal; opacity: .72; }

.day-calendar { overflow: auto; }
.day-view { background: var(--surface); }
.day-section { border-bottom: 1px solid var(--ink); }
.day-section-heading {
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--heading-ink);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.day-section-heading span { color: var(--heading-count); }
.day-events {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.day-event {
  min-height: 82px;
  padding: 11px 12px;
  border: 1px solid var(--event-border, var(--event-fallback-border));
  border-color: color-mix(in srgb, var(--event-border, var(--event-fallback-border)) var(--event-border-weight), var(--ink));
  border-left-width: 4px;
  border-radius: 3px;
  background: var(--event-bg, var(--event-fallback-bg));
  background: color-mix(in srgb, var(--event-bg, var(--event-fallback-bg)) var(--event-bg-weight), var(--surface));
  display: grid;
  align-content: center;
  gap: 5px;
  color: var(--event-ink, var(--ink));
  color: color-mix(in srgb, var(--event-ink, var(--event-fallback-ink)) var(--event-ink-weight), var(--ink));
}
.day-event:hover { filter: brightness(.96); }
.day-event.ongoing { box-shadow: inset 0 0 0 1px var(--ink); }
.day-event > span { font: 700 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; opacity: .72; }
.day-event strong { font-size: 13px; line-height: 1.25; }
.day-event small { font-size: 9px; line-height: 1.3; opacity: .76; }
.day-empty {
  min-height: 92px;
  margin: 0;
  padding: 24px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.day-empty strong { color: var(--ink); font-size: 13px; }
.day-match-section .match-row:first-of-type { border-top: 0; }

.loading-state, .empty-state {
  min-height: 250px;
  padding: 40px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  color: var(--muted);
}
.loading-state > span { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-state p { margin: 12px 0 0; font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state h3 { margin: 0 0 7px; color: var(--ink); font-size: 17px; }
.empty-state p { margin: 0; font-size: 11px; }
.load-more {
  width: 100%;
  height: 50px;
  margin-top: 14px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.load-more:hover { background: var(--ink); color: var(--surface); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 10px;
}
.footer-inner p { margin: 0; }
.footer-inner p strong { color: var(--ink); font-weight: 700; }
.footer-inner a { color: var(--ink); font-weight: 700; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-inner > span { margin-left: auto; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 680px) {
  .shell {
    width: auto;
    margin-left: max(10px, env(safe-area-inset-left));
    margin-right: max(10px, env(safe-area-inset-right));
  }
  .site-header { padding-top: env(safe-area-inset-top); }
  .header-inner { height: 50px; gap: 8px; }
  .header-identity { gap: 0; }
  .header-identity h1, .source-badge { display: none; }
  .brand { gap: 8px; font-size: 14px; }
  .feed-note {
    width: 28px;
    height: 28px;
    margin-left: auto;
    padding: 0;
    justify-content: center;
    flex: none;
    font-size: 0;
  }
  .feed-note > span { width: 8px; height: 8px; }
  .header-actions { gap: 6px; }
  .refresh-button { width: 38px; height: 38px; padding: 0; font-size: 0; }
  .refresh-button::before { content: "↻"; font-size: 18px; line-height: 1; }
  .refresh-button:disabled::before { animation: spin .8s linear infinite; }
  .search-button { height: 38px; padding-inline: 11px; font-size: 11px; }
  .search-button kbd { display: none; }
  .match-board {
    height: calc(100dvh - 50px - env(safe-area-inset-top));
    padding: 8px 0 max(12px, env(safe-area-inset-bottom));
  }
  .board-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .calendar-export-actions { width: 100%; margin: 0; grid-column: 1 / -1; }
  .calendar-export-actions span { margin-right: auto; }
  .calendar-export-actions a { height: 42px; padding-inline: 12px; font-size: 11px; }
  .timezone-control { min-width: 0; width: 100%; }
  .timezone-control > span { display: none; }
  .timezone-control select { width: 100%; max-width: none; height: 42px; font-size: 11px; }
  .view-tabs { width: 100%; }
  .view-tabs button { flex: 1; }
  .calendar-mode-toggle { width: auto; }
  .calendar-mode-toggle button { height: 42px; padding-inline: 10px; font-size: 11px; }
  .list-heading { min-height: 50px; margin-top: 6px; }
  .list-heading > span { display: none; }
  .heading-title { width: 100%; gap: 6px; }
  .heading-title strong { min-width: 0; flex: 1; font-size: 19px; }
  .period-button, .today-button { min-height: 40px; height: 40px; }
  .period-button { width: 40px; }
  .today-button { padding-inline: 11px; }
  .calendar-legend {
    min-height: 0;
    padding: 8px 0 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }
  .filter-presets, .facet-filters { width: 100%; min-height: 34px; }
  .filter-presets button { min-height: 34px; padding-inline: 10px; font-size: 9px; }
  .facet-filters { padding-left: 0; border-left: 0; }
  .facet-filters label { min-height: 30px; font-size: 9px; }
  .filter-parent input, .filter-children input, .facet-filters input { width: 18px; height: 18px; }
  .filter-branches {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .filter-branch { min-width: 0; min-height: 40px; }
  .filter-parent { min-width: 0; padding-inline: 8px; flex: 1; }
  .filter-branch summary { min-width: 58px; padding-inline: 8px; }
  .filter-branch:nth-child(even) .filter-children { right: 0; left: auto; }
  .filter-children { max-height: min(320px, 45dvh); overflow-y: auto; }
  .filter-children label { min-height: 34px; font-size: 10px; }
  .filter-children label { flex: none; }
  .match-row { min-height: 0; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 16px 12px; }
  .match-side { grid-column: 2; align-items: flex-start; flex-direction: row; text-align: left; }
  .match-meta { max-width: 70%; }
  .competitor strong { overflow: visible; text-overflow: clip; white-space: normal; }
  .calendar-scroll {
    width: 100%;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .month-calendar .calendar-scroll, .week-calendar .calendar-scroll { max-height: none; }
  .month-grid, .week-grid { min-width: 700px; min-height: max(500px, calc(100dvh - 300px)); }
  .weekday-heading, .week-day-header { scroll-snap-align: start; }
  .day-number span { display: block; }
  .day-events { grid-template-columns: 1fr; }
  .day-section-heading { min-height: 46px; }
  .day-event { min-height: 92px; }
  .footer-inner { min-height: 120px; padding-bottom: max(18px, env(safe-area-inset-bottom)); flex-wrap: wrap; align-content: center; gap: 10px 22px; }
  .footer-inner > span { width: 100%; margin-left: 0; }
  .source-health-dialog, .search-dialog {
    width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .search-dialog-heading, .search-form { padding-inline: 14px; }
  .search-results { max-height: calc(100vh - 330px); padding-inline: 14px; }
  .search-filters { grid-template-columns: 1fr 1fr; }
  .search-filters label:last-child { grid-column: 1 / -1; }
  .search-result { grid-template-columns: 1fr; gap: 6px; }
  .health-source { grid-template-columns: 1fr; gap: 7px; }
  .health-runs { justify-items: start; }
}

@media (max-width: 420px) {
  .calendar-export-actions span { display: none; }
  .calendar-export-actions { justify-content: stretch; }
  .calendar-export-actions a { flex: 1; justify-content: center; }
  .facet-filters { justify-content: space-between; }
  .search-form { grid-template-columns: 1fr; }
  .search-form > button { min-height: 44px; }
  .search-form > p, .search-filters { grid-column: 1; }
  .search-filters { grid-template-columns: 1fr; }
  .search-filters label:last-child { grid-column: auto; }
  .search-results { max-height: calc(100dvh - 390px); }
}

@media (max-width: 350px) {
  .brand > span:last-child { display: none; }
  .brand-mark { margin-right: 5px; }
  .heading-title strong { font-size: 17px; }
  .calendar-mode-toggle button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
