:root {
  --available: #4caf50;
  --link: #4a90d9;
  --reserved: #b0b0b0;
  --closed: #e0e0e0;
  --unknown: #f0d060;
  --ink: #1c2733;
  --muted: #6b7684;
  --border: #e3e7eb;
  --bg: #f7f9fb;
  --card-bg: #ffffff;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 0 1rem 3rem;
}

.page-header {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 0 1rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

.lang-switch {
  flex: 0 0 auto;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.lang-btn {
  border: none;
  background: var(--card-bg);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.lang-btn.active {
  background: var(--ink);
  color: white;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.updated-at {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.section-title {
  max-width: 960px;
  margin: 2rem auto 0.75rem;
  font-size: 1.1rem;
}

.query-card {
  max-width: 960px;
  margin: 0 auto 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.query-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.query-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.query-field {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: var(--muted);
  gap: 0.3rem;
}

.query-field select {
  font-size: 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  min-width: 140px;
}

.recommendations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.recommend-card {
  background: linear-gradient(160deg, #eefaf0, #ffffff);
  border: 1px solid #cdeed4;
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.recommend-flag {
  display: inline-block;
  background: #227a34;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.recommend-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.recommend-detail {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.recommend-link {
  font-size: 0.8rem;
  color: var(--link);
  text-decoration: none;
}
.recommend-link:hover { text-decoration: underline; }

.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  padding: 0.4rem 0.1rem;
  border-bottom: 1px solid var(--border);
}

.result-info {
  flex: 1 1 auto;
  min-width: 200px;
}

.result-name {
  font-weight: 600;
}

.category-breakdown {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.occupancy-note {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

.result-row a {
  font-size: 0.78rem;
  color: var(--link);
  text-decoration: none;
}
.result-row a:hover { text-decoration: underline; }

.date-tabs {
  max-width: 960px;
  margin: 0 auto 1.5rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.date-tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
}

.date-tab.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.date-tab .dow {
  display: block;
  font-size: 0.7rem;
  color: inherit;
  opacity: 0.7;
}

.venues {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.venue-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.venue-card.errored {
  border-color: #e5a3a3;
}

.venue-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.venue-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.venue-head a {
  font-size: 0.8rem;
  color: var(--link);
  text-decoration: none;
}
.venue-head a:hover { text-decoration: underline; }

.venue-badge {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}
.venue-badge.free { background: #e5f6e8; color: #227a34; }
.venue-badge.none { background: #f3e6e6; color: #8a2f2f; }
.venue-badge.na { background: #eee; color: #777; }

.venue-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.4rem 0 0.6rem;
}

.timeline-wrap {
  margin-top: 0.6rem;
  overflow-x: auto;
}

.timeline-hours {
  display: grid;
  grid-template-columns: 160px repeat(32, minmax(14px, 1fr));
  font-size: 0.65rem;
  color: var(--muted);
  min-width: 640px;
}
.timeline-hours .hour-label {
  grid-column: span 2;
  border-left: 1px solid var(--border);
  padding-left: 2px;
}

.resource-row {
  display: grid;
  grid-template-columns: 160px repeat(32, minmax(14px, 1fr));
  align-items: center;
  min-width: 640px;
  height: 22px;
}

.resource-name {
  font-size: 0.75rem;
  padding-right: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot {
  height: 16px;
  border-radius: 3px;
  margin: 0 1px;
}
.slot.available { background: var(--available); }
.slot.reserved { background: var(--reserved); }
.slot.closed { background: var(--closed); }
.slot.unknown { background: var(--unknown); }

.now-line {
  position: relative;
}

.no-data {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.5rem 0;
}

.page-footer {
  max-width: 960px;
  margin: 2rem auto 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.swatch.available { background: var(--available); }
.swatch.reserved { background: var(--reserved); }
.swatch.closed { background: var(--closed); }
.swatch.unknown { background: var(--unknown); }
