#legend {
  width: 100%;
  top: -24px;
  position: absolute;
  text-align: right;
  font-size: 13px;
}

#legend .box {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #ffe3e6;
  margin-right: 4px;
  vertical-align: middle;
}

/* カレンダーエリア */
#calendar {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
  box-sizing: border-box;
}

.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(6, 1fr);
  border: 1px solid #aaa;
  border-radius: 4px;
}

.month .title {
  grid-column: 1/8;
  text-align: center;
  font-weight: bold;
  padding: 4px 0;
}

.month .cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

#calendar:not(.readonly) .month .cell:not(.header):not(:empty) {
  cursor: pointer;
}

.month .cell:not(:empty) {
  padding: 2px 0;
}

.month .sun {
  color: #e74c3c;
}

.month .sat {
  color: #2196f3;
}

.month .cell.selected {
  background: #ffe3e6;
}

#calendar:not(.readonly) .month .cell:not(.header):not(.selected):not(:empty):hover {
  background: #ffe3e677;
}

#calendar:not(.readonly) .month .cell.selected:hover {
  background: #ffd3d7;
}
