/* Sankarit: blue-and-white scoreboard, adapted from the supplied concept. */
html[data-page="profile"] .page[data-page="profile"],
html[data-page="article"] .page[data-page="article"],
html[data-page="articles"] .page[data-page="articles"] { display: block; }
.content-page { max-width: 880px; margin-inline: auto; overflow-wrap: anywhere; }
.content-page h1 { line-height: 1.12; }
.content-page h2 { margin: 28px 0 12px; font-size: 21px; }
.content-page h3 { margin: 6px 0; font-size: 17px; }
.content-page p { line-height: 1.65; }
.content-page a { color: var(--accent); text-underline-offset: 3px; }
.content-page a:focus-visible, .athlete-profile-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.content-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0; }
.content-actions > a { display: inline-flex; align-items: center; min-height: 44px; }
.content-actions [data-follow] { min-width: 44px; min-height: 44px; }
.profile-meta { font-weight: 700; }
.content-notice { color: var(--muted); padding: 12px 16px; background: var(--soft); border-radius: 8px; }
.profile-events, .article-list { list-style: none; padding: 0; margin: 0; }
.profile-event, .article-list > li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.profile-event > div > span, .profile-event small, .profile-sources small { display: block; color: var(--muted); line-height: 1.5; }
.profile-result { margin: 12px 0; padding: 12px; background: var(--shade); border-radius: 8px; }
.profile-result > strong, .profile-result > span { display: block; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.profile-stats dt { color: var(--muted); font-size: 13px; }
.profile-stats dd { margin: 4px 0 0; font-weight: 750; }
.source-article { margin-top: 24px; }
.article-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.article-cards > .article-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.article-card h2 { margin: 8px 0 12px; font-size: 21px; }
.article-card p { margin: 10px 0; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 13px; }
.article-tabs { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.article-tabs [aria-current="page"] { font-weight: 800; text-decoration-thickness: 3px; }
.content-empty { padding: 24px 0; color: var(--muted); }
@media (max-width: 600px) { .article-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 740px) {
  .site-header .topnav { grid-template-columns: repeat(6, minmax(0, 1fr)); height: auto; min-height: 64px; overflow: visible; align-items: stretch; }
  .site-header .topnav a { min-width: 0; height: auto; min-height: 52px; font-size: 11px; line-height: 1.15; }
}
.profile-sources li { padding-block: 8px; scroll-margin-top: 100px; }
.athlete-profile-link { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
.athlete-open { text-decoration: none; }
@media (max-width: 600px) {
  .content-page { padding-inline: 16px; }
  .content-page h1 { font-size: 30px; }
  .content-page h2 { font-size: 19px; }
  .content-notice { padding: 10px; }
  .site-header .topnav { overflow-x: auto; min-width: 0; }
  .site-header .topnav a { flex-shrink: 0; }
}
:root {
  color-scheme: light;
  --bg: #f3f6f9;
  --surface: #fff;
  --ink: #172c40;
  --muted: #62758a;
  --accent: #205cb6;
  --accent-ink: #fff;
  --soft: #eaf1fb;
  --line: #dee6ee;
  --red: #d73747;
  --red-soft: #fff0f1;
  --green: #137b65;
  --green-soft: #ebf8f3;
  --shade: #f8fafc;
  --amber: #8a5a00;
  --amber-soft: #fff6df;
  --focus: #12458c;
  --logo: #245cb3;
  --deep: #15283d;
  --shadow: 0 9px 35px rgba(18,46,79,.04);
}

:root[data-theme="forest"] {
  --bg: #f8f7f2;
  --surface: #fffefb;
  --ink: #263b36;
  --muted: #697a74;
  --accent: #116b60;
  --accent-ink: #fff;
  --soft: #e9f3ee;
  --line: #e0e6dc;
  --red: #c43f3e;
  --red-soft: #f9eeeb;
  --green: #127a5c;
  --green-soft: #e6f4eb;
  --shade: #f7f8f4;
  --amber: #7d5500;
  --amber-soft: #fbf3dc;
  --focus: #136b60;
  --logo: #116b60;
  --deep: #243a33;
  --shadow: 0 10px 35px rgba(24,45,35,.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
}

svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.topbar {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 44px;
  padding: 0 32px;
  min-height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -.065em;
  text-decoration: none;
  white-space: nowrap;
}

.brand b {
  color: var(--accent);
}

.brand-mark {
  width: 38px;
  height: 38px;
  background: var(--logo);
  border-radius: 10px;
  display: inline-block;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark:before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  width: 6px;
  height: 100%;
  background: white;
}

.brand-mark:after {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  height: 6px;
  width: 100%;
  background: white;
}

.topnav {
  display: flex;
  height: 78px;
  gap: 29px;
  align-items: center;
  flex: 1;
}

.topnav a {
  height: 100%;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: none;
  font-size: 13px;
  font-weight: 680;
  padding: 3px 1px 0;
  white-space: nowrap;
}

.topnav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.topnav a:hover {
  color: var(--ink);
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--shade);
}

.swatch {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  border: 2px solid transparent;
  position: relative;
  padding: 0;
}

.swatch.blue {
  background: #205cb6;
}

.swatch.forest {
  background: #116b60;
}

.swatch.selected {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.app-shell {
  max-width: 1280px;
  margin: auto;
  padding: 35px 32px 100px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 780;
  letter-spacing: .045em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 7px;
}

.board-date {
  text-align: right;
  white-space: nowrap;
}

.board-date strong {
  display: block;
  font-size: 24px;
  letter-spacing: -.055em;
}

.board-date span {
  font-size: 12px;
  color: var(--muted);
}

.view-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  display: flex;
  gap: 3px;
}

.view-toggle button {
  border: 0;
  border-radius: 7px;
  padding: 11px 20px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 750;
  background: transparent;
  white-space: nowrap;
}

.view-toggle button[aria-pressed="true"] {
  background: var(--deep);
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,.08);
}

.date-strip {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}

.date-chip {
  min-width: 61px;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 8px;
  background: transparent;
  padding: 7px 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  font-size: 12px;
  font-weight: 720;
}

.date-chip span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.date-chip strong {
  font-size: 17px;
  color: var(--ink);
  font-weight: 820;
}

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

.date-chip.active {
  border-color: var(--accent);
  background: var(--soft);
}

.search-bar {
  position: relative;
}

.search-bar svg {
  position: absolute;
  left: 11px;
  top: 12px;
  color: var(--muted);
}

.search-bar input {
  border: 1px solid var(--line);
  padding: 11px 11px 11px 37px;
  border-radius: 9px;
  background: var(--shade);
  font-size: 13px;
  width: 100%;
  outline: 0;
}

.search-bar input:focus {
  background: var(--surface);
  border-color: var(--accent);
}

.sport-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sport-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: none;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 660;
  text-align: left;
}

.sport-button:hover {
  background: var(--shade);
  color: var(--ink);
}

.sport-button.active {
  background: var(--soft);
  color: var(--accent);
  font-weight: 790;
}

.sport-button small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.score-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 19px;
}

.score-filters button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 720;
  color: var(--muted);
  white-space: nowrap;
}

.score-filters button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 11px;
  padding: 0 2px;
}

.group-heading h3 {
  font-size: 13px;
  font-weight: 820;
  margin: 0;
  letter-spacing: -.005em;
}

.group-heading small {
  font-weight: 740;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 2px 7px;
  color: var(--muted);
}

.context {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

@media(max-width:1000px) {
  .topbar {
    gap: 27px;
  }

  .topnav {
    gap: 16px;
  }

}

@media(max-width:740px) {
  .topbar {
    min-height: 65px;
    padding: 0 16px;
    gap: 8px;
    justify-content: space-between;
  }

  .brand {
    font-size: 20px;
  }

  .brand-mark {
    height: 31px;
    width: 31px;
    border-radius: 8px;
  }

  .brand-mark:before {
    left: 10px;
    width: 5px;
  }

  .brand-mark:after {
    top: 12px;
    height: 5px;
  }

  .topnav {
    display: none;
  }

  .theme-picker {
    gap: 5px;
  }

  .app-shell {
    padding: 23px 16px 90px;
  }

  .board-date {
    display: none;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle button {
    flex: 1;
  }

  .date-strip {
    width: 100%;
    justify-content: space-between;
  }

  .date-chip {
    min-width: 44px;
    padding: 7px 5px;
  }

  .sport-list {
    display: none;
  }

  .search-bar {
    max-width: none;
  }

  .context {
    white-space: normal;
    font-size: 11px;
  }

  .score-filters {
    margin-bottom: 15px;
  }

  .score-filters button {
    padding: 7px 12px;
  }

}

:root {
  --paper: var(--bg);
  --white: var(--surface);
  --sans: system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  --mono: var(--sans);
  --live: var(--red);
  --finished: var(--green);
}

[hidden] {
  display: none!important;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.app-shell {
  padding: 0 32px;
  max-width: 1280px;
}

.topbar {
  padding: 0;
  position: relative;
}

.topbar:before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc((min(1280px,100vw) - 100vw)/2 - 32px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topnav a {
  display: flex;
  align-items: center;
  text-decoration: none;
  min-height: 78px;
}

.topnav a.active {
  border-color: var(--accent);
}

.swatch[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.section {
  padding: 35px 0;
  scroll-margin-top: 20px;
}

.board-date #todayLabel {
  display: block;
  font-size: 11px;
  white-space: normal;
  line-height: 1.6;
  color: var(--muted);
  max-width: 220px;
}

.date-chip {
  min-height: 52px;
}

.date-count {
  font-size: 9px;
  color: var(--muted);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--shade);
  min-height: 44px;
}

.search-bar input {
  position: static;
  border: 0;
  background: none;
  padding: 10px 0;
  width: 100%;
  min-width: 0;
  font-size: 12px;
  outline: none;
}

.search-icon {
  font-size: 24px;
  color: var(--muted);
}

.search-bar:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.board-options {
  margin-top: 18px;
}

#scoreSportFilter {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px;
}

#boardOptionsToggle {
  display: none;
  list-style: none;
  min-height: 44px;
  font-size: 12px;
  font-weight: 700;
}

#boardOptionsToggle::-webkit-details-marker {
  display: none;
}

