* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  padding: 1.5rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

#filters {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 2px solid;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
  background: white;
}

.filter-btn.active {
  color: white;
}

.filter-btn:hover {
  opacity: 0.85;
}

.calendar-container {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto;
}

.calendar-month {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  min-width: 0;
}

.calendar-month h2 {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #2c3e50;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.day-header {
  background: #f7f8fa;
  text-align: center;
  padding: 0.45rem 0.2rem;
  font-weight: 700;
  font-size: 0.75rem;
  color: #5a6a7a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e0e0e0;
}

.day-header:not(:last-child) {
  border-right: 1px solid #ebebeb;
}

.day-cell {
  min-height: 75px;
  padding: 3px;
  border-top: 1px solid #ebebeb;
  border-right: 1px solid #ebebeb;
  position: relative;
  overflow: hidden;
}

.day-cell:nth-child(7n) {
  border-right: none;
}

.day-cell.outside {
  background: #fafbfc;
}

.day-number {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 2px;
  padding: 1px 4px;
  display: inline-block;
}

.day-cell.today .day-number {
  background: #2c3e50;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.day-cell.outside .day-number {
  color: #c0c0c0;
}

.event {
  font-size: 0.65rem;
  padding: 2px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  cursor: default;
  line-height: 1.3;
  font-weight: 500;
}

.event-time {
  font-weight: 700;
}

.events-overflow {
  font-size: 0.6rem;
  color: #888;
  padding: 1px 4px;
  cursor: default;
}

@media (max-width: 768px) {
  body { padding: 1rem 0.5rem; }
  .calendar-container { flex-direction: column; }
  .day-cell { min-height: 60px; }
  h1 { font-size: 1.3rem; }
  .event { font-size: 0.6rem; }
}
