.month-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 0;
}

.month-weekday-header span {
  text-align: center;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  border-bottom: none;
  margin: 0;
}

.month-weekday-header span:first-child {
  border-radius: var(--radius-xl) 0 0 0;
}

.month-weekday-header span:last-child {
  border-radius: 0 var(--radius-xl) 0 0;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}

.month-day {
  background: var(--card);
  aspect-ratio: auto;
  min-height: 80px;
  height: 100px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.month-day.today {
  background: rgba(0, 82, 255, 0.03);
}

.month-day.other-month {
  opacity: 0.35;
}

.month-day-header {
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.month-day-num {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.month-day.today .month-day-num {
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.75rem;
}

.month-day-events {
  flex: 1;
  padding: 0 3px 3px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  min-width: 0;
}

.month-event-chip {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.625rem;
  line-height: 1.5;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity var(--duration-fast) ease;
  min-width: 0;
}

.month-event-chip:hover {
  opacity: 0.75;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.month-nav-label {
  font-family: var(--font-display), var(--font-cjk);
  font-size: 1.25rem;
  flex: 1;
  text-align: center;
}

.school-schedule-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
}

.school-schedule-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.school-schedule-table th,
.school-schedule-table td {
  border: 1px solid var(--border);
  vertical-align: top;
}

.school-schedule-table thead th {
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  padding: 10px 8px;
}

.school-schedule-table thead th:first-child {
  width: 72px;
}

.school-schedule-table thead th:nth-child(2) {
  width: 120px;
}

.school-schedule-table thead th span {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.school-schedule-table thead th.today {
  background: rgba(0, 82, 255, 0.08);
  color: var(--accent);
}

.school-period,
.school-time {
  background: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.school-period {
  padding: 12px 8px;
}

.school-period-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 28px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 700;
}

.school-time {
  padding: 14px 8px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.school-schedule-cell {
  height: 76px;
  padding: 6px;
  background: var(--card);
  cursor: cell;
}

.school-schedule-cell.today {
  background: rgba(0, 82, 255, 0.03);
}

.school-schedule-cell:hover {
  background: var(--muted);
}

.school-cell-events {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 4px;
}

.school-event-chip {
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  line-height: 1.35;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
  .month-nav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .month-nav-label {
    order: -1;
    flex: 0 0 100%;
    font-size: 1rem;
  }

  .month-day {
    min-height: 60px;
    height: auto;
  }

  .month-event-chip {
    font-size: 0.5625rem;
    padding: 1px 3px;
  }

  .month-day-num {
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
  }

  .school-schedule-table {
    min-width: 760px;
  }

  .school-schedule-cell {
    height: 68px;
  }
}