#boardOptions[open] .options-caret {
  transform: rotate(180deg);
}

#resetScoreFilters {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  min-height: 44px;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.date-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 6px;
  scroll-margin-top: 16px;
}

.date-navigation input, .date-navigation button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--shade);
  font-size: 12px;
  padding: 8px;
}

.date-navigation input {
  width: 100%;
}

.date-navigation button {
  flex: 1;
}

.score-filters {
  padding: 3px 0;
  margin-bottom: 12px;
}

.score-filter {
  min-height: 36px;
}

.score-filter[data-score-filter="live"].active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.score-filter[data-score-filter="finished"].active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.score-result-count {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 16px;
}

.score-active-sport, .score-filter-notice {
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.score-filter-notice:empty {
  display: none;
}

#weekNotice:not(:empty) {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-summary {
  background: var(--soft);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 12px;
}

.search-summary strong, .search-summary a, .search-summary small {
  display: block;
  line-height: 1.7;
}

.search-summary small {
  font-size: 11px;
  color: var(--muted);
}

.search-summary button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  min-height: 44px;
  padding: 8px;
  margin-top: 8px;
  font-size: 11px;
}

.status-group, .day-group {
  margin-bottom: 24px;
}

.group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 0 0 11px;
}

.group-heading:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.status-group.live>.group-heading:before {
  background: var(--red);
}

.status-group.finished>.group-heading:before {
  background: var(--green);
}

.group-heading small {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 2px 7px;
  color: var(--muted);
}

.golf-notice:empty {
  display: none;
}

.follow {
  min-width: 36px;
  min-height: 44px;
  border: 0;
  background: none;
  font-size: 22px;
  color: #768ba1;
  padding: 5px;
  border-radius: 7px;
}

.follow.following {
  color: var(--accent);
}

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

.stats-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 0;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.stats-row>div {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.stats-row strong {
  color: var(--ink);
  font-size: 14px;
}

.updated {
  margin-left: auto;
  font-size: 10px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}

.updated[data-freshness="stale"] {
  color: var(--amber);
}

.updated[data-freshness="stale"] .status-dot {
  background: var(--amber);
  animation: none;
}

.updated[data-state="error"] {
  color: var(--red);
}

.updated[data-state="error"] .status-dot {
  background: var(--red);
}

.updated[data-state="loading"] .status-dot {
  background: var(--muted);
}

.empty-state {
  padding: 32px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 25px;
  letter-spacing: -.04em;
  margin: 7px 0;
}

#rosterStatus {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 5px 0;
}

.filter-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  font-size: 12px;
  max-width: 100%;
}

.athlete-list {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}

