:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #1c251c;
  background: #f9f9f5;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #527b3a; outline-offset: 2px; }

.site-header {
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #dee3d8;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand > span { font-size: 25px; font-weight: 900; letter-spacing: -.075em; }
.brand-dot { color: #78a935; }
.brand small, .site-header > a { display: none; }

main { padding: 0; }
.page-intro { display: none; }
.toolbar { padding: 14px 16px 0; background: #fff; border-bottom: 1px solid #d9e0d6; }
.toolbar-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 6px; }
.view-switch { grid-column: 1; grid-row: 1; display: flex; background: #f0f2ec; }
.view-switch button { min-width: 55px; height: 40px; padding: 0 8px; border: 0; background: transparent; color: #526052; font-size: 12px; font-weight: 700; }
.view-switch button.active { color: #fff; background: #1c251c; }
.toolbar-actions { grid-column: 2; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 6px; min-width: 0; }
.date-jump { display: flex; align-items: center; gap: 0; color: #5c695d; font-size: 0; }
.date-jump input { width: 116px; height: 40px; padding: 0 5px; border: 1px solid #c7d0c5; border-radius: 0; background: #fff; color: #1c251c; font-size: 12px; }
.refresh-button { width: 40px; height: 40px; padding: 0; border: 1px solid #c7d0c5; background: #fff; color: #1c251c; font-size: 23px; line-height: 1; }
.refresh-label { display: none; }
.period-nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px 44px; gap: 5px; align-items: center; }
.period-nav strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-size: 15px; line-height: 40px; }
.icon-button, .today-button { height: 40px; border: 1px solid #c7d0c5; background: #fff; color: #1c251c; font-weight: 700; }
.icon-button { width: 40px; font-size: 18px; }
.today-button { width: 44px; padding: 0; font-size: 11px; }
.icon-button:hover, .today-button:hover, .refresh-button:hover { background: #edf5dc; }
.filters-toggle { display: flex; width: 100%; height: 46px; margin-top: 11px; padding: 0; align-items: center; gap: 4px; border: 0; border-top: 1px solid #e2e7de; background: transparent; color: #364536; text-align: left; font-size: 13px; font-weight: 750; }
.filters-toggle > span:last-child { margin-left: auto; font-size: 17px; transition: transform .15s; }
.filters-toggle[aria-expanded="true"] > span:last-child { transform: rotate(180deg); }
.filter-row { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 0 15px; }
.filter-row.is-open { display: grid; }
.filter-row label { display: block; color: #5c695d; font-size: 11px; font-weight: 700; }
.filter-row select { display: block; width: 100%; min-width: 0; height: 42px; margin-top: 5px; padding: 4px 23px 4px 8px; border: 1px solid #c7d0c5; border-radius: 0; background: #fff; color: #1c251c; font-size: 12px; }

.status-row { display: flex; align-items: center; min-height: 31px; padding: 0 16px; color: #6a786a; font-size: 11px; }
.status-check { color: #527b3a; font-weight: 900; }
.status-error { color: #a65c42; }
.status-muted { color: #7a877b; }
.status-spinner { display: inline-block; width: 11px; height: 11px; margin-right: 5px; border: 2px solid #cdd9c3; border-top-color: #1d241e; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.calendar-panel { min-height: 350px; background: #fff; }
.mobile-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid #dfe5da; }
.mobile-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; height: 66px; padding: 0; border: 0; border-bottom: 3px solid transparent; background: #fff; color: #6f7b6e; }
.mobile-day span { white-space: nowrap; font-size: 10px; font-weight: 650; }
.mobile-day strong { font-size: 18px; line-height: 1; font-weight: 780; }
.mobile-day.active { border-bottom-color: #1c251c; background: #e7f5c6; color: #1c251c; }
.mobile-day.is-past:not(.active) { color: #aab3a8; }
.mobile-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 49px; padding: 0 16px; border-bottom: 1px solid #dfe5da; background: #f4f6ef; }
.mobile-list-heading strong { font-size: 13px; letter-spacing: -.015em; }
.mobile-list-heading span { white-space: nowrap; color: #6b7769; font-size: 11px; }
.mobile-result { border-bottom: 1px solid #dfe5da; }
.mobile-slot { display: grid; grid-template-columns: 105px minmax(0, 1fr) 17px; align-items: center; gap: 8px; width: 100%; min-height: 73px; padding: 9px 16px; border: 0; background: #fff; color: #1c251c; text-align: left; }
.mobile-slot:hover { background: #f6f9ef; }
.mobile-slot[aria-expanded="true"] { background: #eef6da; }
.mobile-slot-hour { display: flex; flex-direction: column; gap: 1px; font-size: 24px; line-height: 1; letter-spacing: -.045em; font-weight: 800; }
.mobile-slot-hour span { color: #738071; font-size: 11px; line-height: 1.4; letter-spacing: 0; font-weight: 600; }
.mobile-slot-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mobile-slot-main strong { font-size: 13px; line-height: 1.2; font-weight: 750; }
.mobile-slot-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6a786a; font-size: 11px; }
.mobile-slot-chevron { color: #4e6840; text-align: center; font-size: 21px; font-weight: 350; }
.mobile-slot-details { padding: 0 16px 11px; background: #eef6da; }
.mobile-venue { padding: 11px 0; border-top: 1px solid #d0dfb9; }
.mobile-venue-title { display: flex; align-items: baseline; gap: 7px; }
.mobile-venue-title strong { font-size: 12px; }
.mobile-venue-title span { color: #63725e; font-size: 10px; }
.mobile-courts { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.mobile-courts span { padding: 4px 6px; background: #fff; font-size: 10px; }
.mobile-venue a { display: inline-block; padding: 4px 0; color: #2d5c25; font-size: 11px; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.mobile-empty { padding: 44px 24px; color: #627060; text-align: center; font-size: 13px; line-height: 1.5; }
.mobile-note { margin: 0; padding: 13px 16px; background: #fff8f2; color: #8c674b; font-size: 11px; line-height: 1.4; }
footer { padding: 19px 16px 28px; color: #788576; font-size: 10px; line-height: 1.5; }

@media (min-width: 701px) {
  .site-header { min-height: 66px; padding: 0 max(28px, calc((100vw - 920px) / 2)); }
  .brand > span { font-size: 27px; }
  .brand small { display: inline; color: #7a877b; font-size: 11px; font-weight: 600; }
  .site-header > a { display: inline; color: #526052; font-size: 12px; text-decoration: none; }
  .site-header > a:hover { text-decoration: underline; text-underline-offset: 3px; }
  main { width: min(calc(100% - 56px), 920px); margin: 0 auto; }
  .page-intro { display: block; padding: 40px 0 28px; }
  .page-intro h1 { margin: 0; font-size: clamp(30px, 3vw, 40px); line-height: 1.08; letter-spacing: -.055em; font-weight: 820; }
  .page-intro p { margin: 10px 0 0; color: #6a786a; font-size: 14px; line-height: 1.5; }
  .toolbar { padding: 20px 24px 0; border: 1px solid #d9e0d6; }
  .toolbar-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; }
  .view-switch { grid-column: 1; grid-row: 1; }
  .view-switch button { min-width: 72px; }
  .period-nav { grid-column: 2; grid-row: 1; grid-template-columns: 40px minmax(0, 1fr) 40px 46px; margin: 0; }
  .period-nav strong { font-size: 16px; }
  .toolbar-actions { grid-column: 3; grid-row: 1; }
  .date-jump input { width: 130px; }
  .filters-toggle { margin-top: 20px; }
  .filter-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding-bottom: 20px; }
  .status-row { min-height: 42px; padding: 0 2px; }
  .calendar-panel { border: 1px solid #d9e0d6; }
  .mobile-week-days { padding: 0 24px; }
  .mobile-day { height: 72px; }
  .mobile-day span { font-size: 11px; }
  .mobile-day strong { font-size: 22px; }
  .mobile-list-heading { min-height: 55px; padding: 0 28px; }
  .mobile-list-heading strong { font-size: 14px; }
  .mobile-list-heading span { font-size: 12px; }
  .mobile-slot { grid-template-columns: 165px minmax(0, 1fr) 24px; min-height: 83px; gap: 20px; padding: 12px 28px; }
  .mobile-slot-hour { font-size: 28px; }
  .mobile-slot-hour span { font-size: 12px; }
  .mobile-slot-main strong { font-size: 15px; }
  .mobile-slot-main small { font-size: 12px; }
  .mobile-slot-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; padding: 4px 28px 16px 213px; }
  .mobile-venue { padding: 14px 0; }
  .mobile-venue-title strong { font-size: 13px; }
  .mobile-venue-title span, .mobile-courts span, .mobile-venue a { font-size: 11px; }
  footer { padding: 24px 2px 38px; font-size: 11px; }
}

@media (min-width: 701px) and (max-width: 950px) {
  .toolbar-top { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .period-nav { grid-column: 2; }
  .toolbar-actions { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}

@media (max-width: 350px) {
  .view-switch button { min-width: 48px; padding: 0 5px; }
  .date-jump input { width: 99px; font-size: 10px; }
  .refresh-button { width: 36px; }
  .mobile-slot { grid-template-columns: 91px minmax(0, 1fr) 15px; gap: 6px; }
  .mobile-slot-hour { font-size: 22px; }
}