.athlete-row {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.athlete-open {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
}

.athlete-avatar {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex-shrink: 0;
  background: var(--soft);
  border-radius: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.athlete-info {
  min-width: 0;
}

.athlete-info strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.athlete-info span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

.register-state {
  font-size: 10px;
}

.report-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.report-card h2 {
  font-size: 22px;
  letter-spacing: -.04em;
}

.report-card {
  display: flex;
  gap: 18px;
  background: var(--soft);
}

.report-icon {
  font-size: 28px;
  color: var(--accent);
}

.report-card p {
  font-size: 13px;
  line-height: 1.6;
}

.dark-button {
  background: var(--deep);
  color: white;
  border: 0;
  border-radius: 7px;
  padding: 12px 15px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 700;
}

footer {
  display: flex;
  gap: 22px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 25px 0 40px;
  font-size: 11px;
  color: var(--muted);
}

.footer-right {
  margin-left: auto;
}

footer .brand {
  font-size: 16px;
}

footer .brand-mark {
  width: 31px;
  height: 31px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: calc(100% - 32px);
  background: var(--deep);
  color: white;
  border-radius: 8px;
  padding: 14px 17px;
  font-size: 12px;
  transform: translateY(200px);
  transition: transform .2s;
}

.toast.show {
  transform: translateY(0);
}

.profile-drawer {
  position: fixed;
  z-index: 30;
  right: 0;
  top: 0;
  height: 100dvh;
  width: min(420px,100%);
  overflow-y: auto;
  background: var(--surface);
  padding: 48px 24px 90px;
  box-shadow: -20px 0 60px #172c4025;
  transform: translateX(110%);
  transition: transform .2s;
}

.profile-drawer.open {
  transform: translateX(0);
}

.profile-drawer h2 {
  font-size: 28px;
  letter-spacing: -.04em;
}

.close-drawer, .close-dialog {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  font-size: 28px;
}

.drawer-copy {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.followed-list {
  margin-top: 18px;
}

.followed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.followed-item>div:nth-child(2) {
  flex: 1;
}

.followed-item strong {
  font-size: 13px;
}

.followed-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.drawer-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* One row per follow: who, then the next competition and the latest result below the name. */
.follow-card {
  align-items: flex-start;
}

.follow-main {
  min-width: 0;
}

.follow-facts {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.follow-fact {
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--shade);
}

.follow-fact.unsettled {
  background: var(--amber-soft);
}

.fact-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-title {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.follow-fact small, .follow-note, .follow-when {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.follow-note {
  margin-top: 8px;
}

.follow-fact .follow-note {
  margin-top: 0;
}

.follow-note.stale {
  color: var(--amber);
}

.follow-note.error {
  color: var(--red);
}

.follow-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
}

.follow-result b {
  font-size: 15px;
}

.follow-live {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
}

.follow-open {
  min-height: 36px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.follow-open:hover {
  text-decoration: underline;
}

.follow-open:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.drawer-sub {
  margin-top: 30px;
}

/* Tuloshistoria: register row action, then one dialog for the athlete or team. */
.athlete-row {
  flex-wrap: wrap;
}

.athlete-history {
  flex-basis: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.athlete-history:hover {
  text-decoration: underline;
}

.athlete-history:focus-visible, .history-more:focus-visible, .history-sport:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.history-dialog {
  width: min(640px,calc(100% - 24px));
  max-height: min(88vh,780px);
  padding: 26px 22px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.history-dialog h2 {
  margin: 4px 44px 0 0;
  overflow-wrap: anywhere;
}

.history-detail, .history-count {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.history-body .follow-note:first-of-type {
  margin-top: 12px;
}

.history-sports {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.history-sport {
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.history-sport.active {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent);
}

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

.history-row {
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--shade);
}

.history-row.unsettled {
  background: var(--amber-soft);
}

.history-row small {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.history-when {
  font-weight: 700;
}

.history-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
}

.history-result b {
  font-size: 15px;
}

.history-result.none {
  font-size: 12px;
  color: var(--muted);
}

.history-state.stale {
  color: var(--amber);
}

.history-more {
  min-height: 44px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media(max-width:740px) {
  .history-dialog {
    width: calc(100% - 16px);
    max-height: 92vh;
    padding: 22px 14px 16px;
  }

  .history-more {
    width: 100%;
  }
}

.empty-followed {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  width: min(480px,calc(100% - 32px));
  padding: 32px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 25px 80px #172c4045;
}

dialog::backdrop {
  background: #172c4080;
}

dialog h2 {
  font-size: 26px;
  letter-spacing: -.04em;
}

dialog p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

#reportForm {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  font-size: 12px;
  font-weight: 700;
}

label input, label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--shade);
  font-size: 12px;
}

.admin-section, .agent-section, .coverage-section {
  padding: 20px 0;
}

.admin-card, .agent-panel, .coverage-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 24px;
}

.candidate-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 90px 90px;
  gap: 10px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.candidate-row strong {
  font-size: 12px;
}

.candidate-row small, .admin-empty {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.candidate-row input, .candidate-row select {
  min-width: 0;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--shade);
  font-size: 11px;
}

.candidate-row button {
  min-height: 44px;
  border: 0;
  padding: 10px 8px;
  background: var(--accent);
  color: white;
  font-size: 11px;
}

.coverage-metrics, .agency-roles {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin: 20px 0;
}

.coverage-metric {
  border: 1px solid var(--line);
  padding: 14px;
}

.coverage-metric strong {
  display: block;
  font-size: 25px;
  color: var(--accent);
}

.coverage-metric span, .agency-role span {
  font-size: 11px;
  color: var(--muted);
}

.coverage-columns, .agent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.coverage-list-item, .agent-athlete {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.coverage-list-item small {
  display: block;
  margin-top: 4px;
}

.coverage-status {
  font-size: 11px;
  color: var(--green);
}

.coverage-status.gap {
  color: var(--red);
}

.agent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.agent-card p, .agent-status, .agent-card a {
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.agent-pill, .agency-role strong {
  font-size: 10px;
}

.agency-role span {
  display: block;
  margin-top: 6px;
}

@media(max-width:740px) {
  .app-shell {
    padding: 0 16px;
  }

  .topbar {
    min-height: 65px;
  }

  .topbar:before {
    inset: 0 -16px;
  }

  .topnav {
    position: fixed;
    z-index: 25;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 0;
  }

  .topnav a {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    border: 0;
    padding: 0;
    font-size: 10px;
    white-space: normal;
    text-align: center;
  }

  .topnav a:before {
    content: '☷';
    font-size: 22px;
    line-height: 1;
    font-weight: 400;
  }

  .topnav a[data-page-link="athletes"]:before {
    content: '♙';
  }

  .topnav a[data-page-link="calendar"]:before {
    content: '▦';
  }

  .topnav a[href="#seuranta"]:before {
    content: '☆';
  }

  .topnav a.active {
    color: var(--accent);
  }

  .section {
    padding: 24px 0;
  }

  .date-strip {
    padding: 3px 0;
    gap: 2px;
  }

  .date-chip {
    min-width: 40px;
    padding: 6px 5px;
  }

  .date-count {
    display: none;
  }

  .sport-list {
    display: none;
  }

  .board-options {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px;
    margin-top: 8px;
    align-items: start;
  }

  #boardOptions {
    min-width: 0;
  }

  #boardOptionsToggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--surface);
  }

  #boardOptionsPanel {
    margin-top: 10px;
  }

  #boardOptions:not([open])>#boardOptionsPanel {
    display: none;
  }

  #scoreSportFilter {
    margin-top: 6px;
  }

  #resetScoreFilters {
    padding: 8px;
    font-size: 10px;
  }

  .date-navigation {
    margin-top: 10px;
    padding-top: 0;
    border: 0;
    flex-wrap: nowrap;
  }

  .date-navigation input {
    width: auto;
    flex: 1;
  }

  .date-navigation button {
    flex: 0 0 auto;
    min-width: 38px;
  }

  .date-navigation button#todayDate {
    font-size: 11px;
  }

  .score-filters {
    gap: 6px;
  }

  .score-filter {
    padding: 8px 12px;
    font-size: 11px;
  }

  .score-result-count {
    font-size: 10px;
    margin-bottom: 14px;
  }

  .group-heading {
    font-size: 12px;
  }

  .stats-row {
    gap: 12px;
  }

  .updated {
    width: 100%;
    margin: 0;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

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

  .report-card {
    padding: 20px;
  }

  .report-card h2 {
    font-size: 24px;
  }

  footer {
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .footer-right {
    margin: 0;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: none;
  }

  .candidate-row {
    grid-template-columns: 1fr 1fr;
  }

  .candidate-row input {
    grid-column: 1/-1;
  }

  .coverage-metrics, .agency-roles {
    grid-template-columns: 1fr 1fr;
  }

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

  .admin-card, .agent-panel, .coverage-panel {
    padding: 16px;
  }

}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *:before, *:after {
    animation: none!important;
    transition: none!important;
  }

}

/* Match summaries share the same two-line limit on mobile and desktop. */
.league-flag { display: inline-block; width: 1.333em; height: 1em; vertical-align: -.125em; line-height: 1; }
.league-flag svg { display: block; width: 100%; height: 100%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
/* ===== Tulostaulu v2 =====
   Results first: no hero, one date row, one status row, then rows with time/state on the left,
   names in the middle and the result on the right. These rules come last on purpose and replace
   the older board rules above wherever both apply. Nothing below 11px. */
.scoreboard { --when-col: 76px; max-width: 1116px; padding: 12px 0 28px; }

.topbar { min-height: 56px; gap: 32px; }
.topnav, .topnav a { min-height: 56px; height: 56px; }
.theme-picker { margin-left: auto; padding: 0; border: 0; background: none; gap: 0; }
.swatch, .swatch.blue, .swatch.forest { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; outline: 0; }
.swatch:before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--swatch); opacity: .8; }
.swatch.blue { --swatch: #205cb6; }
.swatch.forest { --swatch: #116b60; }
.swatch[aria-pressed="true"] { outline: 0; }
.swatch[aria-pressed="true"]:before { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

.board-head { display: flex; align-items: baseline; gap: 12px; min-width: 0; padding: 4px 0 10px; }
.board-head h1 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 830; letter-spacing: -.03em; }
.board-date-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 720; letter-spacing: .04em; color: var(--muted); }
.view-toggle { flex: none; padding: 3px; border-radius: 10px; }
.view-toggle button { min-height: 44px; padding: 0 18px; border-radius: 7px; font-size: 13px; }
.date-strip { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; overflow: visible; padding: 0; }
.date-chip { min-width: 0; min-height: 52px; padding: 5px 2px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); gap: 0; line-height: 1.25; justify-content: center; }
.date-chip span { font-size: 11px; letter-spacing: .03em; }
.date-chip strong { font-size: 17px; line-height: 1.2; }
.date-chip .date-count { font-size: 11px; }
.date-chip.today span { color: var(--accent); }
.date-chip.in-week { background: var(--soft); }
.date-chip.empty { opacity: .6; }
.date-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: 1; }
.date-chip.active span, .date-chip.active strong, .date-chip.active .date-count { color: var(--accent-ink); }

.status-bar { margin-bottom: 14px; }
.score-filters { display: inline-flex; gap: 2px; width: auto; margin: 0; padding: 3px; overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.score-filters .score-filter { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 740; white-space: nowrap; }
.score-filters .score-filter:hover { background: var(--shade); color: var(--ink); }
.score-filters .score-filter.active { background: var(--ink); color: var(--surface); }
.score-filters .score-filter[data-score-filter="live"].active { background: var(--red); color: #fff; }
.score-filters .score-filter[data-score-filter="finished"].active { background: var(--green); color: #fff; }
.chip-count { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; font-weight: 800; text-align: center; }
.score-filter.active .chip-count { background: #fff; color: var(--red); }

.search-bar { min-height: 44px; }
.search-bar input { font-size: 14px; }
.board-options { display: block; margin: 0; }
.panel-label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sport-button { min-height: 40px; font-size: 13px; }
.sport-button small { font-size: 11px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.panel-actions button, #resetScoreFilters { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
#densityToggle { min-height: 44px; }
.date-navigation { margin-top: 0; padding-top: 0; border: 0; }
.date-navigation input, .date-navigation button { font-size: 13px; }
.filter-badge { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; line-height: 18px; text-align: center; }

.follow-control { flex: none; margin-left: auto; }
.follow-control .score-filter { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 2px 0 8px; border: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 740; }
.switch-track { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: #7d8fa3; transition: background .15s; }
.switch-track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); transition: transform .15s; }
.follow-control .score-filter.active .switch-track { background: var(--accent); }
.follow-control .score-filter.active .switch-track i { transform: translateX(18px); }
.score-result-count { margin: 0 0 8px; font-size: 12px; }
.score-result-count.sr-only { margin: -1px; }
.score-active-sport { margin: 0 0 8px; font-size: 12px; font-weight: 720; color: var(--accent); }

.board-note { margin: 0 0 10px; padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; line-height: 1.5; }
.board-note.warn { border-left-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.board-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 9px; background: var(--surface); color: var(--accent); font-size: 13px; font-weight: 740; text-decoration: none; }
.board-action.inline { min-height: 36px; padding: 0 10px; margin-left: 4px; vertical-align: middle; }
.empty-state { padding: 22px 16px; font-size: 14px; }
.empty-state p { margin: 0; }
.empty-state.error { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.skeleton i { display: block; height: 56px; margin-top: 10px; border-radius: 10px; background: linear-gradient(90deg, var(--shade), var(--line), var(--shade)); background-size: 200% 100%; animation: skeleton 1.2s linear infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }

.status-group, .day-group { margin-bottom: 16px; }
.group-heading { margin: 0 0 8px; font-size: 12px; font-weight: 820; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group-heading small { padding: 1px 7px; font-size: 11px; letter-spacing: 0; }
.status-group.live > .group-heading { color: var(--red); }
.status-group.pending > .group-heading:before { background: var(--amber); }
.group-note { margin: -2px 0 8px; font-size: 12px; line-height: 1.5; color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }
.stats-row { padding: 12px 0; }
.updated { font-size: 11px; }
@media(max-width:740px) {
  .scoreboard { --when-col: 68px; padding: 10px 0 20px; }
  .topbar { min-height: 52px; }
  .brand { font-size: 19px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 7px; }
  .brand-mark:before { left: 9px; width: 4px; }
  .brand-mark:after { top: 11px; height: 4px; }
  .swatch, .swatch.blue, .swatch.forest { width: 40px; height: 40px; }
  .swatch:before { inset: 13px; }

  /* The title stays for screen readers and as the focus target; the day is already in the strip and the heading. */
  .board-head { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .date-strip { gap: 3px; }
  .date-chip { min-height: 48px; padding: 4px 0; }
  .date-chip .date-count { display: none; }
  .date-chip strong { font-size: 16px; }

  .status-bar { margin-bottom: 8px; }
  .score-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .score-filters .score-filter { min-height: 40px; padding: 0 4px; font-size: 13px; }

  .search-bar { margin-right: 116px; }
  .search-bar input { font-size: 16px; }
  .board-options { display: block; margin: 0; }
  #boardOptionsToggle { position: absolute; top: 0; right: 0; width: 108px; height: 44px; padding: 0 10px; font-size: 13px; font-weight: 740; }
  .filter-badge:not([hidden]) { display: inline-block; }
  #boardOptionsPanel { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .date-navigation { margin-top: 0; flex-wrap: nowrap; }
  #scoreSportFilter { font-size: 14px; }
  .panel-actions button { flex: 1; }

  .follow-control .score-filter { padding-left: 4px; }

  .topnav a { font-size: 11px; }
  .status-group, .day-group { margin-bottom: 12px; }
}

/* ===== Sivut v3: Tulokset, Urheilijat, Kalenteri =====
   One document, three pages. The page is chosen by html[data-page] (set before the first paint and kept
   by app.js), so a direct visit never flashes the wrong page. These rules come last on purpose; they
   replace the single long front page of the earlier blocks. */
.page { display: none; width: 100%; max-width: 860px; margin: 0 auto; padding: 12px 0 28px; }
html[data-page="results"] .page[data-page="results"],
html[data-page="athletes"] .page[data-page="athletes"],
html[data-page="calendar"] .page[data-page="calendar"] { display: block; }
.page [hidden] { display: none; }

/* The menu shows the right page before app.js has run, then app.js takes over with .active. */
html[data-page="results"] .topnav:not(.ready) a[data-page-link="results"],
html[data-page="athletes"] .topnav:not(.ready) a[data-page-link="athletes"],
html[data-page="calendar"] .topnav:not(.ready) a[data-page-link="calendar"] { color: var(--ink); border-bottom-color: var(--accent); }
.topnav a:focus-visible, .brand:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 6px; }

.page-head { padding: 4px 0 6px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; font-weight: 830; letter-spacing: -.03em; }
.page-head h1:focus-visible, .board-head h1:focus-visible { outline: 0; }
.page-lede { max-width: 60ch; margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* --- Tulokset: one date row, search + "Rajaa tuloksia", one status row --- */
.scoreboard { max-width: 860px; padding-top: 12px; }
.today-link { flex: none; margin-left: auto; min-height: 36px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 99px; background: var(--surface); color: var(--accent); font-size: 13px; font-weight: 740; }
.today-link:hover { background: var(--soft); }
.date-nav { display: flex; align-items: stretch; gap: 6px; margin-bottom: 10px; }
.date-nav .date-strip { flex: 1 1 auto; min-width: 0; }
.date-step { flex: none; width: 40px; min-height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 24px; line-height: 1; }
.date-step:hover { background: var(--soft); }

.board-controls { position: relative; margin-bottom: 10px; }
.board-controls .search-bar { margin-right: 152px; min-height: 44px; background: var(--surface); }
.board-controls .search-bar input { font-size: 14px; }
.board-options { margin: 0; }
#boardOptionsToggle { position: absolute; top: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 8px; width: 144px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 740; list-style: none; cursor: pointer; }
#boardOptionsToggle:hover { background: var(--soft); }
#boardOptions[open] #boardOptionsToggle { border-color: var(--accent); color: var(--accent); }
#boardOptionsToggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.options-caret { font-size: 11px; transition: transform .15s; }
.filter-badge { display: inline-block; }
.filter-badge[hidden] { display: none; }

#boardOptionsPanel { display: grid; gap: 16px; margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.panel-row { display: grid; gap: 6px; min-width: 0; }
.date-navigation { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.date-navigation input { flex: 1 1 160px; width: auto; min-width: 0; min-height: 44px; }
.date-navigation button { flex: 1 1 auto; min-height: 44px; }
.date-navigation button:disabled { opacity: .5; }
.sport-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; max-height: 188px; overflow-y: auto; }
.sport-button { width: auto; min-height: 40px; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.sport-button.active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.sport-button.active small { color: var(--accent-ink); opacity: .85; }
.view-toggle { display: inline-flex; width: fit-content; }
.panel-actions { margin-top: 0; padding-top: 12px; border-top: 1px solid var(--line); }

.status-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: 0 0 12px; }
.status-bar .follow-control { margin-left: 0; }

.board-head .board-date-label { flex: 1 1 auto; }

/* --- Urheilijat --- */
.athlete-search { display: flex; align-items: stretch; gap: 8px; margin: 14px 0 6px; }
.athlete-search .search-bar { flex: 1 1 auto; margin-right: 0; min-height: 48px; background: var(--surface); }
.athlete-search .search-bar input { font-size: 16px; }
.sport-select { flex: 0 1 220px; min-width: 0; display: block; }
.sport-select select { width: 100%; min-height: 48px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 14px; }
.roster-status { margin: 0 0 4px; font-size: 12px; line-height: 1.5; color: var(--amber); }
.roster-status:empty { display: none; }
.athlete-count { margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
.athlete-count:empty { display: none; }
.athlete-list { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.athlete-list > .empty-state { border: 0; }
.athlete-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 4px; padding: 4px 6px 4px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.athlete-row:last-child { border-bottom: 0; }
.athlete-open { min-height: 52px; padding: 4px 0; border-radius: 8px; color: inherit; }
.athlete-open:focus-visible { outline-offset: 0; }
.athlete-open:hover .athlete-info strong { text-decoration: underline; text-underline-offset: 3px; }
.athlete-avatar { width: 36px; height: 36px; border-radius: 9px; }
.athlete-info strong { display: block; font-size: 15px; font-weight: 760; line-height: 1.3; }
.athlete-info span { margin-top: 1px; font-size: 12px; line-height: 1.35; }
.register-state { font-size: 11px; color: var(--amber); }
.athlete-row .follow { min-width: 44px; min-height: 44px; }
.athlete-row .athlete-history { flex-basis: auto; min-width: 44px; min-height: 44px; padding: 0 8px; font-size: 13px; white-space: nowrap; }
.athlete-more { display: flex; justify-content: center; margin: 14px 0 0; }
.athlete-more .board-action { min-width: 220px; }
.athlete-more [hidden] { display: none; }
.page-athletes .report-card { margin-top: 28px; padding: 20px; border-radius: 12px; }

/* --- Kalenteri: the week, day by day --- */
.week-nav { display: flex; gap: 8px; margin: 12px 0; }
.week-nav button { flex: 1 1 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 740; }
.week-nav button:hover:not(:disabled) { background: var(--soft); }
.week-nav button:disabled { color: var(--muted); background: var(--shade); }
.week-overview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.week-overview:empty { display: none; }
.week-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.week-day:hover { background: var(--soft); }
.week-day span { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.week-day strong { font-size: 20px; line-height: 1.2; font-weight: 820; }
.week-day b { font-size: 12px; font-weight: 740; color: var(--accent); font-variant-numeric: tabular-nums; }
.week-day.empty { background: var(--shade); }
.week-day.empty b { color: var(--muted); font-weight: 600; }
.week-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.week-day.today span { color: var(--accent); }
.week-live { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.4s ease-in-out infinite; }

.cal-day { margin-bottom: 18px; scroll-margin-top: 12px; }
.cal-day-head { margin: 0; font-size: 15px; }
.cal-day-head a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--soft); color: var(--ink); text-decoration: none; }
.cal-day.empty .cal-day-head a, .cal-day-head a:only-child { border-radius: 12px; }
.cal-day:not(.empty) .cal-day-head a { border-bottom-color: transparent; }
.cal-day-head a:hover .cal-day-go { text-decoration: underline; }
.cal-day-title { font-size: 15px; font-weight: 820; letter-spacing: -.02em; }
.cal-today { padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.cal-day-count { font-size: 12px; color: var(--muted); }
.cal-live { color: var(--red); }
.cal-day-go { margin-left: auto; font-size: 12px; font-weight: 740; color: var(--accent); }
.cal-day.today .cal-day-head a { border-color: var(--accent); }
.cal-events { margin: 0; padding: 0; list-style: none; overflow: hidden; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--surface); }
.cal-event { border-top: 1px solid var(--line); }
.cal-event:first-child { border-top: 0; }
.cal-event-open { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: start; gap: 12px; width: 100%; min-height: 56px; padding: 9px 12px 9px 14px; border: 0; background: none; color: inherit; text-align: left; }
.cal-event-open:hover { background: var(--shade); }
.cal-event-open:focus-visible { outline-offset: -3px; }
.cal-event.is-live { box-shadow: inset 3px 0 0 var(--red); }
.cal-event.is-pending { box-shadow: inset 3px 0 0 var(--amber); }
.cal-time { display: block; font-size: 15px; font-weight: 820; line-height: 22px; font-variant-numeric: tabular-nums; }
.cal-time.cal-open { font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--muted); }
.cal-time.cal-span { font-size: 12px; font-weight: 720; line-height: 1.5; }
.cal-main { display: block; min-width: 0; }
.cal-main strong { display: block; font-size: 15px; font-weight: 760; line-height: 22px; overflow-wrap: anywhere; }
.cal-main small { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); }
.cal-main .cal-finns { color: var(--ink); }
.cal-main .cal-note { color: var(--amber); }
.cal-star { color: var(--accent); }
.cal-states { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cal-state { padding: 2px 6px; border-radius: 4px; font-size: 11px; line-height: 1.3; font-weight: 800; white-space: nowrap; }
.cal-state.live { background: var(--red); color: #fff; }
.cal-state.pending { background: var(--amber-soft); color: var(--amber); }
.cal-state.finished { padding: 0; color: var(--green); }
.cal-none { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--surface); font-size: 13px; color: var(--muted); }
.cal-more { margin: 8px 0 0; width: 100%; }
.calendar-days > .empty-state { margin-bottom: 18px; }

@media(max-width:740px) {
  .page { padding-top: 8px; }

  /* Tulokset: the title is for screen readers; the day and the way back to today stay in one short row. */
  .board-head { position: static; display: flex; align-items: center; width: auto; height: auto; padding: 0 0 6px; overflow: visible; clip: auto; white-space: normal; }
  .board-head h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .board-head .board-date-label { font-size: 12px; }
  .today-link { min-height: 36px; padding: 0 12px; }
  .date-nav { gap: 4px; margin-bottom: 8px; }
  .date-step { width: 32px; min-height: 48px; font-size: 22px; }
  .date-nav .date-strip { gap: 3px; }
  .date-chip { min-height: 48px; padding: 4px 0; }
  .date-chip .date-count { display: none; }
  .board-controls { margin-bottom: 6px; }
  .board-controls .search-bar { margin-right: 140px; }
  .board-controls .search-bar input { font-size: 16px; }
  #boardOptionsToggle { width: 132px; gap: 6px; padding: 0 8px; font-size: 13px; white-space: nowrap; }
  #boardOptionsPanel { padding: 12px; }
  .status-bar { margin-bottom: 8px; }
  .score-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .score-filters .score-filter { padding: 0 4px; }
  .panel-actions button { flex: 1 1 auto; }

  /* Urheilijat */
  .page-head h1 { font-size: 20px; }
  .page-lede { font-size: 12px; }
  .athlete-search { flex-direction: column; gap: 6px; margin-top: 10px; }
  .sport-select { flex: none; }
  .athlete-row { padding-left: 10px; }
  .athlete-row .athlete-history { padding: 0 4px; font-size: 12px; }
  .athlete-more .board-action { width: 100%; }
  .page-athletes .report-card { flex-direction: column; gap: 8px; padding: 16px; }

  /* Kalenteri: a plain list that advances day by day; the overview strip would only repeat it. */
  .week-overview { display: none; }
  .week-nav { margin: 10px 0; }
  .cal-day { margin-bottom: 14px; }
  .cal-day-head a { padding: 9px 12px; }
  .cal-event-open { grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 9px 10px 9px 12px; }
  .cal-states { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .cal-state { margin-top: -1px; }
}

/* ===== Tulosrivit v3 =====
   Nothing opens: an event is one block with its time and state on the left and, on the right, the teams or
   the competition and then every Finnish entrant on a line of their own (name and class on the left, the
   result on the right, the follow star at the end). Source and reminder sit quietly under it. These rules
   replace every earlier rule for the rows, the series headings and the stars. */
.scoreboard { --when-col: 72px; }

.league-group { margin-bottom: 14px; }
.league-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 780; text-align: left; }
.league-head:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; border-radius: 8px; }
.league-icon { flex: none; font-size: 15px; line-height: 1; }
.league-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league-sport { flex: none; font-size: 12px; font-weight: 620; color: var(--muted); }
.league-live { flex: none; padding: 1px 6px; border-radius: 4px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; }
.league-caret { flex: none; margin-left: auto; font-size: 12px; color: var(--muted); transition: transform .15s; }
.league-group.collapsed .league-caret { transform: rotate(-90deg); }
.league-group.collapsed .event-rows { display: none; }
.status-group.live .league-live { display: none; }
.event-rows { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

.event-row { position: relative; display: grid; grid-template-columns: var(--when-col) minmax(0, 1fr); column-gap: 12px; padding: 10px 6px 8px 14px; border-top: 1px solid var(--line); background: var(--surface); transition: background-color .8s; }
.event-row:first-child { border-top: 0; }
.event-row.live { box-shadow: inset 3px 0 0 var(--red); background: linear-gradient(90deg, var(--red-soft), var(--surface) 40%); }
.event-row.is-pending { box-shadow: inset 3px 0 0 var(--amber); }
.event-row.flash { box-shadow: inset 3px 0 0 var(--accent); background: var(--soft); }
.row-when { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; font-size: 13px; }
.event-row.is-finished .row-when { color: var(--muted); }
.when-main { font-size: 15px; font-weight: 820; line-height: 22px; font-variant-numeric: tabular-nums; }
.when-main.when-date { font-size: 12px; font-weight: 720; line-height: 1.3; padding-top: 2px; }
.when-clock { font-size: 13px; font-weight: 820; line-height: 1.2; color: var(--red); font-variant-numeric: tabular-nums; }
.row-status { align-self: flex-start; padding: 2px 5px; border-radius: 4px; font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: .02em; white-space: nowrap; background: var(--shade); color: var(--muted); }
.row-status.live { background: var(--red); color: #fff; }
.row-status.live:before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #fff; vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
.row-status.upcoming { padding: 0; background: none; color: var(--muted); font-weight: 700; }
.row-status.finished { padding: 0; background: none; color: var(--green); }
.row-status.pending, .row-status.stale { background: var(--amber-soft); color: var(--amber); }
.row-status.finished.stale, .row-status.upcoming.stale { padding: 2px 5px; }
.row-status.long { margin-top: 4px; white-space: normal; text-align: left; }

.row-body { display: flex; flex-direction: column; min-width: 0; }
.row-context { margin: 0 0 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.match-title { display: block; font-size: 15px; font-weight: 760; line-height: 1.3; overflow-wrap: anywhere; }

/* Team lines and entrant lines share the columns: name, figure, star. */
.line, .person { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; align-items: center; column-gap: 8px; }
.line { min-height: 32px; }
.line-name { min-width: 0; }
.line-name strong { display: block; font-size: 15px; font-weight: 760; line-height: 22px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.line-score { min-width: 1.4em; font-size: 22px; font-weight: 850; line-height: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.line.team.trail strong { font-weight: 560; color: var(--muted); }
.line.team.trail .line-score { color: var(--muted); font-weight: 700; }
.event-row.live .line-score { color: var(--red); }
.event-row.is-pending .line-score { color: var(--amber); }
.line .follow-inline { font-size: 18px; }

.people { margin: 0; padding: 0; list-style: none; }
.line + .people { margin-top: 4px; padding-top: 2px; border-top: 1px dashed var(--line); }
.person { min-height: 40px; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.person:first-child { border-top: 0; }
.people.has-rank .person { grid-template-columns: 26px minmax(0, 1fr) auto 40px; }
.p-rank { font-size: 12px; font-weight: 800; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.p-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; padding: 4px 0; }
.p-name strong { font-size: 15px; font-weight: 740; line-height: 22px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.person.none .p-name strong { font-weight: 660; }
.p-cat { font-size: 12px; line-height: 1.4; color: var(--muted); }
.p-sub { flex-basis: 100%; font-size: 12px; line-height: 1.4; color: var(--muted); }
.p-result { min-width: 0; text-align: right; white-space: nowrap; }
.p-result b { font-size: 16px; font-weight: 850; line-height: 22px; font-variant-numeric: tabular-nums; }
.qual { margin-left: 6px; padding: 2px 5px; border-radius: 3px; background: var(--green-soft); color: var(--green); font-size: 11px; font-style: normal; vertical-align: 2px; }
.qual.reserve { color: var(--muted); background: var(--shade); }
.p-history { align-self: flex-start; min-height: 28px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 700; text-align: left; }
.p-history:hover { text-decoration: underline; }
.follow-inline { display: grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 8px; background: none; color: #768ba1; font-size: 20px; line-height: 1; }
.follow-inline.following { color: var(--accent); }
.follow-inline:hover { background: var(--soft); }
.more-people { align-self: flex-start; min-height: 36px; margin: 2px 0 0; padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 740; }
.more-people:hover { text-decoration: underline; }

.row-note { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.row-note.warn { color: var(--amber); }
.row-channels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; }
.channel-chip { padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.channel-note { font-size: 11px; color: var(--muted); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; margin-top: 4px; }
.row-source { flex: 1 1 auto; min-width: 0; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.row-source a { display: inline-block; margin-left: 8px; color: var(--accent); }
.remind-btn { flex: none; min-height: 36px; margin: -4px -4px -4px 0; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--accent); font-size: 12px; font-weight: 740; }
.remind-btn:hover { background: var(--soft); }
.remind-btn.on { background: var(--soft); }

.compact .event-row { padding-top: 6px; padding-bottom: 4px; }
.compact .person { min-height: 32px; }
.compact .row-context, .compact .row-channels { display: none; }

@media(max-width:740px) {
  .scoreboard { --when-col: 62px; }
  .event-row { column-gap: 10px; padding: 9px 4px 7px 10px; }
  .event-rows { border-radius: 10px; }
  .person { min-height: 44px; }
  .follow-inline { min-width: 44px; min-height: 44px; }
  .line, .person { grid-template-columns: minmax(0, 1fr) auto 44px; column-gap: 6px; }
  .people.has-rank .person { grid-template-columns: 22px minmax(0, 1fr) auto 44px; }
  .p-result b { font-size: 15px; }
  .line-score { font-size: 20px; }
  .compact .person { min-height: 40px; }
}

/* The golfer's own history, as before: a list under the golfer's line. */
.golf-history-open { min-height: 32px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 650; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.person .golf-history { grid-column: 1 / -1; margin: 2px 0 8px; padding: 8px 10px; border-left: 3px solid var(--line); background: var(--shade); }
.golf-history ul { margin: 0; padding: 0; list-style: none; }
.golf-history li { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12px; }
.golf-history li:first-child { border-top: 0; }
.golf-history li b { font-size: 11px; letter-spacing: .035em; color: var(--muted); }
.awaiting { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ===== Joukkueottelu: tiivis rivi ja ottelunäkymä =====
   A two-sided team match is a compact row: time and state, the two teams with the score, and the team's Finns
   in small type after (desktop) or under (phone) the team name. The row opens the match view; the stars stay
   above the invisible opener so they never open it. Source, reliability and the reminder live in the view. */
.match-row { cursor: pointer; }
.match-row:hover { background: var(--shade); }
.match-row.live:hover { background: linear-gradient(90deg, var(--red-soft), var(--shade) 40%); }
.match-open { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.match-open:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 8px; }
.match-row .follow-inline { position: relative; z-index: 2; }
.match-row .line { min-height: 30px; align-items: start; }
.match-row .line-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; padding: 3px 0; }
.match-row .line-name strong { display: inline; flex: none; }
.match-row .line-score { padding-top: 3px; }
.match-row .follow-inline { min-height: 30px; }
.line-finns { min-width: 0; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.line-finns .finn.following { color: var(--accent); font-weight: 700; }
.finns-more { white-space: nowrap; font-weight: 650; }
.line-unplaced { margin: 0 0 2px; font-size: 12px; line-height: 18px; color: var(--muted); }
/* The reminder bell sits beside the start time on desktop, so it adds no height; on a phone it goes under it. */
.match-row .row-when { position: relative; }
.match-row .remind-btn { position: absolute; top: -5px; right: -4px; z-index: 2; min-width: 30px; min-height: 30px; margin: 0; padding: 0; font-size: 14px; line-height: 1; }

@media(max-width:740px) {
  .match-row .line { min-height: 28px; }
  .match-row .line-name { display: block; padding: 3px 0 2px; }
  .match-row .line-name strong { display: block; }
  .match-row .follow-inline { min-width: 44px; min-height: 44px; margin-top: -8px; }
  .match-row .remind-btn { position: relative; top: auto; right: auto; min-height: 44px; min-width: 44px; margin: -6px 0 -8px -12px; }
}

.match-dialog { width: min(780px, calc(100% - 48px)); max-width: none; max-height: min(90vh, 860px); padding: 0; overflow: hidden; }
.match-dialog[open] { display: flex; flex-direction: column; }
.match-panel { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.match-bar { flex: none; display: flex; align-items: center; padding: 4px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.match-close { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--accent); font-size: 14px; font-weight: 740; }
.match-close:hover { background: var(--soft); }
.match-close:focus-visible, .match-dialog .remind-btn:focus-visible, .match-dialog .follow-inline:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.match-body { flex: 1 1 auto; min-height: 0; padding: 14px 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
.m-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.m-kicker { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.m-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.m-clock { font-weight: 820; color: var(--red); font-variant-numeric: tabular-nums; }
.m-when { color: var(--muted); }
.m-score { margin: 10px 0 4px; padding: 6px 0; border-block: 1px solid var(--line); }
.m-score .line { grid-template-columns: minmax(0, 1fr) auto 44px; min-height: 44px; }
.m-score .line-name strong { font-size: 18px; line-height: 26px; }
.m-score .line-score { font-size: 28px; line-height: 30px; }
.m-score.is-live .line-score { color: var(--red); }
.m-score.is-pending .line-score { color: var(--amber); }
.m-section { margin-top: 18px; }
.m-section h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.m-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.m-team { min-width: 0; }
.m-team:nth-child(n+3) { grid-column: 1 / -1; }
.m-team h4 { margin: 0 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 780; overflow-wrap: anywhere; }
.m-players { margin: 0; padding: 0; list-style: none; }
.m-player { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; column-gap: 8px; min-height: 44px; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.m-player:first-child { border-top: 0; }
.m-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.m-name strong { font-size: 15px; font-weight: 700; line-height: 22px; overflow-wrap: anywhere; }
.m-tag { font-size: 11px; font-weight: 700; color: var(--green); }
.m-stat { font-size: 15px; font-weight: 820; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-none { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.match-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.match-note.warn { color: var(--amber); }
.m-facts { margin: 0; }
.m-facts > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); font-size: 13px; }
.m-facts > div:first-child { border-top: 0; }
.m-facts dt { color: var(--muted); }
.m-facts dd { margin: 0; overflow-wrap: anywhere; }
.m-facts a { margin-left: 8px; color: var(--accent); }
.m-actions { margin-top: 8px; }
.m-actions .remind-btn { margin: 0; padding-left: 0; }
.match-dialog .row-channels { margin-top: 8px; }

@media(max-width:740px) {
  .match-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; border-radius: 0; }
  .match-body { padding: 12px 14px 28px; }
  .m-teams { grid-template-columns: 1fr; }
  .m-facts > div { grid-template-columns: 96px minmax(0, 1fr); }
  .m-score .line-score { font-size: 26px; }
}

/* ===== Tulokset v4: tulospalvelun rakenne =====
   A results service, not a dashboard: a dark header band, a sidebar (own follows and sports) beside one wide,
   dense list of series headings and one-line-per-team rows. Phones and tablets get the same sports as a
   sideways menu instead of the sidebar. These rules come last on purpose; the board's data, filters and
   address state are unchanged. Nothing below 11px, nothing sticky. */
:root { --head: color-mix(in srgb, var(--accent) 7%, var(--bg)); --tint: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.app-shell { --gutter: 32px; }

/* --- Header band --- */
.site-header { background: var(--deep); color: #fff; }
.site-header .topbar { max-width: 1280px; min-height: 48px; height: 48px; gap: 20px; padding: 0 var(--gutter, 32px); }
.topbar:before { display: none; }
.site-header .brand { font-size: 19px; color: #fff; }
.site-header .brand b { color: color-mix(in srgb, var(--accent) 40%, #fff); }
.site-header .brand-mark { width: 28px; height: 28px; border-radius: 6px; }
.site-header .brand-mark:before { left: 9px; width: 4px; }
.site-header .brand-mark:after { top: 11px; height: 4px; }
.site-header .swatch:before { opacity: .9; }
.site-header .swatch[aria-pressed="true"]:before { box-shadow: 0 0 0 2px var(--deep), 0 0 0 4px #fff; }
@media(min-width:741px) {
  .site-header .topnav { gap: 2px; height: 48px; }
  .site-header .topnav a { min-height: 48px; height: 48px; padding: 0 14px; color: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 700; }
  .site-header .topnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
  .site-header .topnav a.active { color: #fff; border-bottom-color: #fff; }
  html[data-page="results"] .topnav:not(.ready) a[data-page-link="results"],
  html[data-page="athletes"] .topnav:not(.ready) a[data-page-link="athletes"],
  html[data-page="calendar"] .topnav:not(.ready) a[data-page-link="calendar"] { color: #fff; border-bottom-color: #fff; }
  .site-header .topnav a:focus-visible, .site-header .brand:focus-visible { outline-color: #fff; }
}
@media(max-width:740px) {
  .app-shell { --gutter: 16px; }
  .site-header .topbar { min-height: 48px; height: 48px; padding: 0 16px; }
  .site-header .brand { font-size: 18px; }
  .site-header .swatch, .site-header .swatch.blue, .site-header .swatch.forest { width: 40px; height: 40px; }
  .site-header .brand:focus-visible { outline-color: #fff; }
}

/* --- Page frame: sidebar and board --- */
html[data-page="results"] .scoreboard { max-width: 1180px; padding: 0 0 20px; }
.board-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 0 20px; align-items: start; padding-top: 14px; }
.board-main { min-width: 0; }
.sport-menu { display: none; }

.board-side { min-width: 0; }
.side-block { margin: 0 0 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); background: var(--head); }
.side-head h2 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side-link { min-height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--accent); font-size: 12px; font-weight: 740; }
.side-link:hover { background: var(--soft); }
.side-list { margin: 0; padding: 4px 0; list-style: none; }
.side-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 12px; border: 0; background: none; color: var(--ink); font-size: 13px; text-align: left; }
.side-item:hover, .side-more:hover { background: var(--shade); }
.side-star { flex: none; font-size: 12px; color: var(--accent); }
.side-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 680; }
.side-state { flex: none; min-width: 18px; font-size: 11px; font-weight: 800; line-height: 16px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-state.live { padding: 0 5px; border-radius: 3px; background: var(--red); color: #fff; }
.side-item.is-quiet .side-name { font-weight: 560; color: var(--muted); }
.side-more { display: block; width: 100%; min-height: 32px; padding: 0 12px; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 740; text-align: left; }
.side-empty { padding: 8px 12px 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.side-item:focus-visible, .side-more:focus-visible, .side-link:focus-visible, .side-sports .sport-button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 6px; }

.side-sports .sport-list { display: flex; flex-direction: column; gap: 0; max-height: none; padding: 4px 0; overflow: visible; }
.side-sports .sport-button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 12px; border: 0; border-radius: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 600; text-align: left; box-shadow: inset 3px 0 0 transparent; }
.side-sports .sport-button:hover { background: var(--shade); }
.side-sports .sport-button.active { background: var(--soft); color: var(--accent); font-weight: 780; box-shadow: inset 3px 0 0 var(--accent); }
.sport-ico { flex: none; width: 18px; font-size: 14px; line-height: 1; text-align: center; }
.sport-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sports .sport-button small { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-sports .sport-button.active small { color: var(--accent); opacity: 1; }

/* --- Board heading, date row --- */
.board-head { align-items: center; gap: 10px; padding: 0 0 8px; }
.board-head h1 { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.board-date-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.today-link { min-height: 28px; padding: 0 12px; border-radius: 14px; font-size: 12px; }
.date-nav { gap: 4px; margin-bottom: 10px; }
.date-step { width: 32px; min-height: 38px; border-radius: 8px; font-size: 20px; }
.date-nav .date-strip { gap: 3px; }
.date-chip { flex-direction: row; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 4px; border-radius: 8px; line-height: 1; }
.date-chip span { font-size: 11px; font-weight: 750; text-transform: uppercase; }
.date-chip strong { font-size: 15px; font-weight: 800; }
.date-chip .date-count { min-width: 20px; padding: 0 5px; border-radius: 9px; background: var(--shade); font-size: 11px; font-weight: 700; line-height: 16px; color: var(--muted); }
.date-chip.in-week .date-count { background: var(--surface); }
.date-chip.active .date-count { background: rgba(255, 255, 255, .22); color: var(--accent-ink); }

/* --- Toolbar: status tabs, search, options, own follows --- */
.board-toolbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px; border-bottom: 1px solid var(--line); }
.score-filters { flex: 1 1 auto; align-self: stretch; gap: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.score-filters .score-filter { position: relative; min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 740; }
.score-filters .score-filter:hover { background: none; color: var(--ink); }
.score-filters .score-filter.active { background: none; color: var(--ink); border-bottom-color: var(--accent); }
.score-filters .score-filter[data-score-filter="live"].active { background: none; color: var(--red); border-bottom-color: var(--red); }
.score-filters .score-filter[data-score-filter="finished"].active { background: none; color: var(--ink); border-bottom-color: var(--accent); }
.score-filters .score-filter:focus-visible { outline-offset: -3px; }
.chip-count, .score-filter.active .chip-count { min-width: 18px; padding: 0 5px; background: var(--red); color: #fff; line-height: 16px; }
.board-toolbar .board-controls { position: static; display: flex; align-items: center; gap: 6px; margin: 0; }
.board-toolbar .board-controls .search-bar { width: 200px; min-height: 34px; margin: 0; padding: 0 8px; border-radius: 8px; }
.board-toolbar .board-controls .search-bar input { font-size: 13px; padding: 6px 0; }
.search-icon { font-size: 18px; line-height: 1; }
.board-options { position: relative; margin: 0; }
#boardOptionsToggle { position: static; width: auto; height: 34px; gap: 6px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 740; white-space: nowrap; }
.filter-badge { min-width: 18px; line-height: 16px; }
#boardOptionsPanel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 320px; gap: 12px; margin: 0; padding: 12px; border-radius: 10px; box-shadow: 0 12px 32px rgba(18, 46, 79, .18); }
.board-toolbar .follow-control { flex: none; margin: 0 0 0 auto; }
.follow-control .score-filter { min-height: 40px; gap: 8px; padding: 0 2px; font-size: 12px; font-weight: 740; }
.switch-track { width: 32px; height: 18px; }
.switch-track i { top: 2px; left: 2px; width: 14px; height: 14px; }
.follow-control .score-filter.active .switch-track i { transform: translateX(14px); }
.follow-count { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--soft); color: var(--accent); font-size: 11px; line-height: 16px; text-align: center; }
.follow-count[hidden] { display: none; }

/* --- Groups: status headings, series headings --- */
.status-group, .day-group { margin-bottom: 10px; }
.group-heading { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.status-group:first-child > .group-heading, .day-group:first-child > .group-heading { margin-top: 2px; }
.group-heading small { padding: 0 6px; font-size: 11px; line-height: 16px; font-weight: 700; }
.group-note { margin: -2px 0 6px; font-size: 12px; }
.league-group { margin: 0 0 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.league-head { min-height: 34px; gap: 8px; padding: 0 10px 0 12px; border-radius: 0; background: var(--head); color: var(--ink); font-size: 13px; font-weight: 760; }
.league-head:hover { background: color-mix(in srgb, var(--accent) 11%, var(--bg)); }
.league-group:not(.collapsed) > .league-head { border-bottom: 1px solid var(--line); }
.league-head:focus-visible { outline-offset: -3px; border-radius: 0; }
.league-icon { font-size: 14px; }
.league-name { font-weight: 780; }
.league-sport { font-size: 12px; font-weight: 600; }
.league-live { font-size: 11px; line-height: 16px; }
.league-count { flex: none; margin-left: auto; min-width: 20px; padding: 0 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; color: var(--muted); }
.league-caret { margin-left: 2px; }
.event-rows { border: 0; border-radius: 0; background: none; }

/* --- Rows --- */
.scoreboard { --when-col: 62px; }
.event-row { column-gap: 10px; padding: 4px 4px 4px 12px; }
.row-when { gap: 1px; font-size: 12px; }
.when-main { font-size: 13px; line-height: 18px; font-weight: 760; }
.when-main.when-date { font-size: 12px; line-height: 1.3; padding-top: 1px; }
.when-clock { font-size: 12px; }
.row-status { padding: 1px 4px; font-size: 11px; line-height: 14px; }
.row-status.upcoming, .row-status.finished { padding: 0; }
.row-status.finished.stale, .row-status.upcoming.stale { padding: 1px 4px; }
.row-status:not(.live) { text-transform: lowercase; letter-spacing: 0; }
.row-status:not(.live)::first-letter { text-transform: uppercase; }
.line, .person { grid-template-columns: minmax(0, 1fr) auto 32px; column-gap: 6px; }
.line { min-height: 24px; }
.line-name strong { font-size: 14px; line-height: 20px; font-weight: 700; }
.line-score { min-width: 1.5em; font-size: 15px; line-height: 20px; font-weight: 820; }
.line.team.trail strong { font-weight: 520; }
.line.team.trail .line-score { font-weight: 640; }
.line .follow-inline, .person .follow-inline { min-width: 32px; min-height: 24px; font-size: 16px; }
.match-row .line { min-height: 24px; align-items: center; }
.match-row .line-name { padding: 2px 0; gap: 0 8px; }
.match-row .line-score { padding-top: 0; }
.match-row .follow-inline { min-height: 24px; }
.line-finns { font-size: 12px; line-height: 16px; }
.line-unplaced { font-size: 12px; line-height: 16px; }
.match-row .remind-btn { top: -4px; right: -2px; min-width: 24px; min-height: 24px; font-size: 13px; }
.row-context { margin: 0; font-size: 12px; line-height: 16px; }
.match-title { font-size: 14px; line-height: 20px; }
.line + .people { margin-top: 2px; padding-top: 2px; }
.person { min-height: 28px; }
.people.has-rank .person { grid-template-columns: 24px minmax(0, 1fr) auto 32px; }
.p-name { gap: 0 8px; padding: 2px 0; }
.p-name strong { font-size: 14px; line-height: 20px; font-weight: 700; }
.p-cat, .p-sub { font-size: 12px; line-height: 16px; }
.p-result b { font-size: 14px; line-height: 20px; font-weight: 820; }
.p-rank { font-size: 12px; }
.more-people { min-height: 28px; font-size: 12px; }
.row-note { margin: 2px 0 0; font-size: 12px; line-height: 16px; }
.row-channels { margin-top: 3px; }
.row-meta { margin-top: 2px; }
.row-source { font-size: 11px; line-height: 16px; }
.remind-btn { min-height: 28px; margin: -2px -2px -2px 0; font-size: 12px; }
.compact .event-row { padding-top: 3px; padding-bottom: 3px; }
.compact .person { min-height: 24px; }

/* Followed events: a quiet tint and a thin bar; LIVE and unconfirmed keep their own, stronger mark. */
.event-row.followed-event { background: var(--tint); box-shadow: inset 2px 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
.event-row.followed-event.match-row:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.event-row.live { box-shadow: inset 3px 0 0 var(--red); background: linear-gradient(90deg, var(--red-soft), var(--surface) 40%); }
.event-row.is-pending { box-shadow: inset 3px 0 0 var(--amber); }
.event-row.flash { box-shadow: inset 3px 0 0 var(--accent); background: var(--soft); }

.stats-row { padding: 8px 0; font-size: 12px; }
.empty-state { padding: 18px 14px; border-radius: 8px; }
.board-note { border-radius: 8px; }
.skeleton i { height: 48px; border-radius: 8px; }

/* --- Narrower than the sidebar layout: sports become a sideways menu above the board --- */
@media(max-width:999px) {
  .board-layout { display: block; padding-top: 0; }
  .board-side { display: none; }
  .sport-menu { position: relative; display: flex; gap: 6px; margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: var(--surface); border-bottom: 1px solid var(--line); }
  .sport-menu::-webkit-scrollbar { display: none; }
  .sport-menu .sport-button { flex: none; display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap; }
  .sport-menu .sport-button small { font-size: 11px; font-weight: 700; color: var(--muted); }
  .sport-menu .sport-button.active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
  .sport-menu .sport-button.active small { color: var(--accent-ink); opacity: .85; }
  .sport-menu .sport-button:focus-visible { outline-offset: 0; }
  .board-head { padding-top: 10px; }
}

@media(max-width:740px) {
  html[data-page="results"] .scoreboard { padding: 0 0 12px; }
  .board-head { padding: 8px 0 6px; }
  .board-head .board-date-label { font-size: 11px; }
  .board-head:not(:has(#todayDate:not([hidden]))) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .date-nav { margin-bottom: 6px; }
  .date-step { width: 30px; min-height: 42px; }
  .date-chip { flex-direction: column; justify-content: center; gap: 1px; min-height: 42px; padding: 0; }
  .date-chip span { font-size: 11px; line-height: 12px; }
  .date-chip strong { font-size: 15px; line-height: 17px; }
  .date-chip .date-count { display: none; }
  .board-toolbar { gap: 0 6px; margin-bottom: 8px; }
  .score-filters { flex: 1 1 calc(100% - 52px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .score-filters .score-filter { justify-content: center; padding: 0 2px; }
  .board-toolbar .board-controls { display: contents; }
  .board-toolbar .board-controls .search-bar { flex: 1 1 60%; width: auto; min-width: 0; min-height: 36px; margin: 4px 0 6px; }
  .board-toolbar .board-controls .search-bar input { font-size: 16px; }
  .board-options { position: static; margin: 4px 0 6px; }
  #boardOptionsToggle { height: 36px; }
  #boardOptionsPanel { position: absolute; top: 100%; left: 0; right: 0; width: auto; margin-top: 4px; }
  /* The switch becomes a star toggle beside the tabs; its text stays for screen readers. */
  .board-toolbar .follow-control { flex: 0 0 44px; margin: 0; }
  .follow-control .score-filter { position: relative; justify-content: center; width: 44px; min-height: 40px; padding: 0; }
  .follow-control .switch-track, .follow-control .switch-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .follow-control .score-filter::before { content: "\2606"; font-size: 22px; line-height: 1; color: var(--muted); }
  .follow-control .score-filter.active::before { content: "\2605"; color: var(--accent); }
  .follow-count { position: absolute; top: 3px; right: 0; min-width: 16px; padding: 0 4px; font-size: 11px; line-height: 14px; }

  .event-row { column-gap: 8px; padding: 6px 2px 6px 10px; }
  .scoreboard { --when-col: 54px; }
  .line, .person { grid-template-columns: minmax(0, 1fr) auto 40px; column-gap: 6px; }
  .people.has-rank .person { grid-template-columns: 22px minmax(0, 1fr) auto 40px; }
  .line .follow-inline, .person .follow-inline { min-width: 40px; min-height: 32px; }
  .person { min-height: 36px; }
  .line-score { font-size: 15px; }
  .p-result b { font-size: 14px; }
  .match-row .line { min-height: 28px; align-items: center; }
  .match-row .line-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 3px 0; }
  .match-row .follow-inline { min-width: 40px; min-height: 28px; margin-top: 0; }
  .match-row .remind-btn { position: relative; top: auto; right: auto; min-width: 32px; min-height: 28px; margin: 0 0 0 -6px; }
  .group-heading { margin: 10px 0 5px; }
  .league-head { min-height: 36px; }
}
@media(min-width:1000px) and (max-width:1139px) {
  .board-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 0 16px; }
}
@media(min-width:741px) and (max-width:999px) {
  .board-toolbar .board-controls .search-bar { width: 170px; }
}

/* A long source-written result (a bout summary) wraps in its own column and never squeezes the name. */
.line, .person { grid-template-columns: minmax(8em, 1fr) minmax(0, auto) 32px; }
.people.has-rank .person { grid-template-columns: 24px minmax(8em, 1fr) minmax(0, auto) 32px; }
.p-result { max-width: 22em; white-space: normal; overflow-wrap: anywhere; }
.p-result b { display: inline-block; }
@media(max-width:740px) {
  .line, .person { grid-template-columns: minmax(6em, 1fr) minmax(0, auto) 40px; }
  .people.has-rank .person { grid-template-columns: 22px minmax(6em, 1fr) minmax(0, auto) 40px; }
  .p-result { max-width: 11em; }
}
@media(max-width:740px) { .p-result { max-width: 13em; } .p-result b { font-size: 13px; font-weight: 740; } }
@media(max-width:740px) {
  .event-row { padding-top: 5px; padding-bottom: 5px; }
  .match-row .line { min-height: 26px; }
  .match-row .line-name { padding: 2px 0; }
  .match-row .follow-inline { min-height: 26px; }
}
@media(min-width:741px) and (max-width:999px) {
  .board-toolbar .board-controls { flex: 1 1 100%; margin-bottom: 6px; }
  .board-toolbar .board-controls .search-bar { flex: 1 1 auto; width: auto; }
}

/* ===== Suomalaisten nimet rivillä =====
   The names sit after the team name on the team's own line, at every width. Their slot takes what the team name,
   the score and the star leave (at least room for a "+N"); fitFinns in app.js shows as many whole names as fit and
   an exact "+N" for the rest. Nothing wraps or is cut with an ellipsis; the slot clips only as a safety net. */
.match-row .line-name { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.match-row .line-name strong { display: block; flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.line-finns { flex: 1 1 0; min-width: 4.5em; white-space: nowrap; overflow: hidden; }
.finn { display: inline-block; padding-right: .4em; }
.finn::after { content: ","; }
.finn.last::after { content: none; }
.finn[hidden], .finns-more[hidden] { display: none; }
.finns-more { display: inline-block; font-weight: 650; font-variant-numeric: tabular-nums; }
.finn-probe { position: absolute; top: 0; left: 0; flex: none; min-width: 0; overflow: visible; visibility: hidden; pointer-events: none; }
.line-unplaced { display: flex; align-items: baseline; gap: 0 6px; }
.unplaced-label { flex: none; }
@media(max-width:360px) { .score-filters .score-filter { font-size: 12px; } }

/* ===== Lomakkeet: uutiskirje, ansakenttä ja tietosuoja ===== */
/* The honeypot: off screen and out of the tab order. A person never fills it; a form-filling bot does. */
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.form-note a, .privacy-body a, footer a { color: var(--accent); }
.newsletter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.newsletter h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.04em; }
.newsletter-copy p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.newsletter-form { display: grid; gap: 12px; }
.newsletter-consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; line-height: 1.5; }
.newsletter-consent input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.newsletter-form .dark-button { justify-self: start; }
.newsletter-status, .newsletter-result { margin: 0; font-size: 12px; font-weight: 650; line-height: 1.5; color: var(--ink); }
#newsletterAction[hidden] { display: none; }
@media(max-width:740px) {
  .newsletter { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 24px; padding: 16px; }
  .newsletter-form .dark-button { justify-self: stretch; }
}
